From: Václav Slavík <vslavik@fastmail.fm> Date: Tue, 5 May 2009 18:23:04 +0000 (+0000) Subject: use <bitmapsize> to load bitmaps at the specified size in wxToolBar's XRC handler X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d0f063020e6fb1b1a660952d0844071e0df24324 use <bitmapsize> to load bitmaps at the specified size in wxToolBar's XRC handler git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60522 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/xrc/xh_toolb.h b/include/wx/xrc/xh_toolb.h index a8d853407a..6ba95f7124 100644 --- a/include/wx/xrc/xh_toolb.h +++ b/include/wx/xrc/xh_toolb.h @@ -29,6 +29,7 @@ public: private: bool m_isInside; wxToolBar *m_toolbar; + wxSize m_toolSize; }; #endif // wxUSE_XRC && wxUSE_TOOLBAR diff --git a/src/xrc/xh_toolb.cpp b/src/xrc/xh_toolb.cpp index 2d19946e33..b88c400d3f 100644 --- a/src/xrc/xh_toolb.cpp +++ b/src/xrc/xh_toolb.cpp @@ -123,17 +123,17 @@ wxObject *wxToolBarXmlHandler::DoCreateResource() } } - wxToolBarToolBase * const - tool = m_toolbar->AddTool - ( - GetID(), - GetText(wxT("label")), - GetBitmap(wxT("bitmap"), wxART_TOOLBAR), - GetBitmap(wxT("bitmap2"), wxART_TOOLBAR), - kind, - GetText(wxT("tooltip")), - GetText(wxT("longhelp")) - ); + wxToolBarToolBase * const tool = + m_toolbar->AddTool + ( + GetID(), + GetText(wxT("label")), + GetBitmap(wxT("bitmap"), wxART_TOOLBAR, m_toolSize), + GetBitmap(wxT("bitmap2"), wxART_TOOLBAR, m_toolSize), + kind, + GetText(wxT("tooltip")), + GetText(wxT("longhelp")) + ); if ( GetBool(wxT("disabled")) ) m_toolbar->EnableTool(GetID(), false); @@ -172,9 +172,9 @@ wxObject *wxToolBarXmlHandler::DoCreateResource() GetName()); SetupWindow(toolbar); - wxSize bmpsize = GetSize(wxT("bitmapsize")); - if (!(bmpsize == wxDefaultSize)) - toolbar->SetToolBitmapSize(bmpsize); + m_toolSize = GetSize(wxT("bitmapsize")); + if (!(m_toolSize == wxDefaultSize)) + toolbar->SetToolBitmapSize(m_toolSize); wxSize margins = GetSize(wxT("margins")); if (!(margins == wxDefaultSize)) toolbar->SetMargins(margins.x, margins.y);