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:
@@ -29,6 +29,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool m_isInside;
|
bool m_isInside;
|
||||||
wxToolBar *m_toolbar;
|
wxToolBar *m_toolbar;
|
||||||
|
wxSize m_toolSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // wxUSE_XRC && wxUSE_TOOLBAR
|
#endif // wxUSE_XRC && wxUSE_TOOLBAR
|
||||||
|
@@ -123,17 +123,17 @@ wxObject *wxToolBarXmlHandler::DoCreateResource()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxToolBarToolBase * const
|
wxToolBarToolBase * const tool =
|
||||||
tool = m_toolbar->AddTool
|
m_toolbar->AddTool
|
||||||
(
|
(
|
||||||
GetID(),
|
GetID(),
|
||||||
GetText(wxT("label")),
|
GetText(wxT("label")),
|
||||||
GetBitmap(wxT("bitmap"), wxART_TOOLBAR),
|
GetBitmap(wxT("bitmap"), wxART_TOOLBAR, m_toolSize),
|
||||||
GetBitmap(wxT("bitmap2"), wxART_TOOLBAR),
|
GetBitmap(wxT("bitmap2"), wxART_TOOLBAR, m_toolSize),
|
||||||
kind,
|
kind,
|
||||||
GetText(wxT("tooltip")),
|
GetText(wxT("tooltip")),
|
||||||
GetText(wxT("longhelp"))
|
GetText(wxT("longhelp"))
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( GetBool(wxT("disabled")) )
|
if ( GetBool(wxT("disabled")) )
|
||||||
m_toolbar->EnableTool(GetID(), false);
|
m_toolbar->EnableTool(GetID(), false);
|
||||||
@@ -172,9 +172,9 @@ wxObject *wxToolBarXmlHandler::DoCreateResource()
|
|||||||
GetName());
|
GetName());
|
||||||
SetupWindow(toolbar);
|
SetupWindow(toolbar);
|
||||||
|
|
||||||
wxSize bmpsize = GetSize(wxT("bitmapsize"));
|
m_toolSize = GetSize(wxT("bitmapsize"));
|
||||||
if (!(bmpsize == wxDefaultSize))
|
if (!(m_toolSize == wxDefaultSize))
|
||||||
toolbar->SetToolBitmapSize(bmpsize);
|
toolbar->SetToolBitmapSize(m_toolSize);
|
||||||
wxSize margins = GetSize(wxT("margins"));
|
wxSize margins = GetSize(wxT("margins"));
|
||||||
if (!(margins == wxDefaultSize))
|
if (!(margins == wxDefaultSize))
|
||||||
toolbar->SetMargins(margins.x, margins.y);
|
toolbar->SetMargins(margins.x, margins.y);
|
||||||
|
Reference in New Issue
Block a user