+// a mapping from wx ids to standard osx actions in order to support the native menu item handling
+// if a new mapping is added, make sure the wxNonOwnedWindowController has a handler for this action as well
+
+struct Mapping
+{
+ int menuid;
+ SEL action;
+};
+
+Mapping sActionToWXMapping[] =
+{
+// as we don't have NSUndoManager support we must not use the native actions
+#if 0
+ { wxID_UNDO, @selector(undo:) },
+ { wxID_REDO, @selector(redo:) },
+#endif
+ { wxID_CUT, @selector(cut:) },
+ { wxID_COPY, @selector(copy:) },
+ { wxID_PASTE, @selector(paste:) },
+ { wxID_CLEAR, @selector(delete:) },
+ { wxID_SELECTALL, @selector(selectAll:) },
+ { 0, NULL }
+};
+
+int wxOSXGetIdFromSelector(SEL action )
+{
+ int i = 0 ;
+ while ( sActionToWXMapping[i].action != nil )
+ {
+ if ( sActionToWXMapping[i].action == action )
+ return sActionToWXMapping[i].menuid;
+ ++i;
+ }
+
+ return 0;
+}
+
+SEL wxOSXGetSelectorFromID(int menuId )
+{
+ int i = 0 ;
+ while ( sActionToWXMapping[i].action != nil )
+ {
+ if ( sActionToWXMapping[i].menuid == menuId )
+ return sActionToWXMapping[i].action;
+ ++i;
+ }
+
+ return nil;
+}
+
+