X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/938aa9c4618c9ed67fa791063681875106d3ef35..8e77fd8bca165aab9709649d79a7cbc6a172d4e1:/include/wx/os2/menu.h diff --git a/include/wx/os2/menu.h b/include/wx/os2/menu.h index 944f3617eb..dfc1df4947 100644 --- a/include/wx/os2/menu.h +++ b/include/wx/os2/menu.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: menu.h +// Name: wx/os2/menu.h // Purpose: wxMenu, wxMenuBar classes // Author: David Webster // Modified by: @@ -13,14 +13,14 @@ #define _WX_MENU_H_ #if wxUSE_ACCEL -// #include "wx/accel.h" -// #include "wx/list.h" // for "template" list classes -// #include "wx/dynarray.h" + #include "wx/accel.h" + #include "wx/list.h" // for "template" list classes + #include "wx/dynarray.h" -// WX_DECLARE_EXPORTED_LIST(wxAcceleratorEntry, wxAcceleratorList); + WX_DEFINE_EXPORTED_ARRAY_PTR(wxAcceleratorEntry *, wxAcceleratorArray); #endif // wxUSE_ACCEL -class WXDLLEXPORT wxFrame; +class WXDLLIMPEXP_FWD_CORE wxFrame; void wxSetShortCutKey(wxChar* zText); @@ -28,7 +28,7 @@ void wxSetShortCutKey(wxChar* zText); // Menu // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxMenu : public wxMenuBase +class WXDLLIMPEXP_CORE wxMenu : public wxMenuBase { public: // @@ -55,29 +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 - // // Implementation only from now on // ------------------------------- // + virtual void Attach(wxMenuBarBase* pMenubar); + bool OS2Command( WXUINT uParam ,WXWORD wId ); @@ -100,8 +91,8 @@ public: // // Called by wxMenuBar to build its accel table from the accels of all menus // - bool HasAccels(void) const { return m_vAccels[0] != NULL; } - size_t GetAccelCount(void) const { return (size_t)m_nNextAccel; } + bool HasAccels(void) const { return m_vAccels.IsEmpty(); } + size_t GetAccelCount(void) const { return m_vAccels.GetCount(); } size_t CopyAccels(wxAcceleratorEntry* pAccels) const; // @@ -148,9 +139,9 @@ private: void EndRadioGroup(void); // - // If TRUE, insert a breal before appending the next item + // If true, insert a breal before appending the next item // - bool m_bDoBreak; + bool m_bDoBreak; // // The menu handle of this menu @@ -160,7 +151,7 @@ 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 @@ -171,8 +162,7 @@ private: // // The accelerators for our menu items // - wxAcceleratorEntry* m_vAccels[128]; - int m_nNextAccel; + wxAcceleratorArray m_vAccels; #endif // wxUSE_ACCEL DECLARE_DYNAMIC_CLASS(wxMenu) @@ -182,7 +172,7 @@ private: // Menu Bar (a la Windows) // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxMenuBar : public wxMenuBarBase +class WXDLLIMPEXP_CORE wxMenuBar : public wxMenuBarBase { public: // @@ -204,6 +194,7 @@ public: wxMenuBar( int n ,wxMenu* vMenus[] ,const wxString sTitles[] + ,long lStyle = 0 ); virtual ~wxMenuBar(); @@ -235,20 +226,10 @@ public: virtual void EnableTop( size_t nPos ,bool bFlag ); - virtual void SetLabelTop( size_t nPos + virtual void SetMenuLabel( size_t nPos ,const wxString& rLabel ); - 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 + virtual wxString GetMenuLabel(size_t nPos) const; // // Implementation from now on @@ -264,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 @@ -285,10 +266,6 @@ protected: // void Init(void); -#if WXWIN_COMPATIBILITY - wxEvtHandler* m_pEventHandler; -#endif // WXWIN_COMPATIBILITY - wxArrayString m_titles; WXHMENU m_hMenu;