Allow toolbar tools to be created in checked (or toggled) state in XRC, just
as the menu items can already be created checked.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69487
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- Allow converting to and from wxGraphicsBitmap and wxImage directly.
- Allow wxGraphicsFont creation without passing by wxFont.
- Added wxDataViewCustomRenderer::ActivateCell().
+- Add "checked" property for toolbar tool elements in XRC.
OSX:
Help text shown in statusbar when the mouse is on the tool (default: none).}
@row3col{disabled, @ref overview_xrcformat_type_bool,
Is the tool initially disabled (default: 0)?}
+@row3col{checked, @ref overview_xrcformat_type_bool,
+ Is the tool initially checked (default: 0)? (only available since wxWidgets 2.9.3)}
@endTable
The presence of a @c dropdown property indicates that the tool is of type
kind = wxITEM_CHECK;
}
+
#if wxUSE_MENUS
// check whether we have dropdown tag inside
wxMenu *menu = NULL; // menu for drop down items
if ( GetBool(wxT("disabled")) )
m_toolbar->EnableTool(GetID(), false);
+
+ if ( GetBool(wxS("checked")) )
+ {
+ if ( kind == wxITEM_NORMAL )
+ {
+ ReportParamError
+ (
+ "checked",
+ "only <radio> nor <toggle> tools can be checked"
+ );
+ }
+ else
+ {
+ m_toolbar->ToggleTool(GetID(), true);
+ }
+ }
+
#if wxUSE_MENUS
if ( menu )
tool->SetDropdownMenu(menu);