]> git.saurik.com Git - wxWidgets.git/commitdiff
use <bitmapsize> to load bitmaps at the specified size in wxToolBar's XRC handler
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 5 May 2009 18:23:04 +0000 (18:23 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 5 May 2009 18:23:04 +0000 (18:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60522 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/xrc/xh_toolb.h
src/xrc/xh_toolb.cpp

index a8d853407ae4e7c2aeed950cdedbd981ba8eeb52..6ba95f7124fe3fbd08147ff2491c5ba471bf50f9 100644 (file)
@@ -29,6 +29,7 @@ public:
 private:
     bool m_isInside;
     wxToolBar *m_toolbar;
+    wxSize m_toolSize;
 };
 
 #endif // wxUSE_XRC && wxUSE_TOOLBAR
index 2d19946e33629aff22f7e99cfe29d7da3cab7045..b88c400d3fa8c4f814f5bf0bb5a3d7eef42e9008 100644 (file)
@@ -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);