X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d15694e8cad1d44087323bd568ca33ff5b354f2c..cdbd62d6ff290fd58acd1bc5574dfc79db3a6f70:/src/osx/carbon/window.cpp?ds=sidebyside diff --git a/src/osx/carbon/window.cpp b/src/osx/carbon/window.cpp index c7289bdf46..5a4a0bf791 100644 --- a/src/osx/carbon/window.cpp +++ b/src/osx/carbon/window.cpp @@ -4,7 +4,6 @@ // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -87,6 +86,12 @@ WXWidget wxWidgetImpl::FindFocus() return control; } +// no compositing to take into account under carbon +wxWidgetImpl* wxWidgetImpl::FindBestFromWXWidget(WXWidget control) +{ + return FindFromWXWidget(control); +} + // --------------------------------------------------------------------------- // Carbon Events // --------------------------------------------------------------------------- @@ -585,7 +590,7 @@ wxMacWindowServiceEventHandler(EventHandlerCallRef WXUNUSED(handler), return result ; } -pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) +WXDLLEXPORT pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) { OSStatus result = eventNotHandledErr ; wxWindowMac* focus = (wxWindowMac*) data ; @@ -653,8 +658,7 @@ pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler , Even I don't have time to look into that right now. -- CL */ - if ( wxTheApp->MacSendCharEvent( - focus , message , 0 , when , 0 , 0 , uniChars[pos] ) ) + if ( wxTheApp->MacSendCharEvent( focus , message , 0 , when , uniChars[pos] ) ) { result = noErr ; } @@ -666,15 +670,13 @@ pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler , Even case kEventTextInputUnicodeForKeyEvent : { UInt32 keyCode, modifiers ; - Point point ; EventRef rawEvent ; unsigned char charCode ; GetEventParameter( event, kEventParamTextInputSendKeyboardEvent, typeEventRef, NULL, sizeof(rawEvent), NULL, &rawEvent ) ; - GetEventParameter( rawEvent, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(char), NULL, &charCode ); + GetEventParameter( rawEvent, kEventParamKeyMacCharCodes, typeChar, NULL, 1, NULL, &charCode ); GetEventParameter( rawEvent, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode ); GetEventParameter( rawEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers ); - GetEventParameter( rawEvent, kEventParamMouseLocation, typeQDPoint, NULL, sizeof(Point), NULL, &point ); UInt32 message = (keyCode << 8) + charCode; @@ -686,8 +688,7 @@ pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler , Even WXEVENTHANDLERCALLREF formerHandler = wxTheApp->MacGetCurrentEventHandlerCallRef() ; wxTheApp->MacSetCurrentEvent( event , handler ) ; - if ( wxTheApp->MacSendCharEvent( - focus , message , modifiers , when , point.h , point.v , uniChars[pos] ) ) + if ( wxTheApp->MacSendCharEvent( focus , message , modifiers , when , uniChars[pos] ) ) { result = noErr ; } @@ -1408,7 +1409,15 @@ void wxMacControl::Enable( bool enable ) void wxMacControl::SetDrawingEnabled( bool enable ) { - HIViewSetDrawingEnabled( m_controlRef , enable ); + if ( enable ) + { + HIViewSetDrawingEnabled( m_controlRef , true ); + HIViewSetNeedsDisplay( m_controlRef, true); + } + else + { + HIViewSetDrawingEnabled( m_controlRef , false ); + } } void wxMacControl::GetRectInWindowCoords( Rect *r )