case kEventClassCommand :
result = wxMacAppCommandEventHandler( handler , event , data ) ;
break ;
case kEventClassCommand :
result = wxMacAppCommandEventHandler( handler , event , data ) ;
break ;
case kEventClassApplication :
result = wxMacAppApplicationEventHandler( handler , event , data ) ;
break ;
case kEventClassApplication :
result = wxMacAppApplicationEventHandler( handler , event , data ) ;
break ;
- wxMacConvertEventToRecord( event , &rec ) ;
- result = AEProcessAppleEvent( &rec ) ;
+ wxMacConvertEventToRecord( event , &rec ) ;
+ result = AEProcessAppleEvent( &rec ) ;
+ }
+#endif
// Mac OS X passes a process serial number command line argument when
// the application is launched from the Finder. This argument must be
// Mac OS X passes a process serial number command line argument when
// the application is launched from the Finder. This argument must be
if (!sm_isEmbedded)
{
InstallApplicationEventHandler(
GetwxMacAppEventHandlerUPP(),
GetEventTypeCount(eventList), eventList, wxTheApp, (EventHandlerRef *)&(wxTheApp->m_macEventHandler));
}
if (!sm_isEmbedded)
{
InstallApplicationEventHandler(
GetwxMacAppEventHandlerUPP(),
GetEventTypeCount(eventList), eventList, wxTheApp, (EventHandlerRef *)&(wxTheApp->m_macEventHandler));
}
// misc initialization stuff
//----------------------------------------------------------------------
// misc initialization stuff
//----------------------------------------------------------------------
err = GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, NULL, 4, NULL, &modifiers);
err = GetEventParameter(event, kEventParamKeyCode, typeUInt32, NULL, 4, NULL, &keyCode);
err = GetEventParameter(event, kEventParamKeyMacCharCodes, typeChar, NULL, 1, NULL, &charCode);
err = GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, NULL, 4, NULL, &modifiers);
err = GetEventParameter(event, kEventParamKeyCode, typeUInt32, NULL, 4, NULL, &keyCode);
err = GetEventParameter(event, kEventParamKeyMacCharCodes, typeChar, NULL, 1, NULL, &charCode);
rec->what = keyDown ;
err = GetEventParameter(rawEvent, kEventParamKeyModifiers, typeUInt32, NULL, 4, NULL, &modifiers);
err = GetEventParameter(rawEvent, kEventParamKeyCode, typeUInt32, NULL, 4, NULL, &keyCode);
rec->what = keyDown ;
err = GetEventParameter(rawEvent, kEventParamKeyModifiers, typeUInt32, NULL, 4, NULL, &modifiers);
err = GetEventParameter(rawEvent, kEventParamKeyCode, typeUInt32, NULL, 4, NULL, &keyCode);
wxKeyEvent event(wxEVT_KEY_DOWN) ;
MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ;
wxKeyEvent event(wxEVT_KEY_DOWN) ;
MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ;
bool handled;
wxKeyEvent event( wxEVT_KEY_UP ) ;
MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ;
bool handled;
wxKeyEvent event( wxEVT_KEY_UP ) ;
MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ;
/* CTRL-TAB changes the (parent) window, i.e. switch notebook page */
new_event.SetWindowChange( event.ControlDown() );
new_event.SetCurrentFocus( focus );
/* CTRL-TAB changes the (parent) window, i.e. switch notebook page */
new_event.SetWindowChange( event.ControlDown() );
new_event.SetCurrentFocus( focus );
{
// if window is not having a focus still testing for default enter or cancel
// TODO: add the UMA version for ActiveNonFloatingWindow
{
// if window is not having a focus still testing for default enter or cancel
// TODO: add the UMA version for ActiveNonFloatingWindow
// generate wxID_CANCEL if command-. or <esc> has been pressed (typically in dialogs)
wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL);
new_event.SetEventObject( focus );
// generate wxID_CANCEL if command-. or <esc> has been pressed (typically in dialogs)
wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL);
new_event.SetEventObject( focus );
+
+
+void wxApp::MacHideApp()
+{
+ wxMacCarbonEvent event( kEventClassCommand , kEventCommandProcess );
+ HICommand command;
+ memset( &command, 0 , sizeof(command) );
+ command.commandID = kHICommandHide ;
+ event.SetParameter<HICommand>(kEventParamDirectObject, command );
+ SendEventToApplication( event );
+}