return NULL;
}
- if ( !node.GetChildren() )
+ const bool hasOnlyRefAttr = node.GetAttributes() != NULL &&
+ node.GetAttributes()->GetNext() == NULL;
+
+ if ( hasOnlyRefAttr && !node.GetChildren() )
{
// In the typical, simple case, <object_ref> is used to link
// to another node and doesn't have any content of its own that
// the colour doesn't use #RRGGBB format, check if it is symbolic
// colour name:
clr = GetSystemColour(v);
- if (clr.Ok())
+ if (clr.IsOk())
return clr;
ReportParamError
art_id, art_client) )
{
wxBitmap stockArt(wxArtProvider::GetBitmap(art_id, art_client, size));
- if ( stockArt.Ok() )
+ if ( stockArt.IsOk() )
return stockArt;
}
wxImage img(name);
#endif
- if (!img.Ok())
+ if (!img.IsOk())
{
ReportParamError
(
{
if (n->GetType() == wxXML_ELEMENT_NODE && n->GetName() == parambitmap)
{
- wxIcon icon = GetIcon(n);
+ wxIcon icon = GetIcon(n, wxART_OTHER, size);
if ( !imagelist )
{
// We need the real image list size to create it.
return sx;
}
+wxDirection
+wxXmlResourceHandler::GetDirection(const wxString& param, wxDirection dirDefault)
+{
+ wxDirection dir;
+
+ const wxString dirstr = GetParamValue(param);
+ if ( dirstr.empty() )
+ dir = dirDefault;
+ else if ( dirstr == "wxLEFT" )
+ dir = wxLEFT;
+ else if ( dirstr == "wxRIGHT" )
+ dir = wxRIGHT;
+ else if ( dirstr == "wxTOP" )
+ dir = wxTOP;
+ else if ( dirstr == "wxBOTTOM" )
+ dir = wxBOTTOM;
+ else
+ {
+ ReportError
+ (
+ GetParamNode(param),
+ wxString::Format
+ (
+ "Invalid direction \"%s\": must be one of "
+ "wxLEFT|wxRIGHT|wxTOP|wxBOTTOM.",
+ dirstr
+ )
+ );
+
+ dir = dirDefault;
+ }
+
+ return dir;
+}
// Get system font index using indexname
static wxFont GetSystemFont(const wxString& name)
// is this font based on a system font?
wxFont font = GetSystemFont(GetParamValue(wxT("sysfont")));
- if (font.Ok())
+ if (font.IsOk())
{
if (hasSize && isize != -1)
font.SetPointSize(isize);