git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64854
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
virtual void Detach() { m_tbar = NULL; }
virtual void Attach(wxToolBarBase *tbar) { m_tbar = tbar; }
virtual void Detach() { m_tbar = NULL; }
virtual void Attach(wxToolBarBase *tbar) { m_tbar = tbar; }
// these methods are only for tools of wxITEM_DROPDOWN kind (but even such
// tools can have a NULL associated menu)
virtual void SetDropdownMenu(wxMenu *menu);
wxMenu *GetDropdownMenu() const { return m_dropdownMenu; }
// these methods are only for tools of wxITEM_DROPDOWN kind (but even such
// tools can have a NULL associated menu)
virtual void SetDropdownMenu(wxMenu *menu);
wxMenu *GetDropdownMenu() const { return m_dropdownMenu; }
protected:
// common part of all ctors
protected:
// common part of all ctors
m_toggled = false;
m_enabled = true;
m_toggled = false;
m_enabled = true;
}
wxToolBarBase *m_tbar; // the toolbar to which we belong (may be NULL)
}
wxToolBarBase *m_tbar; // the toolbar to which we belong (may be NULL)
wxString m_shortHelpString;
wxString m_longHelpString;
wxString m_shortHelpString;
wxString m_longHelpString;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxToolBarToolBase)
};
DECLARE_DYNAMIC_CLASS_NO_COPY(wxToolBarToolBase)
};
// don't want toolbars to accept the focus
virtual bool AcceptsFocus() const { return false; }
// don't want toolbars to accept the focus
virtual bool AcceptsFocus() const { return false; }
// Set dropdown menu
bool SetDropdownMenu(int toolid, wxMenu *menu);
// Set dropdown menu
bool SetDropdownMenu(int toolid, wxMenu *menu);
protected:
// to implement in derived classes
protected:
// to implement in derived classes
wxToolBarToolBase::~wxToolBarToolBase()
{
wxToolBarToolBase::~wxToolBarToolBase()
{
if ( IsControl() )
GetControl()->Destroy();
}
if ( IsControl() )
GetControl()->Destroy();
}
void wxToolBarToolBase::SetDropdownMenu(wxMenu* menu)
{
delete m_dropdownMenu;
m_dropdownMenu = menu;
}
void wxToolBarToolBase::SetDropdownMenu(wxMenu* menu)
{
delete m_dropdownMenu;
m_dropdownMenu = menu;
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
bool wxToolBarBase::SetDropdownMenu(int toolid, wxMenu* menu)
{
wxToolBarToolBase * const tool = FindById(toolid);
bool wxToolBarBase::SetDropdownMenu(int toolid, wxMenu* menu)
{
wxToolBarToolBase * const tool = FindById(toolid);
#if WXWIN_COMPATIBILITY_2_8
#if WXWIN_COMPATIBILITY_2_8