X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..0dbfd66d0b35352a0f60e7190b72815052b3d2d4:/include/wx/os2/menu.h diff --git a/include/wx/os2/menu.h b/include/wx/os2/menu.h index 7b05ee3297..944f3617eb 100644 --- a/include/wx/os2/menu.h +++ b/include/wx/os2/menu.h @@ -13,10 +13,11 @@ #define _WX_MENU_H_ #if wxUSE_ACCEL - #include "wx/accel.h" - #include "wx/dynarray.h" +// #include "wx/accel.h" +// #include "wx/list.h" // for "template" list classes +// #include "wx/dynarray.h" - WX_DEFINE_EXPORTED_ARRAY(wxAcceleratorEntry *, wxAcceleratorArray); +// WX_DECLARE_EXPORTED_LIST(wxAcceleratorEntry, wxAcceleratorList); #endif // wxUSE_ACCEL class WXDLLEXPORT wxFrame; @@ -73,12 +74,6 @@ public: } #endif // wxUSE_MENU_CALLBACK - // - // OS2-specific - // - bool ProcessCommand(wxCommandEvent& rEvent); - - // // Implementation only from now on // ------------------------------- @@ -101,18 +96,12 @@ public: // WXHMENU GetHMenu() const { return m_hMenu; } - // - // Attach/detach menu to/from wxMenuBar - // - void Attach(wxMenuBar* pMenubar); - void Detach(void); - #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(); } + bool HasAccels(void) const { return m_vAccels[0] != NULL; } + size_t GetAccelCount(void) const { return (size_t)m_nNextAccel; } size_t CopyAccels(wxAcceleratorEntry* pAccels) const; // @@ -125,6 +114,15 @@ public: // 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 @@ -144,6 +142,11 @@ private: ,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 // @@ -157,13 +160,19 @@ private: // // The helper variable for creating unique IDs. // - static USHORT m_nextMenuId; + 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; + wxAcceleratorEntry* m_vAccels[128]; + int m_nNextAccel; #endif // wxUSE_ACCEL DECLARE_DYNAMIC_CLASS(wxMenu) @@ -219,7 +228,10 @@ public: virtual wxMenuItem* FindItem( int nId ,wxMenu** ppMenu = NULL ) const; - + virtual wxMenuItem* FindItem( int nId + ,ULONG hItem + ,wxMenu** ppMenu = NULL + ) const; virtual void EnableTop( size_t nPos ,bool bFlag ); @@ -242,22 +254,8 @@ public: // Implementation from now on // WXHMENU Create(void); - void Detach(void); - - // - // Returns TRUE if we're attached to a frame - // - bool IsAttached(void) const { return m_pMenuBarFrame != NULL; } - - // - // Get the frame we live in - // - wxFrame * GetFrame(void) const { return m_pMenuBarFrame; } - - // - // Attach to a frame - // - void Attach(wxFrame* pFrame); + virtual void Detach(void); + virtual void Attach(wxFrame* pFrame); #if wxUSE_ACCEL // @@ -293,7 +291,6 @@ protected: wxArrayString m_titles; - wxFrame* m_pMenuBarFrame; WXHMENU m_hMenu; #if wxUSE_ACCEL