: 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;
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 );
// get/set the size of the bitmaps used by the toolbar: should be called
// before adding any tools to the toolbar
virtual void SetToolBitmapSize(const wxSize& size)
- { m_defaultWidth = size.x; m_defaultHeight = size.y; };
+ { m_defaultWidth = size.x; m_defaultHeight = size.y; }
virtual wxSize GetToolBitmapSize() const
{ return wxSize(m_defaultWidth, m_defaultHeight); }
// the button size in some implementations is bigger than the bitmap size:
// get the total button size (by default the same as bitmap size)
virtual wxSize GetToolSize() const
- { return GetToolBitmapSize(); } ;
+ { return GetToolBitmapSize(); }
// returns a (non separator) tool containing the point (x, y) or NULL if
// there is no tool at this point (corrdinates are client)
const wxString& shortHelp,
const wxString& longHelp) = 0;
- virtual wxToolBarToolBase *CreateTool(wxControl *control) = 0;
+ virtual wxToolBarToolBase *CreateTool(wxControl *control,
+ const wxString& label) = 0;
// helper functions
// ----------------