X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/524c47aa3adf2af11a3069fd5da035a604f08f66..eb97543d28f634b302038aa58ecd6c965cf1efb9:/src/osx/cocoa/window.mm diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 7cff3356c6..4594a4931d 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -11,7 +11,9 @@ #include "wx/wxprec.h" -#include +#ifndef WX_PRECOMP +#include "wx/nonownedwnd.h" +#endif #ifdef __WXMAC__ #include "wx/osx/private.h" @@ -110,6 +112,7 @@ long wxOSXTranslateCocoaKey(unsigned short code, int unichar ) void SetupKeyEvent( wxKeyEvent &wxevent , NSEvent * nsEvent ) { UInt32 modifiers = [nsEvent modifierFlags] ; + int eventType = [nsEvent type]; wxevent.m_shiftDown = modifiers & NSShiftKeyMask; wxevent.m_controlDown = modifiers & NSControlKeyMask; @@ -117,11 +120,14 @@ void SetupKeyEvent( wxKeyEvent &wxevent , NSEvent * nsEvent ) wxevent.m_metaDown = modifiers & NSCommandKeyMask; wxString chars; - NSString* nschars = [nsEvent characters]; - if ( nschars ) + if ( eventType != NSFlagsChanged ) { - wxCFStringRef cfchars((CFStringRef)[nschars retain]); - chars = cfchars.AsString(); + NSString* nschars = [nsEvent characters]; + if ( nschars ) + { + wxCFStringRef cfchars((CFStringRef)[nschars retain]); + chars = cfchars.AsString(); + } } int unichar = chars.Length() > 0 ? chars[0] : 0; @@ -134,7 +140,6 @@ void SetupKeyEvent( wxKeyEvent &wxevent , NSEvent * nsEvent ) wxevent.m_rawFlags = modifiers; wxevent.SetTimestamp( [nsEvent timestamp] * 1000.0 ) ; - int eventType = [nsEvent type]; switch (eventType) { case NSKeyDown : @@ -322,7 +327,7 @@ void SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEvent ) wxRegion updateRgn; const NSRect *rects; - int count ; + NSInteger count; [self getRectsBeingDrawn:&rects count:&count]; for ( int i = 0 ; i < count ; ++i ) @@ -708,6 +713,15 @@ void wxWidgetCocoaImpl::SetControlSize( wxWindowVariant variant ) [m_osxView setControlSize:size]; } +void wxWidgetCocoaImpl::SetFont(wxFont const&, wxColour const&, long, bool) +{ + // TODO +} + +void wxWidgetCocoaImpl::InstallEventHandler( WXWidget control ) +{ +} + // // Factory methods //