X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/170acdc90e9f92f8b8120fa6c04acdbf45c89582..c7ea5a0c7edbdb777640e2613bfaac5f649b3340:/src/generic/buttonbar.cpp diff --git a/src/generic/buttonbar.cpp b/src/generic/buttonbar.cpp index 343e7e585a..a2529b0091 100644 --- a/src/generic/buttonbar.cpp +++ b/src/generic/buttonbar.cpp @@ -4,7 +4,6 @@ // Author: Julian Smart, after Robert Roebling, Vadim Zeitlin, SciTech // Modified by: // Created: 2006-04-13 -// Id: $Id$ // Copyright: (c) Julian Smart, Robert Roebling, Vadim Zeitlin, // SciTech Software, Inc. // Licence: wxWindows licence @@ -66,8 +65,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 = @@ -138,7 +139,10 @@ bool wxButtonToolBar::Create(wxWindow *parent, // wxColour lightBackground(244, 244, 244); - wxFont font(wxSMALL_FONT->GetPointSize(), wxNORMAL_FONT->GetFamily(), wxNORMAL_FONT->GetStyle(), wxNORMAL); + wxFont font(wxSMALL_FONT->GetPointSize(), + wxNORMAL_FONT->GetFamily(), + wxNORMAL_FONT->GetStyle(), + wxFONTWEIGHT_NORMAL); SetFont(font); // Calculate the label height if necessary @@ -205,7 +209,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 +228,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 +275,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 +291,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 ) @@ -490,7 +495,7 @@ void wxButtonToolBar::OnCommand(wxCommandEvent& event) } // paints a border -void wxButtonToolBar::OnPaint(wxPaintEvent& event) +void wxButtonToolBar::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); @@ -544,9 +549,9 @@ void wxButtonToolBar::OnLeftUp(wxMouseEvent& event) wxButtonToolBarTool* tool = (wxButtonToolBarTool*) FindToolForPosition(event.GetX(), event.GetY()); if (tool && tool->GetButton() && (event.GetY() > (tool->m_y + tool->GetButton()->GetSize().y))) { - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, tool->GetId()); + wxCommandEvent event(wxEVT_BUTTON, tool->GetId()); event.SetEventObject(tool->GetButton()); - if (!ProcessEvent(event)) + if (!GetEventHandler()->ProcessEvent(event)) event.Skip(); } }