X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5852e62f1fe76907832ba2c7f2b4099635e44c4b..30ee0b97649f598955abd267e5b1595f2a79415f:/src/xrc/xh_toolb.cpp diff --git a/src/xrc/xh_toolb.cpp b/src/xrc/xh_toolb.cpp index bfe713d9ae..c6e75a3615 100644 --- a/src/xrc/xh_toolb.cpp +++ b/src/xrc/xh_toolb.cpp @@ -78,6 +78,7 @@ wxObject *wxToolBarXmlHandler::DoCreateResource() kind = wxITEM_CHECK; } + #if wxUSE_MENUS // check whether we have dropdown tag inside wxMenu *menu = NULL; // menu for drop down items @@ -137,11 +138,28 @@ wxObject *wxToolBarXmlHandler::DoCreateResource() if ( GetBool(wxT("disabled")) ) m_toolbar->EnableTool(GetID(), false); + + if ( GetBool(wxS("checked")) ) + { + if ( kind == wxITEM_NORMAL ) + { + ReportParamError + ( + "checked", + "only nor tools can be checked" + ); + } + else + { + m_toolbar->ToggleTool(GetID(), true); + } + } + #if wxUSE_MENUS if ( menu ) tool->SetDropdownMenu(menu); #endif - + return m_toolbar; // must return non-NULL }