- wxASSERT_MSG( kind == wxITEM_NORMAL,
- _T("can't have both toggleable and radion button at once") );
- kind = wxITEM_CHECK;
+ wxLogWarning(_("XRC syntax error: drop-down tool can't have "
+ "neither \"radio\" nor \"toggle\" properties, "
+ "ignoring them."));
+ }
+
+ kind = wxITEM_DROPDOWN;
+
+ // also check for the menu specified inside dropdown (it is
+ // optional and may be absent for e.g. dynamically-created
+ // menus)
+ wxXmlNode * const nodeMenu = nodeDropdown->GetChildren();
+ if ( nodeMenu )
+ {
+ wxObject *res = CreateResFromNode(nodeMenu, NULL);
+ menu = wxDynamicCast(res, wxMenu);
+ if ( !menu )
+ {
+ wxLogError(_("XRC syntax error: invalid drop-down tool "
+ "contents (expected a menu)."));
+ }
+
+ if ( nodeMenu->GetNext() )
+ {
+ wxLogWarning(_("XRC syntax error: unexpected extra "
+ "contents under drop-down tool."));
+ }