Ticket #40727: wxPython-2.9.5.0-deadkeyspatch.diff

File wxPython-2.9.5.0-deadkeyspatch.diff, 23.4 KB (added by mojca (Mojca Miklavec), 11 years ago)

update wxPython to 2.9.5.0 including a patch for #38850

  • graphics/wxWidgets-3.0/Portfile

     
    1010subport             wxPython-3.0 {}
    1111subport             wxgtk-3.0 {}
    1212version             2.9.5
    13 revision            1
     13revision            2
    1414
    1515set installname     wxWidgets
    1616set wxtype          osx_cocoa
     
    1919    wxWidgets.use   wxWidgets-3.0
    2020} elseif {$subport == "wxPython-3.0"} {
    2121    wxWidgets.use   wxPython-3.0
    22     version         2.9.4
     22    revision        0
    2323} elseif {$subport == "wxgtk-3.0"} {
    2424    # with satisfactory Cocoa support there is no real need for GTK-based wxWidgets any more
    2525    # wxgtk-3.0 is here mainly for testing purposes
     
    5252distfiles           ${distname}-${version}${extract.suffix}
    5353dist_subdir         ${distname}/${version}
    5454
    55 checksums           rmd160  f5c91099b2cf3e39eadbcf99df0dd9a97017d47f \
     55checksums           ${distname}-${version}${extract.suffix} \
     56                    rmd160  f5c91099b2cf3e39eadbcf99df0dd9a97017d47f \
    5657                    sha256  b74ba96ca537cc5d049d21ec9ab5eb2670406a4aa9f1ea4845ea84a9955a6e02
    5758
    5859depends_lib         port:jpeg \
     
    7172
    7273patch.dir           ${worksrcpath}/..
    7374
    74 # without (the second part of) this patch wxrc-2.9 ends up linking to libraries in workdir
    75 # http://trac.wxwidgets.org/ticket/15452
    76 patchfiles-append   patch-configure.diff
     75# patch-configure.diff:                        http://trac.wxwidgets.org/ticket/15452
     76# patch-upstream-src-osx-cocoa-window.mm.diff: http://trac.wxwidgets.org/ticket/15345
     77patchfiles-append   patch-configure.diff \
     78                    patch-upstream-src-osx-cocoa-window.mm.diff
    7779
    7880post-patch {
    7981    reinplace "s|@@PREFIX@@|${prefix}|g" ${patch.dir}/configure
     
    98100                    --with-macosx-version-min=no
    99101
    100102if {$subport == "wxPython-3.0"} {
    101     set wxpythonsubset      wxPython-2.9.4.0-MacPorts-subset
     103    set wxpythonsubset      wxPython-2.9.5.0-MacPorts-subset
    102104    distfiles-append        ${wxpythonsubset}${extract.suffix}:trac
    103105
    104     # patch-src-osx-cocoa-window.mm.diff: http://trac.wxwidgets.org/changeset/72195 (only needed for 2.9.4)
    105     # patch-include-wx-math.h.diff:       http://trac.wxwidgets.org/changeset/74456 (only needed for 2.9.4)
    106     patchfiles-append       patch-src-osx-cocoa-window.mm.diff \
    107                             patch-include-wx-math.h.diff
    108 
    109106    description             wxWidgets ${branch} for the wxPython distribution
    110107    long_description        The port installs wxWidgets ${branch} for wxPython \
    111108                            to guarantee compatibility even when the upstream versions \
    112109                            of wxWidgets and wxPython differ.
    113110
    114     checksums               ${distname}-${version}${extract.suffix} \
    115                             rmd160  62301f8ce39a8aa96e65318f9d1e947c9dc09c50 \
    116                             sha256  6c530c35f40c3b1a5f9a4577c3ee8a9982e745081f23e3fbb9951d6d17514d12 \
    117                             ${wxpythonsubset}${extract.suffix} \
    118                             rmd160  7831cee8185c521d8b565b56555b3005dee1d53d \
    119                             sha256  971b644768d4010b38acf7232deb8cf3c91921ca8b09dec82c1616b93c751f4c
     111    checksums-append        ${wxpythonsubset}${extract.suffix} \
     112                            rmd160  936858d5856adde043d107164b1b53d3209eb76d \
     113                            sha256  c892f257b151726a70886c7cffda51554b48b8e9cc7cfcc962d6988c5fe81856
    120114
    121115    post-destroot {
    122116        # copy a subset of wxPython to wxWidgets to prevent a conflict
     
    127121    livecheck.type          none
    128122} elseif {$subport == "wxgtk-3.0"} {
    129123    # both patches could be added to wxWidgets-3.0, but they are not needed for Cocoa
    130     # and might need changes for wxWidgets 2.9.4
    131124    #
    132125    # patch-sdl.diff: the patch allows using --wxth-sdl
    133126    # patch-upstream-psn.diff: http://trac.wxwidgets.org/changeset/74703
  • graphics/wxWidgets-3.0/files/patch-configure.diff

     
    11The first part is for GTK and makes sure that the port finds the right OpenGL library
    2 The second part makes sure that install_name_tool doesn't break library names and links (http://trac.wxwidgets.org/ticket/15452)
     2The second part is an upstream patch (see http://trac.wxwidgets.org/ticket/15452)
    33--- configure.orig
    44+++ configure
    55@@ -22038,48 +22038,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
     
    5252 
    5353 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libraries directories" >&5
    5454 $as_echo_n "checking for libraries directories... " >&6; }
    55 @@ -29402,24 +29361,6 @@ rm -f core conftest.err conftest.$ac_objext \
    56        ;;
    57  
    58        *-*-darwin* )
    59 -        install_name_tool=`which ${HOST_PREFIX}install_name_tool`
    60 -        if test "$install_name_tool" -a -x "$install_name_tool"; then
    61 -            DYLIB_RPATH_POSTLINK="${HOST_PREFIX}install_name_tool -id \$@ \$@"
    62 -            cat <<EOF >change-install-names
    63 -#!/bin/sh
     55@@ -29407,16 +29366,18 @@ rm -f core conftest.err conftest.$ac_objext \
     56             DYLIB_RPATH_POSTLINK="${HOST_PREFIX}install_name_tool -id \$@ \$@"
     57             cat <<EOF >change-install-names
     58 #!/bin/sh
    6459-libnames=\`cd \${2} ; ls -1 | grep '\.[0-9][0-9]*\.dylib\$'\`
    65 -for i in \${libnames} ; do
     60+libnames=\`cd \${1} ; ls -1 | grep '\.[0-9][0-9]*\.dylib\$'\`
     61+changes=''
     62+for dep in \${libnames} ; do
     63+    changes="\${changes} -change \${4}/\${dep} \${3}/\${dep}"
     64+done
     65 for i in \${libnames} ; do
    6666-    ${HOST_PREFIX}install_name_tool -id \${3}/\${i} \${1}/\${i}
    6767-    for dep in \${libnames} ; do
    6868-        ${HOST_PREFIX}install_name_tool -change \${2}/\${dep} \${3}/\${dep} \${1}/\${i}
    6969-    done
    70 -done
    71 -EOF
    72 -            chmod +x change-install-names
     70+    ${HOST_PREFIX}install_name_tool \${changes} -id \${3}/\${i} \${1}/\${i}
     71 done
     72+${HOST_PREFIX}install_name_tool \${changes} \${2}/wxrc-${WX_RELEASE}
     73 EOF
     74             chmod +x change-install-names
    7375-            DYLIB_RPATH_INSTALL="\$(wx_top_builddir)/change-install-names \${DESTDIR}\${libdir} \$(wx_top_builddir)/lib \${libdir}"
    74 -        fi
    75 -
    76 -                                        HEADER_PAD_OPTION="-headerpad_max_install_names"
    77        ;;
     76+            DYLIB_RPATH_INSTALL="\$(wx_top_builddir)/change-install-names \${DESTDIR}\${libdir} \${DESTDIR}\${bindir} \${libdir} \$(wx_top_builddir)/lib"
     77         fi
    7878 
    79        *-*-cygwin* | *-*-mingw32* )
     79                                         HEADER_PAD_OPTION="-headerpad_max_install_names"
  • graphics/wxWidgets-3.0/files/patch-include-wx-math.h.diff

     
    1 Upstream: http://trac.wxwidgets.org/changeset/74456
    2 --- include/wx/math.h (revision 73280)
    3 +++ include/wx/math.h (revision 74456)
    4 @@ -62,7 +62,12 @@
    5          add more compilers with C99 support here: using C99 isfinite() is
    6          preferable to using BSD-ish finite()
    7       */
    8 -    #define wxFinite(x) isfinite(x)
    9 +    #if defined(_GLIBCXX_CMATH) || defined(_LIBCPP_CMATH)
    10 +        // these <cmath> headers #undef isfinite
    11 +        #define wxFinite(x) std::isfinite(x)
    12 +    #else
    13 +        #define wxFinite(x) isfinite(x)
    14 +    #endif
    15  #elif ( defined(__GNUG__)||defined(__GNUWIN32__)||defined(__DJGPP__)|| \
    16        defined(__SGI_CC__)||defined(__SUNCC__)||defined(__XLC__)|| \
    17        defined(__HPUX__) ) && ( !defined(wxOSX_USE_IPHONE) || wxOSX_USE_IPHONE == 0 )
  • graphics/wxWidgets-3.0/files/patch-src-osx-cocoa-window.mm.diff

     
    1 Upstream: http://trac.wxwidgets.org/changeset/72195
    2 --- src/osx/cocoa/window.mm (revision 72169)
    3 +++ src/osx/cocoa/window.mm (revision 72195)
    4 @@ -456,4 +456,9 @@
    5  - (CGFloat)deviceDeltaX;
    6  - (CGFloat)deviceDeltaY;
    7 +
    8 +// 10.7+
    9 +- (BOOL)hasPreciseScrollingDeltas;
    10 +- (CGFloat)scrollingDeltaX;
    11 +- (CGFloat)scrollingDeltaY;
    12  @end
    13  
    14 @@ -610,21 +615,37 @@
    15              wxevent.SetEventType( wxEVT_MOUSEWHEEL ) ;
    16  
    17 -            // see http://developer.apple.com/qa/qa2005/qa1453.html
    18 -            // for more details on why we have to look for the exact type
    19 -           
    20 -            const EventRef cEvent = (EventRef) [nsEvent eventRef];
    21 -            bool isMouseScrollEvent = false;
    22 -            if ( cEvent )
    23 -                isMouseScrollEvent = ::GetEventKind(cEvent) == kEventMouseScroll;
    24 -               
    25 -            if ( isMouseScrollEvent )
    26 +            if ( UMAGetSystemVersion() >= 0x1070 )
    27              {
    28 -                deltaX = [nsEvent deviceDeltaX];
    29 -                deltaY = [nsEvent deviceDeltaY];
    30 +                if ( [nsEvent hasPreciseScrollingDeltas] )
    31 +                {
    32 +                    deltaX = [nsEvent scrollingDeltaX];
    33 +                    deltaY = [nsEvent scrollingDeltaY];
    34 +                }
    35 +                else
    36 +                {
    37 +                    deltaX = [nsEvent scrollingDeltaX] * 10;
    38 +                    deltaY = [nsEvent scrollingDeltaY] * 10;
    39 +                }
    40              }
    41              else
    42              {
    43 -                deltaX = ([nsEvent deltaX] * 10);
    44 -                deltaY = ([nsEvent deltaY] * 10);
    45 +                const EventRef cEvent = (EventRef) [nsEvent eventRef];
    46 +                // see http://developer.apple.com/qa/qa2005/qa1453.html
    47 +                // for more details on why we have to look for the exact type
    48 +
    49 +                bool isMouseScrollEvent = false;
    50 +                if ( cEvent )
    51 +                    isMouseScrollEvent = ::GetEventKind(cEvent) == kEventMouseScroll;
    52 +
    53 +                if ( isMouseScrollEvent )
    54 +                {
    55 +                    deltaX = [nsEvent deviceDeltaX];
    56 +                    deltaY = [nsEvent deviceDeltaY];
    57 +                }
    58 +                else
    59 +                {
    60 +                    deltaX = ([nsEvent deltaX] * 10);
    61 +                    deltaY = ([nsEvent deltaY] * 10);
    62 +                }
    63              }
    64              
  • graphics/wxWidgets-3.0/files/patch-upstream-src-osx-cocoa-window.mm.diff

     
     1http://trac.wxwidgets.org/ticket/15345
     2http://trac.wxwidgets.org/changeset/74613
     3http://trac.wxwidgets.org/changeset/74945
     4
     5--- include/wx/osx/cocoa/private.h.orig
     6+++ include/wx/osx/cocoa/private.h
     7@@ -161,6 +161,7 @@ public :
     8     virtual void                cursorUpdate(WX_NSEvent event, WXWidget slf, void* _cmd);
     9     virtual void                keyEvent(WX_NSEvent event, WXWidget slf, void* _cmd);
     10     virtual void                insertText(NSString* text, WXWidget slf, void* _cmd);
     11+    virtual void                doCommandBySelector(void* sel, WXWidget slf, void* _cmd);
     12     virtual bool                performKeyEquivalent(WX_NSEvent event, WXWidget slf, void* _cmd);
     13     virtual bool                acceptsFirstResponder(WXWidget slf, void* _cmd);
     14     virtual bool                becomeFirstResponder(WXWidget slf, void* _cmd);
     15--- src/osx/cocoa/window.mm.orig
     16+++ src/osx/cocoa/window.mm
     17@@ -110,6 +110,22 @@ NSRect wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const
     18 
     19 @end // wxNSView
     20 
     21+@interface wxNSView(TextInput) <NSTextInputClient>
     22+
     23+- (void)insertText:(id)aString replacementRange:(NSRange)replacementRange;
     24+- (void)doCommandBySelector:(SEL)aSelector;
     25+- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange;
     26+- (void)unmarkText;
     27+- (NSRange)selectedRange;
     28+- (NSRange)markedRange;
     29+- (BOOL)hasMarkedText;
     30+- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange;
     31+- (NSArray*)validAttributesForMarkedText;
     32+- (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange;
     33+- (NSUInteger)characterIndexForPoint:(NSPoint)aPoint;
     34+
     35+@end
     36+
     37 @interface NSView(PossibleMethods)
     38 - (void)setTitle:(NSString *)aString;
     39 - (void)setStringValue:(NSString *)aString;
     40@@ -837,6 +853,73 @@ void wxWidgetCocoaImpl::SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEve
     41 
     42 @end // wxNSView
     43 
     44+// We need to adopt NSTextInputClient protocol in order to interpretKeyEvents: to work.
     45+// Currently, only insertText:(replacementRange:) is
     46+// implemented here, and the rest of the methods are stubs.
     47+// It is hoped that someday IME-related functionality is implemented in
     48+// wxWidgets and the methods of this protocol are fully working.
     49+
     50+@implementation wxNSView(TextInput)
     51+
     52+void wxOSX_insertText(NSView* self, SEL _cmd, NSString* text);
     53+
     54+- (void)insertText:(id)aString replacementRange:(NSRange)replacementRange
     55+{
     56+    wxOSX_insertText(self, @selector(insertText:), aString);
     57+}
     58+
     59+- (void)doCommandBySelector:(SEL)aSelector
     60+{
     61+    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
     62+    if (impl)
     63+        impl->doCommandBySelector(aSelector, self, _cmd);
     64+}
     65+
     66+- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange
     67+{
     68+}
     69+
     70+- (void)unmarkText
     71+{
     72+}
     73+
     74+- (NSRange)selectedRange
     75+{   
     76+    return NSMakeRange(NSNotFound, 0);
     77+}
     78+
     79+- (NSRange)markedRange
     80+{
     81+    return NSMakeRange(NSNotFound, 0);
     82+}
     83+
     84+- (BOOL)hasMarkedText
     85+{
     86+    return NO;
     87+}
     88+
     89+- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange
     90+{
     91+    return nil;
     92+}
     93+
     94+- (NSArray*)validAttributesForMarkedText
     95+{
     96+    return nil;
     97+}
     98+
     99+- (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange
     100+{
     101+    return NSMakeRect(0, 0, 0, 0);
     102+}
     103+- (NSUInteger)characterIndexForPoint:(NSPoint)aPoint
     104+{
     105+    return NSNotFound;
     106+}
     107+
     108+@end // wxNSView(TextInput)
     109+
     110+
     111 //
     112 // event handlers
     113 //
     114@@ -1286,13 +1369,80 @@ void wxWidgetCocoaImpl::keyEvent(WX_NSEvent event, WXWidget slf, void *_cmd)
     115 
     116 void wxWidgetCocoaImpl::insertText(NSString* text, WXWidget slf, void *_cmd)
     117 {
     118-    if ( m_lastKeyDownEvent==NULL || m_hasEditor || !DoHandleCharEvent(m_lastKeyDownEvent, text) )
     119+    bool result = false;
     120+    if ( IsUserPane() && !m_hasEditor && [text length] > 0)
     121+    {
     122+        if ( m_lastKeyDownEvent!=NULL && [text isEqualToString:[m_lastKeyDownEvent characters]])
     123+        {
     124+            // If we have a corresponding key event, send wxEVT_KEY_DOWN now.
     125+            // (see also: wxWidgetCocoaImpl::DoHandleKeyEvent)
     126+            {
     127+                wxKeyEvent wxevent(wxEVT_KEY_DOWN);
     128+                SetupKeyEvent( wxevent, m_lastKeyDownEvent );
     129+                result = GetWXPeer()->OSXHandleKeyEvent(wxevent);
     130+            }
     131+
     132+            // ...and wxEVT_CHAR.
     133+            result = result || DoHandleCharEvent(m_lastKeyDownEvent, text);
     134+        }
     135+        else
     136+        {
     137+            // If we don't have a corresponding key event (e.g. IME-composed
     138+            // characters), send wxEVT_CHAR without sending wxEVT_KEY_DOWN.
     139+            for (NSUInteger i = 0; i < [text length]; ++i)
     140+            {
     141+                wxKeyEvent wxevent(wxEVT_CHAR);
     142+                wxevent.m_shiftDown = wxevent.m_controlDown = wxevent.m_altDown = wxevent.m_metaDown = false;
     143+                wxevent.m_rawCode = 0;
     144+                wxevent.m_rawFlags = 0;
     145+                wxevent.SetTimestamp();
     146+                unichar aunichar = [text characterAtIndex:i];
     147+                wxevent.m_uniChar = aunichar;
     148+                wxevent.m_keyCode = aunichar < 0x80 ? aunichar : WXK_NONE;
     149+                wxWindowMac* peer = GetWXPeer();
     150+                if ( peer )
     151+                {
     152+                    wxevent.SetEventObject(peer);
     153+                    wxevent.SetId(peer->GetId());
     154+                }
     155+                result = GetWXPeer()->OSXHandleKeyEvent(wxevent) || result;
     156+            }
     157+        }
     158+    }
     159+    if ( !result )
     160     {
     161         wxOSX_TextEventHandlerPtr superimpl = (wxOSX_TextEventHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd];
     162         superimpl(slf, (SEL)_cmd, text);
     163     }
     164 }
     165 
     166+void wxWidgetCocoaImpl::doCommandBySelector(void* sel, WXWidget slf, void* _cmd)
     167+{
     168+    if ( m_lastKeyDownEvent!=NULL )
     169+    {
     170+        // If we have a corresponding key event, send wxEVT_KEY_DOWN now.
     171+        // (see also: wxWidgetCocoaImpl::DoHandleKeyEvent)
     172+        wxKeyEvent wxevent(wxEVT_KEY_DOWN);
     173+        SetupKeyEvent( wxevent, m_lastKeyDownEvent );
     174+        bool result = GetWXPeer()->OSXHandleKeyEvent(wxevent);
     175+
     176+        if (!result)
     177+        {
     178+            // Generate wxEVT_CHAR if wxEVT_KEY_DOWN is not handled.
     179+
     180+            long keycode = wxOSXTranslateCocoaKey( m_lastKeyDownEvent, wxEVT_CHAR );
     181+
     182+            wxKeyEvent wxevent2(wxevent) ;
     183+            wxevent2.SetEventType(wxEVT_CHAR);
     184+            SetupKeyEvent( wxevent2, m_lastKeyDownEvent );
     185+            if ( (keycode > 0 && keycode < WXK_SPACE) || keycode == WXK_DELETE || keycode >= WXK_START )
     186+            {
     187+                wxevent2.m_keyCode = keycode;
     188+            }
     189+            GetWXPeer()->OSXHandleKeyEvent(wxevent2);
     190+        }
     191+    }
     192+}
     193 
     194 bool wxWidgetCocoaImpl::performKeyEquivalent(WX_NSEvent event, WXWidget slf, void *_cmd)
     195 {
     196@@ -2555,10 +2705,18 @@ void wxWidgetCocoaImpl::InstallEventHandler( WXWidget control )
     197 
     198 bool wxWidgetCocoaImpl::DoHandleCharEvent(NSEvent *event, NSString *text)
     199 {
     200-    wxKeyEvent wxevent(wxEVT_CHAR);
     201-    SetupKeyEvent( wxevent, event, text );
     202+    bool result = false;
     203+   
     204+    for (NSUInteger i = 0; i < [text length]; ++i)
     205+    {
     206+        wxKeyEvent wxevent(wxEVT_CHAR);
     207+        unichar c = [text characterAtIndex:i];
     208+        SetupKeyEvent( wxevent, event, [NSString stringWithCharacters:&c length:1]);
     209 
     210-    return GetWXPeer()->OSXHandleKeyEvent(wxevent);
     211+        result = GetWXPeer()->OSXHandleKeyEvent(wxevent) || result;
     212+    }
     213+   
     214+    return result;
     215 }
     216 
     217 bool wxWidgetCocoaImpl::DoHandleKeyEvent(NSEvent *event)
     218@@ -2577,48 +2735,23 @@ bool wxWidgetCocoaImpl::DoHandleKeyEvent(NSEvent *event)
     219             return true;
     220     }
     221 
     222-    bool result = GetWXPeer()->OSXHandleKeyEvent(wxevent);
     223-
     224-    // this will fire higher level events, like insertText, to help
     225-    // us handle EVT_CHAR, etc.
     226+    if ( IsUserPane() && [event type] == NSKeyDown)
     227+    {
     228+        // Don't fire wxEVT_KEY_DOWN here in order to allow IME to intercept
     229+        // some key events. If the event is not handled by IME, either
     230+        // insertText: or doCommandBySelector: is called, so we send
     231+        // wxEVT_KEY_DOWN and wxEVT_CHAR there.
     232 
     233-    if ( !result )
     234+        if ( [m_osxView isKindOfClass:[NSScrollView class] ] )
     235+            [[(NSScrollView*)m_osxView documentView] interpretKeyEvents:[NSArray arrayWithObject:event]];
     236+        else
     237+            [m_osxView interpretKeyEvents:[NSArray arrayWithObject:event]];
     238+        return true;
     239+    }
     240+    else
     241     {
     242-        if ( [event type] == NSKeyDown)
     243-        {
     244-            long keycode = wxOSXTranslateCocoaKey( event, wxEVT_CHAR );
     245-           
     246-            if ( (keycode > 0 && keycode < WXK_SPACE) || keycode == WXK_DELETE || keycode >= WXK_START )
     247-            {
     248-                // eventually we could setup a doCommandBySelector catcher and retransform this into the wx key chars
     249-                wxKeyEvent wxevent2(wxevent) ;
     250-                wxevent2.SetEventType(wxEVT_CHAR);
     251-                SetupKeyEvent( wxevent2, event );
     252-                wxevent2.m_keyCode = keycode;
     253-                result = GetWXPeer()->OSXHandleKeyEvent(wxevent2);
     254-            }
     255-            else if (wxevent.CmdDown())
     256-            {
     257-                wxKeyEvent wxevent2(wxevent) ;
     258-                wxevent2.SetEventType(wxEVT_CHAR);
     259-                SetupKeyEvent( wxevent2, event );
     260-                result = GetWXPeer()->OSXHandleKeyEvent(wxevent2);
     261-            }
     262-            else
     263-            {
     264-                if ( IsUserPane() && !wxevent.CmdDown() )
     265-                {
     266-                    if ( [m_osxView isKindOfClass:[NSScrollView class] ] )
     267-                        [[(NSScrollView*)m_osxView documentView] interpretKeyEvents:[NSArray arrayWithObject:event]];
     268-                    else
     269-                        [m_osxView interpretKeyEvents:[NSArray arrayWithObject:event]];
     270-                    result = true;
     271-                }
     272-            }
     273-        }
     274+        return GetWXPeer()->OSXHandleKeyEvent(wxevent);
     275     }
     276-
     277-    return result;
     278 }
     279 
     280 bool wxWidgetCocoaImpl::DoHandleMouseEvent(NSEvent *event)
  • python/py-wxpython-3.0/Portfile

     
    66PortGroup           wxWidgets   1.0
    77
    88name                py-wxpython-3.0
    9 version             2.9.4.0
     9version             2.9.5.0
     10set wx_version      [join [lrange [split ${version} .] 0 2] .]
    1011set branch          [join [lrange [split ${version} .] 0 1] .]
    1112categories-append   graphics devel
    1213license             wxwidgets-3.1
     
    2728distname            wxPython
    2829use_bzip2           yes
    2930
    30 checksums           rmd160  35e823d9161dc99083f3025383567000680e012f \
    31                     sha256  78c35c19e85a17cb9c730b86b49d6a479198d76d19e0b13e86db0b55707004be
     31checksums           rmd160  4d54edc5437fbe14e552bfc6feeeb4fb74d10cd0 \
     32                    sha256  1a5b7e771eff467538d0834136188e8a7506a4fe6e85d0a46c40158cdbd4c48c
    3233
    3334python.versions     27
    3435python.default_version 27
    3536
    3637distfiles           ${distname}-src-${version}${extract.suffix}
    37 dist_subdir         ${distname}/${version}
    3838worksrcdir          ${distname}-src-${version}/wxPython
     39dist_subdir         wxWidgets/${wx_version}
    3940
    4041# extract just the docs and wxPython subdir
    4142extract.post_args   "| tar -xf - ${worksrcdir} ${distname}-src-${version}/docs"
     
    4243
    4344if {$subport != $name} {
    4445    conflicts           py${python.version}-wxpython-2.8
     46    # As long as wxPython and wxWidgets are at the same version,
     47    # this port could also depend on wxWidgets-3.0.
     48    # A separate port is there just because wxPython usually lags behind.
    4549    wxWidgets.use       wxPython-3.0
    4650    depends_lib-append  port:${wxWidgets.port}
    4751
     
    5256    destroot.cmd    ${python.bin} setup.py WX_CONFIG="${wxWidgets.wxconfig}"
    5357
    5458    post-destroot {
    55         # this has already been added by wxWidgets
     59        # When a new release of wxPython comes out, the contents of
     60        # ${destroot}${wxWidgets.prefix}/Versions/wxPython/${branch}/include/wx-${branch}/wx/wxPython
     61        # should be stored separately into wxPython-${version}-MacPorts-subset.tar.bz2
     62        # to be extracted/installed by wxPython-3.0 rather than this port.
     63        # This allows parallel installation of several versions of py**-wxpython-3.0.
    5664        delete      ${destroot}${wxWidgets.prefix}
    5765    }
    5866