X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c71830c3b63568566cf5f006165e51ffaee0c704..ab67e8874db324fab5223cc8d5dff8a8de3e2b77:/include/wx/motif/menu.h diff --git a/include/wx/motif/menu.h b/include/wx/motif/menu.h index 90fc70ed35..a48c219af0 100644 --- a/include/wx/motif/menu.h +++ b/include/wx/motif/menu.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: menu.h +// Name: wx/motif/menu.h // Purpose: wxMenu, wxMenuBar classes // Author: Julian Smart // Modified by: @@ -12,20 +12,17 @@ #ifndef _WX_MOTIF_MENU_H_ #define _WX_MOTIF_MENU_H_ -#ifdef __GNUG__ - #pragma interface "menu.h" -#endif - #include "wx/colour.h" #include "wx/font.h" +#include "wx/arrstr.h" -class wxFrame; +class WXDLLIMPEXP_FWD_CORE wxFrame; // ---------------------------------------------------------------------------- // Menu // ---------------------------------------------------------------------------- -class wxMenu : public wxMenuBase +class WXDLLIMPEXP_CORE wxMenu : public wxMenuBase { public: // ctors & dtor @@ -37,9 +34,9 @@ public: virtual ~wxMenu(); // implement base class virtuals - virtual bool DoAppend(wxMenuItem *item); - virtual bool DoInsert(size_t pos, wxMenuItem *item); - virtual wxMenuItem *DoRemove(wxMenuItem *item); + virtual wxMenuItem* DoAppend(wxMenuItem *item); + virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); + virtual wxMenuItem* DoRemove(wxMenuItem *item); virtual void Break(); @@ -47,14 +44,6 @@ public: bool ProcessCommand(wxCommandEvent& event); -#if WXWIN_COMPATIBILITY - wxMenu(const wxString& title, const wxFunction func) - : wxMenuBase(title) - { - Callback(func); - } -#endif // WXWIN_COMPATIBILITY - //// Motif-specific WXWidget GetButtonWidget() const { return m_buttonWidget; } void SetButtonWidget(WXWidget buttonWidget) { m_buttonWidget = buttonWidget; } @@ -73,8 +62,8 @@ public: void HidePopup(); WXWidget CreateMenu(wxMenuBar *menuBar, WXWidget parent, wxMenu *topMenu, - const wxString& title = wxEmptyString, - bool isPulldown = FALSE); + size_t index, const wxString& title = wxEmptyString, + bool isPulldown = false); // For popups, need to destroy, then recreate menu for a different (or // possibly same) window, since the parent may change. @@ -88,12 +77,13 @@ public: void SetBackgroundColour(const wxColour& colour); void SetForegroundColour(const wxColour& colour); void SetFont(const wxFont& colour); - void ChangeFont(bool keepOriginalSize = FALSE); + void ChangeFont(bool keepOriginalSize = false); WXWidget GetHandle() const { return m_menuWidget; } bool IsTearOff() const { return (m_style & wxMENU_TEAROFF) != 0; } + void DestroyWidgetAndDetach(); public: // Motif-specific data int m_numColumns; @@ -118,12 +108,13 @@ private: // Menu Bar // ---------------------------------------------------------------------------- -class wxMenuBar : public wxMenuBarBase +class WXDLLIMPEXP_CORE wxMenuBar : public wxMenuBarBase { public: wxMenuBar() { Init(); } wxMenuBar(long WXUNUSED(style)) { Init(); } - wxMenuBar(int n, wxMenu *menus[], const wxString titles[]); + wxMenuBar(size_t n, wxMenu *menus[], const wxString titles[], long style = 0); + wxMenuBar(size_t n, wxMenu *menus[], const wxArrayString& titles, long style = 0); virtual ~wxMenuBar(); // implement base class (pure) virtuals @@ -135,12 +126,12 @@ public: virtual wxMenu *Remove(size_t pos); virtual int FindMenuItem(const wxString& menuString, - const wxString& itemString) const; + const wxString& itemString) const; virtual wxMenuItem* FindItem( int id, wxMenu **menu = NULL ) const; virtual void EnableTop( size_t pos, bool flag ); - virtual void SetLabelTop( size_t pos, const wxString& label ); - virtual wxString GetLabelTop( size_t pos ) const; + virtual void SetMenuLabel( size_t pos, const wxString& label ); + virtual wxString GetMenuLabel( size_t pos ) const; // implementation only from now on // ------------------------------- @@ -163,7 +154,7 @@ public: virtual bool SetBackgroundColour(const wxColour& colour); virtual bool SetForegroundColour(const wxColour& colour); virtual bool SetFont(const wxFont& colour); - void ChangeFont(bool keepOriginalSize = FALSE); + void ChangeFont(bool keepOriginalSize = false); public: // common part of all ctors