+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');
}
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,
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
}