// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "app.h"
-#endif
-
#include "wx/wxprec.h"
#include "wx/window.h"
}
else if ( id != 0 && command.menu.menuRef != 0 && command.menu.menuItemIndex != 0 )
{
- GetMenuItemRefCon( command.menu.menuRef , command.menu.menuItemIndex , (UInt32*) &item ) ;
+ wxMenu* itsMenu = NULL ;
+ UInt32 refCon ;
+ GetMenuItemRefCon( command.menu.menuRef , command.menu.menuItemIndex , &refCon ) ;
+ // make sure it is one of our own menus, otherwise don't touch
+ itsMenu = wxFindMenuFromMacMenu( command.menu.menuRef ) ;
+ if ( itsMenu != NULL )
+ {
+ item = (wxMenuItem*) refCon ;
+ }
}
if ( item )
WXIMPORT char std::__throws_bad_alloc ;
#endif
-#if __WXDEBUG__
+#ifdef __WXDEBUG__
pascal static void wxMacAssertOutputHandler(OSType componentSignature, UInt32 options,
const char *assertionString, const char *exceptionLabelString,
{
// Mac-specific
-#if __WXDEBUG__
+#ifdef __WXDEBUG__
InstallDebugAssertOutputHandler ( NewDebugAssertOutputHandlerUPP( wxMacAssertOutputHandler ) );
#endif
UMAInitToolbox( 4, sm_isEmbedded ) ;
event.SetEventObject(def);
def->Command(event);
return true ;
- }
+ }
}
/* generate wxID_CANCEL if command-. or <esc> has been pressed (typically in dialogs) */
else if (keyval == WXK_ESCAPE || (keyval == '.' && modifiers & cmdKey ) )