]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_toolb.cpp
new file added
[wxWidgets.git] / src / xrc / xh_toolb.cpp
index bfe713d9ae5678a9524be458a53b14abefd10689..c6e75a361554b42b62197ee08c4ecbc28cf2ecda 100644 (file)
@@ -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 <radio> nor <toggle> 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
     }