]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/menu.h
more Doxygen warning fixes
[wxWidgets.git] / interface / wx / menu.h
index efefdb48211290fc7b86b45bfad537a56af2f00b..a90a802a0a991435843309b25821446446fc299d 100644 (file)
@@ -89,7 +89,7 @@ public:
         @remarks Only use this when the menu bar has been associated with a
                  frame; otherwise, use the wxMenu equivalent call.
     */
-    void Check(int id, const bool check);
+    void Check(int id, bool check);
 
     /**
         Enables or disables (greys out) a menu item.
@@ -102,7 +102,7 @@ public:
         @remarks Only use this when the menu bar has been associated with a
                  frame; otherwise, use the wxMenu equivalent call.
     */
-    void Enable(int id, const bool enable);
+    void Enable(int id, bool enable);
 
     /**
         Enables or disables a whole menu.
@@ -114,7 +114,7 @@ public:
 
         @remarks Only use this when the menu bar has been associated with a frame.
     */
-    void EnableTop(int pos, const bool enable);
+    virtual void EnableTop(size_t pos, bool enable);
 
     /**
         Finds the menu item object associated with the given menu item identifier.
@@ -126,7 +126,7 @@ public:
 
         @return The found menu item object, or @NULL if one was not found.
     */
-    wxMenuItem* FindItem(int id, wxMenu menu = NULL) const;
+    virtual wxMenuItem* FindItem(int id, wxMenu* menu = NULL) const;
 
     /**
         Returns the index of the menu with the given @a title or @c wxNOT_FOUND if no
@@ -151,8 +151,8 @@ public:
         @remarks Any special menu codes are stripped out of source and target
                  strings before matching.
     */
-    int FindMenuItem(const wxString& menuString,
-                     const wxString& itemString) const;
+    virtual int FindMenuItem(const wxString& menuString,
+                             const wxString& itemString) const;
 
     /**
         Gets the help string associated with the menu item identifier.
@@ -197,12 +197,12 @@ public:
 
         @see SetLabelTop()
     */
-    wxString GetLabelTop(int pos) const;
+    wxString GetLabelTop(size_t pos) const;
 
     /**
         Returns the menu at @a menuIndex (zero-based).
     */
-    wxMenu* GetMenu(int menuIndex) const;
+    wxMenu* GetMenu(size_t menuIndex) const;
 
     /**
         Returns the number of menus in this menubar.
@@ -223,7 +223,7 @@ public:
 
         @see GetMenuLabelText(), SetMenuLabel()
     */
-    wxString GetMenuLabel(int pos) const;
+    virtual wxString GetMenuLabel(size_t pos) const;
 
     /**
         Returns the label of a top-level menu. Note that the returned string does not
@@ -239,7 +239,7 @@ public:
 
         @see GetMenuLabel(), SetMenuLabel()
     */
-    wxString GetMenuLabelText(int pos) const;
+    virtual wxString GetMenuLabelText(size_t pos) const;
 
     /**
         Inserts the menu at the given position into the menu bar. Inserting menu at
@@ -282,7 +282,7 @@ public:
     /**
         Redraw the menu bar
     */
-    void Refresh();
+    virtual void Refresh(bool eraseBackground = true, const wxRect* rect = NULL);
 
     /**
         Removes the menu from the menu bar and returns the menu object - the caller
@@ -351,7 +351,7 @@ public:
 
         @see GetLabelTop()
     */
-    void SetLabelTop(int pos, const wxString& label);
+    void SetLabelTop(size_t pos, const wxString& label);
 
     /**
         Sets the label of a top-level menu.
@@ -363,7 +363,7 @@ public:
 
         @remarks Use only after the menubar has been associated with a frame.
     */
-    void SetMenuLabel(int pos, const wxString& label);
+    virtual void SetMenuLabel(size_t pos, const wxString& label);
 };
 
 
@@ -451,7 +451,7 @@ public:
         @param style
             If set to wxMENU_TEAROFF, the menu will be detachable (wxGTK only).
     */
-    wxMenu(const wxString& title = "", long style = 0);
+    wxMenu(const wxString& title, long style = 0);
 
     /**
         Destructor, destroying the menu.
@@ -570,7 +570,7 @@ public:
         @see Append(), InsertCheckItem()
     */
     wxMenuItem* AppendCheckItem(int id, const wxString& item,
-                                const wxString& helpString = "");
+                                const wxString& help = wxEmptyString);
 
     /**
         Adds a radio item to the end of the menu.
@@ -580,7 +580,7 @@ public:
         @see Append(), InsertRadioItem()
     */
     wxMenuItem* AppendRadioItem(int id, const wxString& item,
-                                const wxString& helpString = "");
+                                const wxString& help = wxEmptyString);
 
     /**
         Adds a separator to the end of the menu.
@@ -613,7 +613,7 @@ public:
 
         @see IsChecked()
     */
-    void Check(int id, const bool check);
+    void Check(int id, bool check);
 
     /**
         Deletes the menu item from the menu. If the item is a submenu, it will
@@ -624,7 +624,7 @@ public:
 
         @see FindItem(), Destroy(), Remove()
     */
-    void Delete(int id);
+    bool Delete(int id);
 
     /**
         Deletes the menu item from the menu. If the item is a submenu, it will
@@ -635,7 +635,7 @@ public:
 
         @see FindItem(), Destroy(), Remove()
     */
-    void Delete(wxMenuItem* item);
+    bool Delete(wxMenuItem* item);
 
     /**
         Deletes the menu item from the menu. If the item is a submenu, it will
@@ -647,7 +647,7 @@ public:
 
         @see FindItem(), Deletes(), Remove()
     */
-    void Destroy(int id);
+    bool Destroy(int id);
 
     /**
         Deletes the menu item from the menu. If the item is a submenu, it will
@@ -659,7 +659,7 @@ public:
 
         @see FindItem(), Deletes(), Remove()
     */
-    void Destroy(wxMenuItem* item);
+    bool Destroy(wxMenuItem* item);
 
     /**
         Enables or disables (greys out) a menu item.
@@ -671,7 +671,7 @@ public:
 
         @see IsEnabled()
     */
-    void Enable(int id, const bool enable);
+    void Enable(int id, bool enable);
 
     /**
         Finds the menu id for a menu item string.
@@ -698,7 +698,7 @@ public:
 
         @return Menu item object or NULL if none is found.
     */
-    const wxMenuItem* FindItem(int id, wxMenu** menu = NULL) const;
+    wxMenuItem* FindItem(int id, wxMenu** menu = NULL) const;
 
     /**
         Returns the wxMenuItem given a position in the menu.
@@ -748,13 +748,16 @@ public:
     */
     size_t GetMenuItemCount() const;
 
+    //@{
     /**
         Returns the list of items in the menu.
 
         wxMenuItemList is a pseudo-template list class containing wxMenuItem
         pointers, see wxList.
     */
-    wxMenuItemList GetMenuItems() const;
+    wxMenuItemList& GetMenuItems() const;
+    const wxMenuItemList& GetMenuItems() const;
+    //@}
 
     /**
         Returns the title of the menu.
@@ -764,7 +767,7 @@ public:
 
         @see SetTitle()
     */
-    wxString GetTitle() const;
+    const wxString& GetTitle() const;
 
     /**
         Inserts the given @a item before the position @a pos.
@@ -785,8 +788,8 @@ public:
         @see Append(), Prepend()
     */
     wxMenuItem* Insert(size_t pos, int id,
-                       const wxString& item = "",
-                       const wxString& helpString = "",
+                       const wxString& item = wxEmptyString,
+                       const wxString& helpString = wxEmptyString,
                        wxItemKind kind = wxITEM_NORMAL);
 
     /**
@@ -794,18 +797,16 @@ public:
 
         @see Insert(), AppendCheckItem()
     */
-    wxMenuItem* InsertCheckItem(size_t pos, int id,
-                                const wxString& item,
-                                const wxString& helpString = "");
+    wxMenuItem* InsertCheckItem(size_t pos, int id, const wxString& item,
+                                const wxString& helpString = wxEmptyString);
 
     /**
         Inserts a radio item at the given position.
 
         @see Insert(), AppendRadioItem()
     */
-    wxMenuItem* InsertRadioItem(size_t pos, int id,
-                                const wxString& item,
-                                const wxString& helpString = "");
+    wxMenuItem* InsertRadioItem(size_t pos, int id, const wxString& item,
+                                const wxString& helpString = wxEmptyString);
 
     /**
         Inserts a separator at the given position.
@@ -852,8 +853,8 @@ public:
 
         @see Append(), Insert()
     */
-    wxMenuItem* Prepend(int id, const wxString& item = "",
-                        const wxString& helpString = "",
+    wxMenuItem* Prepend(int id, const wxString& item = wxEmptyString,
+                        const wxString& helpString = wxEmptyString,
                         wxItemKind kind = wxITEM_NORMAL);
 
     /**
@@ -862,7 +863,7 @@ public:
         @see Prepend(), AppendCheckItem()
     */
     wxMenuItem* PrependCheckItem(int id, const wxString& item,
-                                 const wxString& helpString = "");
+                                 const wxString& helpString = wxEmptyString);
 
     /**
         Inserts a radio item at position 0.
@@ -870,7 +871,7 @@ public:
         @see Prepend(), AppendRadioItem()
     */
     wxMenuItem* PrependRadioItem(int id, const wxString& item,
-                                 const wxString& helpString = "");
+                                 const wxString& helpString = wxEmptyString);
 
     /**
         Inserts a separator at position 0.