added labels support for toolbar controls for wxMac and wxMSW (modified patch 1613603)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-03-18 23:13:18 +00:00
parent 88c23b64c7
commit cdb11cb99e
13 changed files with 235 additions and 105 deletions

View File

@@ -91,7 +91,10 @@ public:
: wxTOOL_STYLE_BUTTON;
}
wxToolBarToolBase(wxToolBarBase *tbar, wxControl *control)
wxToolBarToolBase(wxToolBarBase *tbar,
wxControl *control,
const wxString& label)
: m_label(label)
{
m_tbar = tbar;
m_control = control;
@@ -316,13 +319,17 @@ public:
virtual wxToolBarToolBase *AddTool (wxToolBarToolBase *tool);
virtual wxToolBarToolBase *InsertTool (size_t pos, wxToolBarToolBase *tool);
// add an arbitrary control to the toolbar (notice that
// the control will be deleted by the toolbar and that it will also adjust
// its position/size)
// add an arbitrary control to the toolbar (notice that the control will be
// deleted by the toolbar and that it will also adjust its position/size)
//
// the label is optional and, if specified, will be shown near the control
// NB: the control should have toolbar as its parent
virtual wxToolBarToolBase *AddControl(wxControl *control);
virtual wxToolBarToolBase *InsertControl(size_t pos, wxControl *control);
virtual wxToolBarToolBase *
AddControl(wxControl *control, const wxString& label = wxEmptyString);
virtual wxToolBarToolBase *
InsertControl(size_t pos, wxControl *control,
const wxString& label = wxEmptyString);
// get the control with the given id or return NULL
virtual wxControl *FindControl( int toolid );
@@ -565,7 +572,8 @@ protected:
const wxString& shortHelp,
const wxString& longHelp) = 0;
virtual wxToolBarToolBase *CreateTool(wxControl *control) = 0;
virtual wxToolBarToolBase *CreateTool(wxControl *control,
const wxString& label) = 0;
// helper functions
// ----------------