fixed obscure compilation problem at line 139

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Surovell
2005-12-13 23:15:42 +00:00
parent a979e444a3
commit 98e04c1376

View File

@@ -133,30 +133,32 @@ static pascal OSStatus TextInputEventHandler( EventHandlerCallRef handler , Even
switch ( GetEventKind( event ) ) switch ( GetEventKind( event ) )
{ {
case kEventTextInputUnicodeForKeyEvent : case kEventTextInputUnicodeForKeyEvent :
// this is only called when no default handler has jumped in, e.g. a wxControl on a floater window does not
// get its own kEventTextInputUnicodeForKeyEvent, so we reroute the event back to the control
wxControl* control = wxDynamicCast( focus , wxControl ) ;
if ( control )
{ {
ControlRef macControl = (ControlRef) control->GetHandle() ; // this is only called when no default handler has jumped in, e.g. a wxControl on a floater window does not
if ( macControl ) // get its own kEventTextInputUnicodeForKeyEvent, so we reroute the event back to the control
wxControl* control = wxDynamicCast( focus , wxControl ) ;
if ( control )
{ {
::HandleControlKey( macControl , keyCode , charCode , modifiers ) ; ControlRef macControl = (ControlRef) control->GetHandle() ;
result = noErr ; if ( macControl )
{
::HandleControlKey( macControl , keyCode , charCode , modifiers ) ;
result = noErr ;
}
} }
}
#if 0 #if 0
// this may lead to double events sent to a window in case all handlers have skipped the key down event // this may lead to double events sent to a window in case all handlers have skipped the key down event
UInt32 when = EventTimeToTicks( GetEventTime( event ) ) ; UInt32 when = EventTimeToTicks( GetEventTime( event ) ) ;
UInt32 message = (keyCode << 8) + charCode; UInt32 message = (keyCode << 8) + charCode;
if ( (focus != NULL) && if ( (focus != NULL) &&
wxTheApp->MacSendKeyDownEvent( focus , message , modifiers , when , point.h , point.v ) ) wxTheApp->MacSendKeyDownEvent( focus , message , modifiers , when , point.h , point.v ) )
{ {
result = noErr ; result = noErr ;
} }
#endif #endif
}
break ; break ;
default: default: