X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..ae999b11ec671b5a12a30f24c0aa6b36978b3fd6:/include/wx/os2/menu.h diff --git a/include/wx/os2/menu.h b/include/wx/os2/menu.h index 7b05ee3297..b871f900e4 100644 --- a/include/wx/os2/menu.h +++ b/include/wx/os2/menu.h @@ -14,9 +14,10 @@ #if wxUSE_ACCEL #include "wx/accel.h" + #include "wx/list.h" // for "template" list classes #include "wx/dynarray.h" - WX_DEFINE_EXPORTED_ARRAY(wxAcceleratorEntry *, wxAcceleratorArray); + WX_DEFINE_EXPORTED_ARRAY_PTR(wxAcceleratorEntry *, wxAcceleratorArray); #endif // wxUSE_ACCEL class WXDLLEXPORT wxFrame; @@ -54,35 +55,20 @@ public: // // Implement base class virtuals // - virtual bool DoAppend(wxMenuItem* pItem); - virtual bool DoInsert( size_t nPos + 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); -#if wxUSE_MENU_CALLBACK - wxMenu( const wxString& rTitle - ,const wxFunction fnFunc - ) - : wxMenuBase(rTitle) - { - Init(); - Callback(fnFunc); - } -#endif // wxUSE_MENU_CALLBACK - - // - // OS2-specific - // - bool ProcessCommand(wxCommandEvent& rEvent); - - // // Implementation only from now on // ------------------------------- // + virtual void Attach(wxMenuBarBase* pMenubar); + bool OS2Command( WXUINT uParam ,WXWORD wId ); @@ -101,17 +87,11 @@ 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(); } + bool HasAccels(void) const { return m_vAccels.IsEmpty(); } size_t GetAccelCount(void) const { return m_vAccels.GetCount(); } size_t CopyAccels(wxAcceleratorEntry* pAccels) const; @@ -125,6 +105,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 @@ -145,9 +134,14 @@ private: ); // - // If TRUE, insert a breal before appending the next item + // Terminate the current radio group, if any // - bool m_bDoBreak; + void EndRadioGroup(void); + + // + // If true, insert a breal before appending the next item + // + bool m_bDoBreak; // // The menu handle of this menu @@ -157,7 +151,12 @@ 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 // @@ -195,6 +194,7 @@ public: wxMenuBar( int n ,wxMenu* vMenus[] ,const wxString sTitles[] + ,long lStyle = 0 ); virtual ~wxMenuBar(); @@ -219,7 +219,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 ); @@ -228,36 +231,12 @@ public: ); virtual wxString GetLabelTop(size_t nPos) const; - // - // Compatibility: these functions are deprecated - // -#if WXWIN_COMPATIBILITY - void SetEventHandler(wxEvtHandler* pHandler) { m_pEventHandler = pHandler; } - wxEvtHandler* GetEventHandler(void) { return m_pEventHandler; } - bool Enabled(int nId) const { return IsEnabled(nId); } - bool Checked(int nId) const { return IsChecked(nId); } -#endif // WXWIN_COMPATIBILITY - // // 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 // @@ -266,7 +245,7 @@ public: const wxAcceleratorTable& GetAccelTable(void) const { return m_vAccelTable; } // - // Update the accel table (must be called after adding/deletign a menu) + // Update the accel table (must be called after adding/deleting a menu) // void RebuildAccelTable(void); #endif // wxUSE_ACCEL @@ -287,13 +266,8 @@ protected: // void Init(void); -#if WXWIN_COMPATIBILITY - wxEvtHandler* m_pEventHandler; -#endif // WXWIN_COMPATIBILITY - wxArrayString m_titles; - wxFrame* m_pMenuBarFrame; WXHMENU m_hMenu; #if wxUSE_ACCEL