]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/menu.h
Adding label editing to native OS X listctrl.
[wxWidgets.git] / include / wx / menu.h
index 5e31cede132774c4921df014c6610dd24d864930..9967d81d0d7dcd5ae3e79cf55aa5e0bdd53dc6b4 100644 (file)
@@ -60,7 +60,7 @@ public:
 
     // append any kind of item (normal/check/radio/separator)
     wxMenuItem* Append(int itemid,
-                       const wxString& text,
+                       const wxString& text = wxEmptyString,
                        const wxString& help = wxEmptyString,
                        wxItemKind kind = wxITEM_NORMAL)
     {
@@ -87,12 +87,11 @@ public:
     }
 
     // append a submenu
-    wxMenuItem* Append(int itemid,
-                       const wxString& text,
-                       wxMenu *submenu,
-                       const wxString& help = wxEmptyString)
+    wxMenuItem* AppendSubMenu(wxMenu *submenu,
+                              const wxString& text,
+                              const wxString& help = wxEmptyString)
     {
-        return DoAppend(wxMenuItem::New((wxMenu *)this, itemid, text, help,
+        return DoAppend(wxMenuItem::New((wxMenu *)this, wxID_ANY, text, help,
                                         wxITEM_NORMAL, submenu));
     }
 
@@ -109,7 +108,7 @@ public:
     // insert an item before given position
     wxMenuItem* Insert(size_t pos,
                        int itemid,
-                       const wxString& text,
+                       const wxString& text = wxEmptyString,
                        const wxString& help = wxEmptyString,
                        wxItemKind kind = wxITEM_NORMAL)
     {
@@ -159,7 +158,7 @@ public:
 
     // prepend any item to the menu
     wxMenuItem* Prepend(int itemid,
-                        const wxString& text,
+                        const wxString& text = wxEmptyString,
                         const wxString& help = wxEmptyString,
                         wxItemKind kind = wxITEM_NORMAL)
     {
@@ -309,6 +308,16 @@ public:
         Append(itemid, text, help, isCheckable ? wxITEM_CHECK : wxITEM_NORMAL);
     }
 
+    // use more readable and not requiring unused itemid AppendSubMenu() instead
+    wxMenuItem* Append(int itemid,
+                       const wxString& text,
+                       wxMenu *submenu,
+                       const wxString& help = wxEmptyString)
+    {
+        return DoAppend(wxMenuItem::New((wxMenu *)this, itemid, text, help,
+                                        wxITEM_NORMAL, submenu));
+    }
+
     void Insert(size_t pos,
                 int itemid,
                 const wxString& text,
@@ -504,8 +513,10 @@ protected:
     #include "wx/msw/menu.h"
 #elif defined(__WXMOTIF__)
     #include "wx/motif/menu.h"
-#elif defined(__WXGTK__)
+#elif defined(__WXGTK20__)
     #include "wx/gtk/menu.h"
+#elif defined(__WXGTK__)
+    #include "wx/gtk1/menu.h"
 #elif defined(__WXMAC__)
     #include "wx/mac/menu.h"
 #elif defined(__WXCOCOA__)