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:
@@ -6,7 +6,7 @@
|
||||
// Created: 2006-04-13
|
||||
// Id: $Id$
|
||||
// Copyright: (c) Julian Smart, Robert Roebling, Vadim Zeitlin,
|
||||
// SciTech Software, Inc.
|
||||
// SciTech Software, Inc.
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -23,7 +23,7 @@ class WXDLLEXPORT wxButtonToolBarTool;
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxButtonToolBar : public wxToolBarBase
|
||||
{
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
wxButtonToolBar() { Init(); }
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxToolBarNameStr );
|
||||
|
||||
|
||||
virtual ~wxButtonToolBar();
|
||||
|
||||
virtual bool Realize();
|
||||
@@ -73,7 +73,8 @@ protected:
|
||||
wxObject *clientData,
|
||||
const wxString& shortHelp,
|
||||
const wxString& longHelp);
|
||||
virtual wxToolBarToolBase *CreateTool(wxControl *control);
|
||||
virtual wxToolBarToolBase *CreateTool(wxControl *control,
|
||||
const wxString& label);
|
||||
|
||||
virtual wxSize DoGetBestClientSize() const;
|
||||
|
||||
|
||||
@@ -93,7 +93,8 @@ protected:
|
||||
wxObject *clientData,
|
||||
const wxString& shortHelp,
|
||||
const wxString& longHelp);
|
||||
virtual wxToolBarToolBase *CreateTool(wxControl *control);
|
||||
virtual wxToolBarToolBase *CreateTool(wxControl *control,
|
||||
const wxString& label);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
#if wxMAC_USE_NATIVE_TOOLBAR
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
|
||||
virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap);
|
||||
virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap);
|
||||
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
@@ -104,7 +104,9 @@ protected:
|
||||
wxObject *clientData,
|
||||
const wxString& shortHelp,
|
||||
const wxString& longHelp);
|
||||
virtual wxToolBarToolBase *CreateTool(wxControl *control);
|
||||
|
||||
virtual wxToolBarToolBase *CreateTool(wxControl *control,
|
||||
const wxString& label);
|
||||
|
||||
// return the appropriate size and flags for the toolbar control
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
@@ -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
|
||||
// ----------------
|
||||
|
||||
@@ -98,7 +98,8 @@ protected:
|
||||
wxObject *clientData,
|
||||
const wxString& shortHelp,
|
||||
const wxString& longHelp);
|
||||
virtual wxToolBarToolBase *CreateTool(wxControl *control);
|
||||
virtual wxToolBarToolBase *CreateTool(wxControl *control,
|
||||
const wxString& label);
|
||||
|
||||
virtual wxSize DoGetBestClientSize() const;
|
||||
virtual void DoSetSize(int x, int y,
|
||||
|
||||
Reference in New Issue
Block a user