- // 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
- inline void SetClientData(void* clientData) { m_clientData = clientData; }
- inline 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
- inline 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
- inline 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);
-
- inline virtual void SetParent(wxEvtHandler *parent) { m_parent = parent; }
- inline void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
- inline wxEvtHandler *GetEventHandler() const { return m_eventHandler; }
-
- // IMPLEMENTATION
- bool OS2Command(WXUINT param, WXWORD id);
-
- inline void SetInvokingWindow(wxWindow *pWin) { m_pInvokingWindow = pWin; }
- inline wxWindow *GetInvokingWindow() const { return m_pInvokingWindow; }
-
- // semi-private accessors
- // get the window which contains this menu
- wxWindow *GetWindow() const;
- // get the menu handle
- WXHMENU GetHMenu() const;
-
- // only for wxMenuBar
- void Attach(wxMenuBar *menubar);
- void Detach();
+ //
+ // Implement base class virtuals
+ //
+ virtual wxMenuItem* DoAppend(wxMenuItem* pItem);
+ virtual wxMenuItem* DoInsert( size_t nPos
+ ,wxMenuItem* pItem
+ );
+ virtual wxMenuItem* DoRemove(wxMenuItem* pItem);
+ virtual void Break(void);
+ virtual void SetTitle(const wxString& rTitle);
+
+ //
+ // Implementation only from now on
+ // -------------------------------
+ //
+ virtual void Attach(wxMenuBarBase* pMenubar);
+
+ bool OS2Command( WXUINT uParam
+ ,WXWORD wId
+ );
+
+ //
+ // Semi-private accessors
+ //
+
+ //
+ // Get the window which contains this menu
+ //
+ wxWindow* GetWindow(void) const;
+
+ //
+ // Get the menu handle
+ //
+ WXHMENU GetHMenu() const { return m_hMenu; }