don't use deprecated wxToolBar::AddTool() overload taking position parameters which don't do anything anyhow
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -55,40 +55,26 @@ wxObject *wxToolBarXmlHandler::DoCreateResource()
|
|||||||
{
|
{
|
||||||
wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XRC resource: tool not within a toolbar!"));
|
wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XRC resource: tool not within a toolbar!"));
|
||||||
|
|
||||||
if (GetPosition() != wxDefaultPosition)
|
wxItemKind kind = wxITEM_NORMAL;
|
||||||
|
if (GetBool(wxT("radio")))
|
||||||
|
kind = wxITEM_RADIO;
|
||||||
|
if (GetBool(wxT("toggle")))
|
||||||
{
|
{
|
||||||
m_toolbar->AddTool(GetID(),
|
wxASSERT_MSG( kind == wxITEM_NORMAL,
|
||||||
GetBitmap(wxT("bitmap"), wxART_TOOLBAR),
|
_T("can't have both toggle and radio button at once") );
|
||||||
GetBitmap(wxT("bitmap2"), wxART_TOOLBAR),
|
kind = wxITEM_CHECK;
|
||||||
GetBool(wxT("toggle")),
|
|
||||||
GetPosition().x,
|
|
||||||
GetPosition().y,
|
|
||||||
NULL,
|
|
||||||
GetText(wxT("tooltip")),
|
|
||||||
GetText(wxT("longhelp")));
|
|
||||||
}
|
}
|
||||||
else
|
m_toolbar->AddTool(GetID(),
|
||||||
{
|
GetText(wxT("label")),
|
||||||
wxItemKind kind = wxITEM_NORMAL;
|
GetBitmap(wxT("bitmap"), wxART_TOOLBAR),
|
||||||
if (GetBool(wxT("radio")))
|
GetBitmap(wxT("bitmap2"), wxART_TOOLBAR),
|
||||||
kind = wxITEM_RADIO;
|
kind,
|
||||||
if (GetBool(wxT("toggle")))
|
GetText(wxT("tooltip")),
|
||||||
{
|
GetText(wxT("longhelp")));
|
||||||
wxASSERT_MSG( kind == wxITEM_NORMAL,
|
|
||||||
_T("can't have both toggle and radio button at once") );
|
if ( GetBool(wxT("disabled")) )
|
||||||
kind = wxITEM_CHECK;
|
m_toolbar->EnableTool(GetID(), false);
|
||||||
}
|
|
||||||
m_toolbar->AddTool(GetID(),
|
|
||||||
GetText(wxT("label")),
|
|
||||||
GetBitmap(wxT("bitmap"), wxART_TOOLBAR),
|
|
||||||
GetBitmap(wxT("bitmap2"), wxART_TOOLBAR),
|
|
||||||
kind,
|
|
||||||
GetText(wxT("tooltip")),
|
|
||||||
GetText(wxT("longhelp")));
|
|
||||||
|
|
||||||
if ( GetBool(wxT("disabled")) )
|
|
||||||
m_toolbar->EnableTool(GetID(), false);
|
|
||||||
}
|
|
||||||
return m_toolbar; // must return non-NULL
|
return m_toolbar; // must return non-NULL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user