Ticket #36394: gnuplot-4.6.1.patch

File gnuplot-4.6.1.patch, 18.3 KB (added by mojca (Mojca Miklavec), 12 years ago)

Update gnuplot to version 4.6.1

  • Portfile

    PortSystem 1.0 
    55PortGroup                   xcodeversion 1.0
    66
    77name                        gnuplot
    8 version                     4.6.0
    9 revision                    2
     8version                     4.6.1
    109categories                  math science
    1110# the license has some inconvenient requirements that we're not meeting
    1211# to be allowed to distribute binaries
    dist_subdir ${name}/${version} 
    3231distfiles-append            ${name}.pdf
    3332extract.only                ${distname}.tar.gz
    3433checksums                   ${distname}.tar.gz \
    35                             rmd160  2c06500f45fb81850b45713a2cd0e38f0021b065 \
    36                             sha256  6e60adb5039a3541f407c2ade670004178b376754c424c13f0be24c7960c17be \
     34                            rmd160  2b6fb6c1f1ce60f0bac2cb9b496c45b073ce6bb2 \
     35                            sha256  f4bf99907d0fea7db90b6e50147f1730b5bde2fbb93d9e58478b6b94409eebc6 \
    3736                            ${name}.pdf \
    38                             rmd160  374614145a7b78e263b0cfbb695eb22d07dede9a \
    39                             sha256  57bd4d88e1321968ba06f29dfa322b4cd9e6beb4e0f42e1a4775d9c9a41af170
     37                            rmd160  0ddad32373efab2145fcd0e6e4d4c3e751d535bf \
     38                            sha256  05cec7b49c9b5435ca94f6b4e2f34b07365411a3610bca7eaf73fa9b5475b533
    4039
    4140depends_lib                 port:expat \
    4241                            port:fontconfig \
    depends_lib port:expat \ 
    5049                            port:zlib
    5150
    5251patchfiles                  patch-src-variable.c.diff \
     52                            patch-docs-Makefile.in.diff \
    5353                            patch-upstream-compilerwarnings.diff \
    54                             patch-upstream-wxt-scroll.diff \
    55                             patch-upstream-qt.diff \
    56                             patch-configure-qt.diff \
    5754                            patch-configure-aquaterm.diff
    5855
    59 # upstream patches:
    60 #
    61 # - patch-upstream-compilerwarnings.diff
    62 #   2012-03-18 17:30:42 Hans-Bernhard Broeker (cvs commit:broeker)
    63 # - patch-upstream-wxt-scroll.diff
    64 #   2012-02-29 19:29:25 Mojca Miklavec (cvs commit:sfeam)
    65 # - patch-upstream-qt.diff
    66 #   2012-04-01 08:49:45 Jérôme Lodewyck (cvs commit:lodewyck)
    67 
    6856minimum_xcodeversions       {9 3.1}
    6957
    7058configure.args              --with-readline=${prefix} \
    post-destroot { 
    165153# this temporary workaround removes files that accidentally circumvented destroot
    166154# and were installed straight into ${prefix}/share/texmf/tex/latex/gnuplot
    167155#
    168 # it may be removed after a while; it is only a problem for those who installed
     156# it may be removed in August 2013; it is only a problem for those who installed
    169157# with +tutorial
    170158pre-activate {
    171159    if [file exists ${prefix}/share/texmf/tex/latex/gnuplot/gnuplot.cfg] {
  • files/patch-configure-aquaterm.diff

     
    1111 /* Define to 1 if you have the <libc.h> header file. */
    1212--- configure.orig
    1313+++ configure
    14 @@ -769,6 +769,7 @@ with_texdir
     14@@ -787,6 +787,7 @@ with_texdir
    1515 with_kpsexpand
    1616 with_x
    1717 with_x_app_defaultdir
     
    1919 with_lasergnu
    2020 with_gihdir
    2121 with_linux_vga
    22 @@ -1482,6 +1483,7 @@ Optional Packages:
     22@@ -1509,6 +1510,7 @@ Optional Packages:
    2323   --with-x                use the X Window System
    2424   --with-x-app-defaultdir=DIR       location of X11 application defaults
    2525                           (default /etc/X11/app-defaults/)
     
    2727   --with-lasergnu         install lasergnu printer script
    2828   --with-gihdir=DIR       location of .gih help text file
    2929                           (default PREFIX/share/PACKAGE/VERSION)
    30 @@ -7485,8 +7487,8 @@ fi
     30@@ -8024,8 +8026,8 @@ fi
    3131 rm -f conftest*
    3232 
    3333 
     
    3838 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    3939 /* end confdefs.h.  */
    4040 #if defined(__APPLE__) && defined(__MACH__)
    41 @@ -7498,13 +7500,96 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     41@@ -8035,15 +8037,98 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     42 _ACEOF
     43 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
    4244   $EGREP "yes" >/dev/null 2>&1; then :
    43     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
     45-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
     46+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    4447 $as_echo "yes" >&6; }
    4548-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aqtInit in -laquaterm" >&5
    4649-$as_echo_n "checking for aqtInit in -laquaterm... " >&6; }
    47 -if test "${ac_cv_lib_aquaterm_aqtInit+set}" = set; then :
     50-if ${ac_cv_lib_aquaterm_aqtInit+:} false; then :
    4851+    is_apple=yes
    4952+else
    5053+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
     
    140143 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    141144 /* end confdefs.h.  */
    142145 
    143 @@ -7524,33 +7609,32 @@ return aqtInit ();
     146@@ -8063,33 +8148,32 @@ return aqtInit ();
    144147 }
    145148 _ACEOF
    146149 if ac_fn_c_try_link "$LINENO"; then :
     
    157160 fi
    158161-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aquaterm_aqtInit" >&5
    159162-$as_echo "$ac_cv_lib_aquaterm_aqtInit" >&6; }
    160 -if test "x$ac_cv_lib_aquaterm_aqtInit" = x""yes; then :
     163-if test "x$ac_cv_lib_aquaterm_aqtInit" = xyes; then :
    161164-   LIBS="-laquaterm $LIBS -framework Foundation"
    162165-       CFLAGS="$CFLAGS -ObjC"
    163166+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_framework_AquaTerm_aqtInit" >&5
     
    188191 
    189192 
    190193 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BeOS" >&5
    191 @@ -14910,7 +14994,7 @@ else
     194@@ -15496,7 +15580,7 @@ else
    192195 $as_echo "  next terminal: no" >&6; }
    193196 fi
    194197 
     
    199202 else
    200203--- configure.in.orig
    201204+++ configure.in
    202 @@ -1366,7 +1366,7 @@ else
     205@@ -1370,7 +1370,7 @@ else
    203206   AC_MSG_RESULT([  next terminal: no])
    204207 fi
    205208 
     
    356359 
    357360 #import <Foundation/NSAutoreleasePool.h>
    358361 #import <Foundation/NSArray.h>
    359 @@ -356,7 +356,7 @@ AQUA_init()
    360    [adapter openPlotWithIndex:AQUA_plotRef];
    361  
    362    /* Check for support of version-dependent features */
    363 -   AQUA_hasAlphaSupport = [AQTAdapter respondsToSelector:@selector(setColorRed:green:blue:alpha:)];
    364 +   AQUA_hasAlphaSupport = [AQTAdapter instancesRespondToSelector:@selector(setColorRed:green:blue:alpha:)];
    365  
    366    /* set xmax, ymax*/
    367    term->xmax = AQUA_xSize;
  • deleted file files/patch-configure-qt.diff

    + -  
    1 --- configure.orig
    2 +++ configure
    3 @@ -7828,7 +7828,7 @@ else
    4         char b[false == 0 ? 1 : -1];
    5         char c[__bool_true_false_are_defined == 1 ? 1 : -1];
    6         char d[(bool) 0.5 == true ? 1 : -1];
    7 -       bool e = &s;
    8 +       /* See body of main program for 'e'.  */
    9         char f[(_Bool) 0.0 == false ? 1 : -1];
    10         char g[true];
    11         char h[sizeof (_Bool)];
    12 @@ -7839,25 +7839,6 @@ else
    13         _Bool n[m];
    14         char o[sizeof n == m * sizeof n[0] ? 1 : -1];
    15         char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
    16 -#      if defined __xlc__ || defined __GNUC__
    17 -        /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
    18 -           reported by James Lemley on 2005-10-05; see
    19 -           http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
    20 -           This test is not quite right, since xlc is allowed to
    21 -           reject this program, as the initializer for xlcbug is
    22 -           not one of the forms that C requires support for.
    23 -           However, doing the test right would require a runtime
    24 -           test, and that would make cross-compilation harder.
    25 -           Let us hope that IBM fixes the xlc bug, and also adds
    26 -           support for this kind of constant expression.  In the
    27 -           meantime, this test will reject xlc, which is OK, since
    28 -           our stdbool.h substitute should suffice.  We also test
    29 -           this with GCC, where it should work, to detect more
    30 -           quickly whether someone messes up the test in the
    31 -           future.  */
    32 -        char digs[] = "0123456789";
    33 -        int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
    34 -#      endif
    35         /* Catch a bug in an HP-UX C compiler.  See
    36            http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
    37            http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
    38 @@ -7869,6 +7850,7 @@ int
    39  main ()
    40  {
    41  
    42 +       bool e = &s;
    43         *pq |= q;
    44         *pq |= ! q;
    45         /* Refer to every declared value, to avoid compiler optimizations.  */
    46 @@ -13010,7 +12992,7 @@ fi
    47    CXXFLAGS="$CXXFLAGS $QT_CXXFLAGS"
    48  
    49      if test "$is_apple" = yes; then
    50 -    CXXFLAGS="$CXXFLAGS -ObjC"
    51 +    LIBS="$LIBS -framework Carbon"
    52    fi
    53  
    54    QT4LOC=`$PKG_CONFIG --variable=exec_prefix QtCore`
    55 --- configure.in.orig
    56 +++ configure.in
    57 @@ -1146,7 +1146,7 @@ if test "${enable_qt_ok}" = yes ; then
    58  
    59    dnl Compile Objective C Cocoa headers on Mac to hide the gnuplot icon from the dock
    60    if test "$is_apple" = yes; then
    61 -    CXXFLAGS="$CXXFLAGS -ObjC"
    62 +    LIBS="$LIBS -framework Carbon"
    63    fi
    64  
    65    QT4LOC=`$PKG_CONFIG --variable=exec_prefix QtCore`
    66 --- src/qtterminal/qt_term.cpp.orig
    67 +++ src/qtterminal/qt_term.cpp
    68 @@ -46,7 +46,7 @@
    69  #include <QtNetwork>
    70  
    71  #ifdef Q_WS_MAC
    72 -       #include <Cocoa/Cocoa.h>
    73 +       #include <Carbon/Carbon.h>
    74  #endif
    75  
    76  extern "C" {
    77 @@ -308,10 +308,15 @@ void qt_init()
    78         QApplication* application = new QApplication(argc, (char**)( NULL));
    79  
    80  #ifdef Q_WS_MAC
    81 -       // Don't display this application in the MAC OS X dock
    82 -       ProcessSerialNumber psn;
    83 -       if (GetCurrentProcess(&psn) == noErr)
    84 -               TransformProcessType(&psn, kProcessTransformToBackgroundApplication);
    85 +       #ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
    86 +               #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
    87 +                       // Don't display this application in the MAC OS X dock
    88 +                       // kProcessTransformToBackgroundApplication only works on Mac OS X 10.7 and later
    89 +                       ProcessSerialNumber psn;
    90 +                       if (GetCurrentProcess(&psn) == noErr)
    91 +                               TransformProcessType(&psn, kProcessTransformToBackgroundApplication);
    92 +               #endif
    93 +       #endif
    94  #endif
    95  
    96         // The creation of a QApplication mangled our locale settings
  • new file files/patch-docs-Makefile.in.diff

    - +  
     1--- docs/Makefile.in.orig
     2+++ docs/Makefile.in
     3@@ -396,8 +396,8 @@ gnuplot.info: $(srcdir)/gnuplot.texi
     4 gnuplot.texi $(srcdir)/gnuplot-eldoc.el $(srcdir)/gnuplot-eldoc.elc: $(srcdir)/doc2texi.el $(srcdir)/gnuplot.doc
     5        @echo "Creating texinfo and eldoc strings file"
     6        @if test "$(EMACS)" != no; then \
     7-          @test "$(top_srcdir)" = "$(top_builddir)" || echo "COPYING GNUPLOT.DOC" ; \
     8-          @test "$(top_srcdir)" = "$(top_builddir)" || cp $(srcdir)/gnuplot.doc . ; \
     9+          test "$(top_srcdir)" = "$(top_builddir)" || echo "COPYING GNUPLOT.DOC" ; \
     10+          test "$(top_srcdir)" = "$(top_builddir)" || cp $(srcdir)/gnuplot.doc . ; \
     11           $(EMACS) -batch -l $(srcdir)/doc2texi.el -f d2t-doc-to-texi ; \
     12           echo "Compiling gnuplot-eldoc.el" ; \
     13           $(EMACS) -batch --eval='(byte-compile-file "gnuplot-eldoc.el")' ; \
  • files/patch-upstream-compilerwarnings.diff

     
    11--- src/color.c.orig
    22+++ src/color.c
    3 @@ -515,7 +515,7 @@ cbtick_callback(
     3@@ -517,7 +517,7 @@ cbtick_callback(
    44            if (axis_array[axis].manual_justify)
    55                just = axis_array[axis].label.pos;
    66            write_multiline(x2+offsetx, y3+offsety, text,
     
    99                            axis_array[axis].ticdef.font);
    1010            if (hrotate)
    1111                (*term->text_angle)(0);
    12 @@ -526,7 +526,7 @@ cbtick_callback(
     12@@ -528,7 +528,7 @@ cbtick_callback(
    1313            if (axis_array[axis].manual_justify)
    1414                just = axis_array[axis].label.pos;         
    1515            write_multiline(x3+offsetx, y2+offsety, text,
     
    1818                            axis_array[axis].ticdef.font);
    1919        }
    2020        term_apply_lp_properties(&border_lp);   /* border linetype */
    21 --- src/gplt_x11.c.orig
    22 +++ src/gplt_x11.c
    23 @@ -2897,22 +2897,22 @@ exec_cmd(plot_struct *plot, char *command)
    24  
    25                     case PseudoColor:
    26                         fprintf(stderr, ERROR_NOTICE("PseudoColor"));
    27 -                       fprintf(stderr, display_error_text_after);
    28 +                       fprintf(stderr, "%s", display_error_text_after);
    29                         break;
    30  
    31                     case GrayScale:
    32                         fprintf(stderr, ERROR_NOTICE("GrayScale"));
    33 -                       fprintf(stderr, display_error_text_after);
    34 +                       fprintf(stderr, "%s", display_error_text_after);
    35                         break;
    36  
    37                     case StaticColor:
    38                         fprintf(stderr, ERROR_NOTICE("StaticColor"));
    39 -                       fprintf(stderr, display_error_text_after);
    40 +                       fprintf(stderr, "%s", display_error_text_after);
    41                         break;
    42  
    43                     case StaticGray:
    44                         fprintf(stderr, ERROR_NOTICE("StaticGray"));
    45 -                       fprintf(stderr, display_error_text_after);
    46 +                       fprintf(stderr, "%s", display_error_text_after);
    47                         break;
    48  
    49                     case DirectColor:
    5021--- src/graphics.c.orig
    5122+++ src/graphics.c
    52 @@ -1734,7 +1734,7 @@ do_plot(struct curve_points *plots, int pcount)
     23@@ -1720,7 +1720,7 @@ do_plot(struct curve_points *plots, int pcount)
    5324        ignore_enhanced(axis_array[FIRST_X_AXIS].label.noenhanced);
    5425        apply_pm3dcolor(&(axis_array[FIRST_X_AXIS].label.textcolor), t);
    5526        write_multiline(x, y, axis_array[FIRST_X_AXIS].label.text,
     
    6031        ignore_enhanced(FALSE);
    6132--- src/plot2d.c.orig
    6233+++ src/plot2d.c
    63 @@ -2120,7 +2120,7 @@ eval_plots()
     34@@ -2127,7 +2127,7 @@ eval_plots()
    6435 
    6536                    if (this_plot->labels == NULL) {
    6637                        this_plot->labels = new_text_label(-1);
     
    6940                        this_plot->labels->layer = LAYER_PLOTLABELS;
    7041                    }
    7142                    parse_label_options(this_plot->labels);
    72 @@ -2309,7 +2309,7 @@ eval_plots()
     43@@ -2316,7 +2316,7 @@ eval_plots()
    7344            if (this_plot->plot_style == LABELPOINTS) {
    7445                if (this_plot->labels == NULL) {
    7546                    this_plot->labels = new_text_label(-1);
     
    8051                this_plot->labels->place.scalex =
    8152--- src/plot3d.c.orig
    8253+++ src/plot3d.c
    83 @@ -1555,7 +1555,7 @@ eval_3dplots()
     54@@ -1559,7 +1559,7 @@ eval_3dplots()
    8455                    int stored_token = c_token;
    8556                    if (this_plot->labels == NULL) {
    8657                        this_plot->labels = new_text_label(-1);
     
    8960                        this_plot->labels->layer = LAYER_PLOTLABELS;
    9061                    }
    9162                    parse_label_options(this_plot->labels);
     63--- src/wxterminal/wxt_gui.cpp.orig
     64+++ src/wxterminal/wxt_gui.cpp
     65@@ -2692,6 +2692,7 @@ void wxtPanel::wxt_cairo_exec_command(gp_command command)
     66                text_justification_mode = command.mode;
     67                return;
     68        case command_put_text :
     69+       case command_enhanced_put_text :
     70                if (wxt_in_key_sample) {
     71                        int slen = strlen(command.string) * term->h_char * 0.75;
     72                        if (text_justification_mode == RIGHT) slen = -slen;
     73--- term/lua.trm.orig
     74+++ term/lua.trm
     75@@ -872,7 +872,7 @@ LUA_init()
     76 {
     77   fseek(gpoutfile, 0, SEEK_SET);
     78   /* ignore compiler warnings here, because `gpoutfile' is already open */
     79-  if (ftruncate(fileno(gpoutfile), 0));
     80+  (void)ftruncate(fileno(gpoutfile), 0);
     81 
     82   /* reset image counter */
     83   image_cnt = 0;
     84--- term/x11.trm.orig
     85+++ term/x11.trm
     86@@ -617,7 +617,11 @@ X11_options()
     87     /* Leave the current window unchanged when closing an old window */
     88     if (X11_ipc) {
     89        if (set_close) {
     90-           fprintf(X11_ipc, (set_number ? "C%d\n" : "C\n"), new_term_number);
     91+           if (set_number) {
     92+               fprintf(X11_ipc, "C%d\n", new_term_number);
     93+           } else {
     94+               fputs("C\n", X11_ipc);
     95+           }
     96            fflush(X11_ipc);
     97        } else if (set_number) {
     98 #ifdef EXTERNAL_X11_WINDOW
  • deleted file files/patch-upstream-qt.diff

    + -  
    1 --- src/qtterminal/QtGnuplotScene.cpp.orig
    2 +++ src/qtterminal/QtGnuplotScene.cpp
    3 @@ -56,7 +56,7 @@ QtGnuplotScene::QtGnuplotScene(QtGnuplotEventHandler* eventHandler, QObject* par
    4         m_eventHandler = eventHandler;
    5         m_lastModifierMask = 0;
    6         m_textAngle = 0.;
    7 -       m_textAlignment == Qt::AlignLeft;
    8 +       m_textAlignment = Qt::AlignLeft;
    9         m_currentZ = 1.;
    10         m_currentPointSize = 1.;
    11         m_enhanced = 0;
    12 --- src/qtterminal/QtGnuplotWidget.cpp.orig
    13 +++ src/qtterminal/QtGnuplotWidget.cpp
    14 @@ -169,6 +169,15 @@ void QtGnuplotWidget::resizeEvent(QResizeEvent* event)
    15         QWidget::resizeEvent(event);
    16  }
    17  
    18 +QPainter::RenderHints QtGnuplotWidget::renderHints() const
    19 +{
    20 +       QPainter::RenderHints hint = QPainter::TextAntialiasing;
    21 +       if (m_antialias)
    22 +               hint |= QPainter::Antialiasing;
    23 +
    24 +       return hint;
    25 +}
    26 +
    27  /////////////////////////////////////////////////
    28  // Slots
    29  
    30 @@ -178,7 +187,7 @@ QPixmap QtGnuplotWidget::createPixmap()
    31         pixmap.fill();
    32         QPainter painter(&pixmap);
    33         painter.translate(0.5, 0.5);
    34 -       painter.setRenderHint(m_antialias ? QPainter::Antialiasing : QPainter::TextAntialiasing);
    35 +       painter.setRenderHints(renderHints());
    36         m_scene->render(&painter);
    37         painter.end();
    38         return pixmap;
    39 @@ -195,7 +204,7 @@ void QtGnuplotWidget::print()
    40         if (QPrintDialog(&printer).exec() == QDialog::Accepted)
    41         {
    42                 QPainter painter(&printer);
    43 -               painter.setRenderHint(m_antialias ? QPainter::Antialiasing : QPainter::TextAntialiasing);
    44 +               painter.setRenderHints(renderHints());
    45                 m_scene->render(&painter);
    46         }
    47  }
    48 @@ -211,8 +220,10 @@ void QtGnuplotWidget::exportToPdf()
    49         QPrinter printer;
    50         printer.setOutputFormat(QPrinter::PdfFormat);
    51         printer.setOutputFileName(fileName);
    52 +       printer.setPaperSize(QSizeF(m_scene->width(), m_scene->height()), QPrinter::Point);
    53 +       printer.setPageMargins(0, 0, 0, 0, QPrinter::Point);
    54         QPainter painter(&printer);
    55 -       painter.setRenderHint(m_antialias ? QPainter::Antialiasing : QPainter::TextAntialiasing);
    56 +       painter.setRenderHints(renderHints());
    57         m_scene->render(&painter);
    58  }
    59  
    60 @@ -266,7 +277,7 @@ void QtGnuplotWidget::loadSettings()
    61  
    62  void QtGnuplotWidget::applySettings()
    63  {
    64 -       m_view->setRenderHints(m_antialias ? QPainter::Antialiasing : QPainter::TextAntialiasing);
    65 +       m_view->setRenderHints(renderHints());
    66         m_view->setBackgroundBrush(m_backgroundColor);
    67  }
    68  
    69 --- src/qtterminal/QtGnuplotWidget.h.orig
    70 +++ src/qtterminal/QtGnuplotWidget.h
    71 @@ -47,6 +47,7 @@
    72  #include "QtGnuplotEvent.h"
    73  
    74  #include <QWidget>
    75 +#include <QPainter>
    76  
    77  class QtGnuplotScene;
    78  class QGraphicsView;
    79 @@ -93,6 +94,7 @@ private:
    80         void loadSettings();
    81         void applySettings();
    82         void saveSettings();
    83 +       QPainter::RenderHints renderHints() const;
    84  
    85  private:
    86         int m_id;
  • deleted file files/patch-upstream-wxt-scroll.diff

    + -  
    1 --- src/wxterminal/wxt_gui.cpp.orig
    2 +++ src/wxterminal/wxt_gui.cpp
    3 @@ -1003,11 +1003,16 @@ void wxtPanel::OnRightUp( wxMouseEvent& event )
    4  /* mouse wheel event */
    5  void wxtPanel::OnMouseWheel( wxMouseEvent& event )
    6  {
    7 -       UpdateModifiers(event);
    8 +       int mouse_button;
    9  
    10 -       wxt_exec_event(GE_buttonpress, 0, 0,
    11 -                       event.GetWheelRotation() > 0 ? 4 : 5,
    12 -                       0, this->GetId());
    13 +       UpdateModifiers(event);
    14 +       mouse_button = (event.GetWheelRotation() > 0 ? 4 : 5);
    15 +#if wxCHECK_VERSION(2, 9, 0)
    16 +       /* GetWheelAxis: 0 is the Y axis, 1 is the X axis. */
    17 +       if (event.GetWheelAxis() > 0)
    18 +           mouse_button += 2;
    19 +#endif
    20 +       wxt_exec_event(GE_buttonpress, 0, 0, mouse_button, 0, this->GetId());
    21  }
    22  
    23  /* the state of the modifiers is checked each time a key is pressed instead of