- // construct menu
- // append a separator to the menu
- void AppendSeparator();
- // append a normal item to the menu
- void Append(int id, const wxString& label,
- const wxString& helpString = wxEmptyString,
- bool checkable = FALSE);
- // append a submenu
- void Append(int id, const wxString& label,
- wxMenu *submenu,
- const wxString& helpString = wxEmptyString);
- // append anything (create wxMenuItem first)
- void Append(wxMenuItem *pItem);
-
- // insert a break in the menu
- void Break();
-
- // delete an item
- // If it's a submenu, menu is not destroyed.
- // VZ: why? shouldn't it return "wxMenu *" then?
- void Delete(int id);
-
- // client data
- void SetClientData(void* clientData) { m_clientData = clientData; }
- void* GetClientData() const { return m_clientData; }
-
- // menu item control
- // enable/disable item
- void Enable(int id, bool enable);
- // TRUE if enabled
- bool IsEnabled(int id) const;
-
- // check/uncheck item - only for checkable items, of course
- void Check(int id, bool check);
- // TRUE if checked
- bool IsChecked(int id) const;
-
- // other properties
- // the menu title
- void SetTitle(const wxString& label);
- const wxString GetTitle() const;
- // the item label
- void SetLabel(int id, const wxString& label);
- wxString GetLabel(int id) const;
- // help string
- virtual void SetHelpString(int id, const wxString& helpString);
- virtual wxString GetHelpString(int id) const;
-
- // get the list of items
- wxList& GetItems() const { return (wxList &)m_menuItems; }
-
- // find item
- // returns id of the item matching the given string or wxNOT_FOUND
- virtual int FindItem(const wxString& itemString) const;
- // returns NULL if not found
- wxMenuItem* FindItem(int id) const { return FindItemForId(id); }
- // find wxMenuItem by ID, and item's menu too if itemMenu is !NULL
- wxMenuItem *FindItemForId(int itemId, wxMenu **itemMenu = NULL) const;
-
- // Updates the UI for a menu and all submenus recursively. source is the
- // object that has the update event handlers defined for it. If NULL, the
- // menu or associated window will be used.
- void UpdateUI(wxEvtHandler* source = (wxEvtHandler*)NULL);
-
- bool ProcessCommand(wxCommandEvent& event);
-
- virtual void SetParent(wxEvtHandler *parent) { m_parent = parent; }
- void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
- wxEvtHandler *GetEventHandler() const { return m_eventHandler; }
-
- // IMPLEMENTATION
- bool MSWCommand(WXUINT param, WXWORD id);
+ // implement base class virtuals
+ virtual wxMenuItem* DoAppend(wxMenuItem *item);
+ virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item);
+ virtual wxMenuItem* DoRemove(wxMenuItem *item);
+
+ virtual void Break();
+
+ virtual void SetTitle(const wxString& title);
+
+ // deprecated functions
+#if wxUSE_MENU_CALLBACK
+ wxMenu(const wxString& title, const wxFunction func)
+ : wxMenuBase(title)
+ {
+ Init();
+
+ Callback(func);
+ }
+#endif // wxUSE_MENU_CALLBACK