]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/window.h
Change default alignment to centre vertically
[wxWidgets.git] / include / wx / window.h
index 717aabd93e54c580d05d987264b02e4599c4f59f..62396ddcac870e20a19b7c17475147a22b288668 100644 (file)
@@ -988,10 +988,19 @@ public:
     virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) ;
 
 #if wxUSE_MENUS
+    // show popup menu at the given position, generate events for the items
+    // selected in it
     bool PopupMenu(wxMenu *menu, const wxPoint& pos = wxDefaultPosition)
         { return DoPopupMenu(menu, pos.x, pos.y); }
     bool PopupMenu(wxMenu *menu, int x, int y)
         { return DoPopupMenu(menu, x, y); }
+
+    // simply return the id of the selected item or wxID_NONE without
+    // generating any events
+    int GetPopupMenuSelectionFromUser(wxMenu& menu, const wxPoint& pos)
+        { return DoGetPopupMenuSelectionFromUser(menu, pos.x, pos.y); }
+    int GetPopupMenuSelectionFromUser(wxMenu& menu, int x, int y)
+        { return DoGetPopupMenuSelectionFromUser(menu, x, y); }
 #endif // wxUSE_MENUS
 
     // override this method to return true for controls having multiple pages
@@ -1497,6 +1506,13 @@ private:
     // enabled/disabled
     void NotifyWindowOnEnableChange(bool enabled);
 
+#if wxUSE_MENUS
+    // temporary event handler used by GetPopupMenuSelectionFromUser()
+    void InternalOnPopupMenu(wxCommandEvent& event);
+
+    // implementation of the public GetPopupMenuSelectionFromUser() method
+    int DoGetPopupMenuSelectionFromUser(wxMenu& menu, int x, int y);
+#endif // wxUSE_MENUS
 
     // contains the last id generated by NewControlId
     static int ms_lastControlId;