long wxApp::s_lastModifiers = 0 ;
-bool wxApp::s_macDefaultEncodingIsPC = true ;
bool wxApp::s_macSupportPCMenuShortcuts = true ;
long wxApp::s_macAboutMenuItemId = wxID_ABOUT ;
-long wxApp::s_macPreferencesMenuItemId = 0 ;
+long wxApp::s_macPreferencesMenuItemId = wxID_PREFERENCES ;
long wxApp::s_macExitMenuItemId = wxID_EXIT ;
wxString wxApp::s_macHelpMenuTitleName = wxT("&Help") ;
{ kEventClassMouse , kEventMouseDown } ,
{ kEventClassMouse , kEventMouseMoved } ,
+ { kEventClassMouse , kEventMouseUp } ,
+ { kEventClassMouse , kEventMouseDragged } ,
{ 'WXMC' , 'WXMC' }
} ;
// but have to use ReceiveNextEvent dealing with events manually, therefore we also have
// deal with clicks in the menu bar explicitely
+pascal OSStatus wxMacWindowEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) ;
+
static pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
{
OSStatus result = eventNotHandledErr ;
}
}
break ;
+ case kEventMouseDragged :
+ case kEventMouseUp :
+ {
+ if ( wxTheApp->s_captureWindow )
+ wxMacWindowEventHandler( handler , event , (void*) wxTheApp->s_captureWindow->MacGetTopLevelWindow() ) ;
+ }
+ break ;
case kEventMouseMoved :
{
wxTheApp->MacHandleMouseMovedEvent( point.h , point.v , modifiers , EventTimeToTicks( GetEventTime( event ) ) ) ;
wxMenuItem* item = NULL ;
if ( mbar )
+ {
item = mbar->FindItem( id , &menu ) ;
+ // it is not 100 % sure that an menu of id 0 is really ours, safety check
+ if ( id == 0 && menu != NULL && menu->GetHMenu() != command.menu.menuRef )
+ {
+ item = NULL ;
+ menu = NULL ;
+ }
+ }
if ( item == NULL || menu == NULL || mbar == NULL )
return result ;
break ;
case kEventCommandUpdateStatus:
// eventually trigger an updateui round
- result = noErr ;
+ result = noErr ;
break ;
default :
break ;
#ifndef __DARWIN__
# if __option(profile)
- ProfilerInit( collectDetailed, bestTimeBase , 20000 , 40 ) ;
+ ProfilerInit( collectDetailed, bestTimeBase , 40000 , 50 ) ;
# endif
#endif
m_auto3D = TRUE;
m_macCurrentEvent = NULL ;
+#if TARGET_CARBON
m_macCurrentEventHandlerCallRef = NULL ;
+#endif
}
bool wxApp::Initialized()
event.SetEventType( ( ev->modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
focus->GetEventHandler()->ProcessEvent( event ) ;
}
- if ( ev->modifiers ^ s_lastModifiers ) & cmdKey )
+ if ( ( ev->modifiers ^ s_lastModifiers ) & cmdKey )
{
event.m_keyCode = WXK_COMMAND ;
event.SetEventType( ( ev->modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
{
// Activate window first
::SelectWindow( window ) ;
-
+
// Send event later
if ( win )
win->MacMouseDown( ev , windowPart ) ;
event.m_controlDown = modifiers & controlKey;
event.m_altDown = modifiers & optionKey;
event.m_metaDown = modifiers & cmdKey;
-
+
event.m_x = x;
event.m_y = y;
event.m_timeStamp = timestamp;