X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/155ecd4c4221d3bbc7aa93d472d11948f21d21ab..853149575e6cb46031b3ed06f3d0fa4c42440962:/src/generic/buttonbar.cpp diff --git a/src/generic/buttonbar.cpp b/src/generic/buttonbar.cpp index e56e4ddce2..cf9e0ba75b 100644 --- a/src/generic/buttonbar.cpp +++ b/src/generic/buttonbar.cpp @@ -66,8 +66,10 @@ public: m_button = NULL; } - wxButtonToolBarTool(wxButtonToolBar *tbar, wxControl *control) - : wxToolBarToolBase(tbar, control) + wxButtonToolBarTool(wxButtonToolBar *tbar, + wxControl *control, + const wxString& label) + : wxToolBarToolBase(tbar, control, label) { m_x = m_y = wxDefaultCoord; m_width = @@ -205,7 +207,7 @@ void wxButtonToolBar::GetRectLimits(const wxRect& rect, wxCoord *start, wxCoord *end) const { - wxCHECK_RET( start && end, _T("NULL pointer in GetRectLimits") ); + wxCHECK_RET( start && end, wxT("NULL pointer in GetRectLimits") ); if ( IsVertical() ) { @@ -224,7 +226,7 @@ void wxButtonToolBar::SetToolShortHelp(int id, const wxString& help) { wxToolBarToolBase *tool = FindById(id); - wxCHECK_RET( tool, _T("SetToolShortHelp: no such tool") ); + wxCHECK_RET( tool, wxT("SetToolShortHelp: no such tool") ); // TODO: set tooltip/short help tool->SetShortHelp(help); @@ -271,9 +273,10 @@ wxToolBarToolBase *wxButtonToolBar::CreateTool(int id, clientData, shortHelp, longHelp); } -wxToolBarToolBase *wxButtonToolBar::CreateTool(wxControl *control) +wxToolBarToolBase *wxButtonToolBar::CreateTool(wxControl *control, + const wxString& label) { - return new wxButtonToolBarTool(this, control); + return new wxButtonToolBarTool(this, control, label); } // ---------------------------------------------------------------------------- @@ -286,7 +289,7 @@ wxRect wxButtonToolBar::GetToolRect(wxToolBarToolBase *toolBase) const wxRect rect; - wxCHECK_MSG( tool, rect, _T("GetToolRect: NULL tool") ); + wxCHECK_MSG( tool, rect, wxT("GetToolRect: NULL tool") ); // ensure that we always have the valid tool position if ( m_needsLayout ) @@ -351,7 +354,7 @@ bool wxButtonToolBar::Realize() m_needsLayout = true; DoLayout(); - SetBestSize(wxSize(m_maxWidth, m_maxHeight)); + SetInitialSize(wxSize(m_maxWidth, m_maxHeight)); return true; } @@ -490,7 +493,7 @@ void wxButtonToolBar::OnCommand(wxCommandEvent& event) } // paints a border -void wxButtonToolBar::OnPaint(wxPaintEvent& event) +void wxButtonToolBar::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); @@ -546,7 +549,7 @@ void wxButtonToolBar::OnLeftUp(wxMouseEvent& event) { wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, tool->GetId()); event.SetEventObject(tool->GetButton()); - if (!ProcessEvent(event)) + if (!GetEventHandler()->ProcessEvent(event)) event.Skip(); } }