]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xmlres.cpp
added test for Replace(whatever, "")
[wxWidgets.git] / src / xrc / xmlres.cpp
index 87fa82e3c2ef68c7019921f902fcff2eafa01ea2..3a6cbefc6bf3d4b5e31e428c9a3a51d7e9675076 100644 (file)
@@ -1031,13 +1031,17 @@ wxString wxXmlResourceHandler::GetName()
 
 
 
+bool wxXmlResourceHandler::GetBoolAttr(const wxString& attr, bool defaultv)
+{
+    wxString v;
+    return m_node->GetAttribute(attr, &v) ? v == '1' : defaultv;
+}
+
 bool wxXmlResourceHandler::GetBool(const wxString& param, bool defaultv)
 {
-    wxString v = GetParamValue(param);
-    v.MakeLower();
-    if (!v) return defaultv;
+    const wxString v = GetParamValue(param);
 
-    return (v == wxT("1"));
+    return v.empty() ? defaultv : (v == '1');
 }
 
 
@@ -1170,40 +1174,6 @@ wxBitmap wxXmlResourceHandler::GetBitmap(const wxString& param,
     return wxBitmap(img);
 }
 
-#if wxUSE_ANIMATIONCTRL
-wxAnimation wxXmlResourceHandler::GetAnimation(const wxString& param)
-{
-    wxAnimation ani;
-
-    /* load the animation from file: */
-    wxString name = GetParamValue(param);
-    if (name.empty()) return wxNullAnimation;
-#if wxUSE_FILESYSTEM
-    wxFSFile *fsfile = GetCurFileSystem().OpenFile(name, wxFS_READ | wxFS_SEEKABLE);
-    if (fsfile == NULL)
-    {
-        wxLogError(_("XRC resource: Cannot create animation from '%s'."),
-                   name.c_str());
-        return wxNullAnimation;
-    }
-    ani.Load(*(fsfile->GetStream()));
-    delete fsfile;
-#else
-    ani.LoadFile(name);
-#endif
-
-    if (!ani.IsOk())
-    {
-        wxLogError(_("XRC resource: Cannot create animation from '%s'."),
-                   name.c_str());
-        return wxNullAnimation;
-    }
-
-    return ani;
-}
-#endif      // wxUSE_ANIMATIONCTRL
-
-
 
 wxIcon wxXmlResourceHandler::GetIcon(const wxString& param,
                                      const wxArtClient& defaultArtClient,
@@ -1784,6 +1754,24 @@ static void AddStdXRCID_Records()
     stdID(wxID_MAXIMIZE_FRAME);
     stdID(wxID_ICONIZE_FRAME);
     stdID(wxID_RESTORE_FRAME);
+    stdID(wxID_CDROM);
+    stdID(wxID_CONVERT);
+    stdID(wxID_EXECUTE);
+    stdID(wxID_FLOPPY);
+    stdID(wxID_HARDDISK);
+    stdID(wxID_BOTTOM);
+    stdID(wxID_FIRST);
+    stdID(wxID_LAST);
+    stdID(wxID_TOP);
+    stdID(wxID_INFO);
+    stdID(wxID_JUMP_TO);
+    stdID(wxID_NETWORK);
+    stdID(wxID_SELECT_COLOR);
+    stdID(wxID_SELECT_FONT);
+    stdID(wxID_SORT_ASCENDING);
+    stdID(wxID_SORT_DESCENDING);
+    stdID(wxID_SPELL_CHECK);
+    stdID(wxID_STRIKETHROUGH);
 
 #undef stdID
 }