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
This commit is contained in:
Václav Slavík 2009-05-05 18:23:04 +00:00
parent 5f3dc0f0a9
commit d0f063020e
2 changed files with 15 additions and 14 deletions

View File

@ -29,6 +29,7 @@ public:
private:
bool m_isInside;
wxToolBar *m_toolbar;
wxSize m_toolSize;
};
#endif // wxUSE_XRC && wxUSE_TOOLBAR

View 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);