]> git.saurik.com Git - wxWidgets.git/commitdiff
Add default value for GetPopupMenuSelectionFromUser() position argument.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 30 Sep 2010 14:33:53 +0000 (14:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 30 Sep 2010 14:33:53 +0000 (14:33 +0000)
Let the menu be popped up at the system-determined position, just as it can
already be done with PopupMenu() itself.

Closes #12530.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65692 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/window.h
interface/wx/window.h

index 6c7930a209a225264de6e15555ada29b070cb60b..2260f8fe3de1fafcd85dde19aff943123c540427 100644 (file)
@@ -1147,7 +1147,8 @@ public:
 
     // simply return the id of the selected item or wxID_NONE without
     // generating any events
-    int GetPopupMenuSelectionFromUser(wxMenu& menu, const wxPoint& pos)
+    int GetPopupMenuSelectionFromUser(wxMenu& menu,
+                                      const wxPoint& pos = wxDefaultPosition)
         { return DoGetPopupMenuSelectionFromUser(menu, pos.x, pos.y); }
     int GetPopupMenuSelectionFromUser(wxMenu& menu, int x, int y)
         { return DoGetPopupMenuSelectionFromUser(menu, x, y); }
index 180aef5b63a34faf6b3d8c7d6b8b6292aad41bc8..ac715f76f78013e6cd58010cffe980b963d301bb 100644 (file)
@@ -2375,6 +2375,10 @@ public:
         The parameter @a menu is the menu to show.
         The parameter @a pos (or the parameters @a x and @a y) is the
         position at which to show the menu in client coordinates.
+        It is recommended to not explicitly specify coordinates when
+        calling this method in response to mouse click, because some of
+        the ports (namely, wxGTK) can do a better job of positioning
+        the menu in that case.
 
         @return
              The selected menu item id or @c wxID_NONE if none selected or an
@@ -2382,7 +2386,8 @@ public:
 
         @since 2.9.0
     */
-    int GetPopupMenuSelectionFromUser(wxMenu& menu, const wxPoint& pos);
+    int GetPopupMenuSelectionFromUser(wxMenu& menu,
+                                      const wxPoint& pos = wxDefaultPosition);
 
     /**
         @overload