+ wxMenu(long lStyle = 0)
+ : wxMenuBase(lStyle)
+ {
+ Init();
+ }
+
+ virtual ~wxMenu();
+
+ //
+ // Implement base class virtuals
+ //
+ virtual bool DoAppend(wxMenuItem* pItem);
+ virtual bool DoInsert( size_t nPos
+ ,wxMenuItem* pItem
+ );
+ virtual wxMenuItem* DoRemove(wxMenuItem* pItem);
+ virtual void Break(void);
+ virtual void SetTitle(const wxString& rTitle);
+
+#if wxUSE_MENU_CALLBACK
+ wxMenu( const wxString& rTitle
+ ,const wxFunction fnFunc
+ )
+ : wxMenuBase(rTitle)
+ {
+ Init();
+ Callback(fnFunc);
+ }
+#endif // wxUSE_MENU_CALLBACK
+
+ //
+ // 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; }
+
+#if wxUSE_ACCEL
+ //
+ // Called by wxMenuBar to build its accel table from the accels of all menus
+ //
+ bool HasAccels(void) const { return m_vAccels.IsEmpty(); }
+ size_t GetAccelCount(void) const { return m_vAccels.GetCount(); }
+ size_t CopyAccels(wxAcceleratorEntry* pAccels) const;
+
+ //
+ // Called by wxMenuItem when its accels changes
+ //
+ void UpdateAccel(wxMenuItem* pItem);
+
+ //
+ // Helper used by wxMenu itself (returns the index in m_accels)
+ //
+ int FindAccel(int nId) const;
+#endif // wxUSE_ACCEL
+ //
+ // OS/2 specific Find
+ //
+ wxMenuItem* FindItem(int id, ULONG hItem, wxMenu **menu = NULL) const;
+ //virtual function hiding suppression
+ int FindItem(const wxString& rsString) const
+ { return wxMenuBase::FindItem(rsString); }
+ wxMenuItem* FindItem(int id, wxMenu **menu = NULL) const
+ { return wxMenuBase::FindItem(id, menu); }
+
+ //
+ // All OS/2PM Menu's have one of these
+ //
+ MENUITEM m_vMenuData;
+
+private:
+ //
+ // Common part of all ctors
+ //
+ void Init();
+
+ //
+ // Common part of Append/Insert (behaves as Append is pos == (size_t)-1)
+ //
+ bool DoInsertOrAppend( wxMenuItem* pItem
+ ,size_t nPos = (size_t)-1
+ );
+
+ //
+ // Terminate the current radio group, if any
+ //
+ void EndRadioGroup(void);
+
+ //
+ // If TRUE, insert a breal before appending the next item
+ //
+ bool m_bDoBreak;
+
+ //
+ // The menu handle of this menu
+ //
+ WXHMENU m_hMenu;
+
+ //
+ // The helper variable for creating unique IDs.
+ //
+ static USHORT m_nextMenuId;
+
+ //
+ // The position of the first item in the current radio group or -1
+ //
+ int m_nStartRadioGroup;
+
+#if wxUSE_ACCEL
+ //
+ // The accelerators for our menu items
+ //
+ wxAcceleratorArray m_vAccels;
+#endif // wxUSE_ACCEL
+
+ DECLARE_DYNAMIC_CLASS(wxMenu)
+}; // end of wxMenu