X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c626a8b797d2819e1e14110d77c04a530fd3b6b4..e9e3e3abaf8fb32ad82c6882b9af684e0430f881:/include/wx/gtk/menu.h diff --git a/include/wx/gtk/menu.h b/include/wx/gtk/menu.h index e68ca22360..8d6f68db7e 100644 --- a/include/wx/gtk/menu.h +++ b/include/wx/gtk/menu.h @@ -48,6 +48,7 @@ public: wxMenuBar(); wxMenuBar(long style); wxMenuBar(int n, wxMenu *menus[], const wxString titles[]); + ~wxMenuBar(); // menubar construction void Append( wxMenu *menu, const wxString &title ); @@ -67,8 +68,9 @@ public: void Enable( int id, bool enable ); bool IsEnabled( int id ) const; - wxString GetLabel( int id ) const; void SetLabel( int id, const wxString &label ); + wxString GetLabel( int id ) const; + wxString GetLabel() const { return wxWindow::GetLabel(); } void EnableTop( int pos, bool flag ); void SetLabelTop( int pos, const wxString& label ); @@ -88,12 +90,18 @@ public: wxMenuItem* FindMenuItemById( int id ) const { return FindItem(id); } #endif // WXWIN_COMPATIBILITY - // implementation + // implementation only wxList& GetMenus() { return m_menus; } -protected: - wxList m_menus; - GtkWidget *m_menubar; + void SetInvokingWindow( wxWindow *win ); + void UnsetInvokingWindow( wxWindow *win ); + + GtkAccelGroup *m_accel; + GtkItemFactory *m_factory; + wxList m_menus; + GtkWidget *m_menubar; + long m_style; + wxWindow *m_invokingWindow; }; //----------------------------------------------------------------------------- @@ -105,9 +113,20 @@ class wxMenu : public wxEvtHandler DECLARE_DYNAMIC_CLASS(wxMenu) public: - // construction - wxMenu( const wxString& title = wxEmptyString, - const wxFunction func = (wxFunction) NULL ); + wxMenu( const wxString& title, const wxFunction func) + { + Init(title, 0, func); + } + wxMenu( long style ) + { + Init( wxEmptyString, style ); + } + wxMenu( const wxString& title = wxEmptyString, long style = 0 ) + { + Init(title, style); + } + + ~wxMenu(); // operations // title @@ -156,13 +175,16 @@ public: wxMenuItem *FindItemForId( int id ) const { return FindItem( id ); } -#ifdef WXWIN_COMPATIBILITY wxFunction GetCallback() const { return m_callback; } void Callback(const wxFunction func) { m_callback = func; } + wxFunction m_callback; + +#ifdef WXWIN_COMPATIBILITY // compatibility: these functions are deprecated bool Enabled(int id) const { return IsEnabled(id); } bool Checked(int id) const { return IsChecked(id); } + #endif // WXWIN_COMPATIBILITY // implementation @@ -170,17 +192,27 @@ public: void SetInvokingWindow( wxWindow *win ); wxWindow *GetInvokingWindow(); - // implementation only - GtkWidget *m_menu; // GtkMenu - GtkWidget *m_owner; + // implementation GTK only + GtkWidget *m_menu; // GtkMenu + GtkWidget *m_owner; + GtkAccelGroup *m_accel; + GtkItemFactory *m_factory; + + // used by wxMenuBar + long GetStyle(void) const { return m_style; } private: + // common code for both constructors: + void Init( const wxString& title, + long style, + const wxFunction func = (wxFunction) NULL ); + wxString m_title; wxList m_items; wxWindow *m_invokingWindow; - wxFunction m_callback; wxEvtHandler *m_eventHandler; void *m_clientData; + long m_style; }; #endif // __GTKMENUH__