/////////////////////////////////////////////////////////////////////////////
-// Name: xmlres.h
+// Name: wx/xrc/xmlres.h
// Purpose: XML resources
// Author: Vaclav Slavik
// Created: 2000/03/05
#ifndef _WX_XMLRES_H_
#define _WX_XMLRES_H_
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma interface "xmlres.h"
-#endif
-
#include "wx/defs.h"
#if wxUSE_XRC
#include "wx/bitmap.h"
#include "wx/icon.h"
#include "wx/artprov.h"
+#include "wx/colour.h"
#include "wx/xml/xml.h"
class WXDLLIMPEXP_XRC wxXmlResourceDataRecord
{
public:
- wxXmlResourceDataRecord() : Doc(NULL), Time(wxDateTime::Now()) {}
+ wxXmlResourceDataRecord() : Doc(NULL) {
+#if wxUSE_DATETIME
+ Time = wxDateTime::Now();
+#endif
+ }
~wxXmlResourceDataRecord() {delete Doc;}
wxString File;
wxXmlDocument *Doc;
+#if wxUSE_DATETIME
wxDateTime Time;
+#endif
};
bool AttachUnknownControl(const wxString& name, wxWindow *control,
wxWindow *parent = NULL);
- // Returns a numeric ID that is equivalent to the string id used in an XML
- // resource. To be used in event tables.
- // Macro XRCID is provided for convenience
- static int GetXRCID(const wxChar *str_id);
+ // Returns a numeric ID that is equivalent to the string ID used in an XML
+ // resource. If an unknown str_id is requested (i.e. other than wxID_XXX
+ // or integer), a new record is created which associates the given string
+ // with a number. If value_if_not_found == wxID_NONE, the number is obtained via
+ // wxNewId(). Otherwise value_if_not_found is used.
+ // Macro XRCID(name) is provided for convenient use in event tables.
+ static int GetXRCID(const wxChar *str_id, int value_if_not_found = wxID_NONE);
// Returns version information (a.b.c.d = d+ 256*c + 256^2*b + 256^3*a).
long GetVersion() const { return m_version; }
// Returns true if the node has a property class equal to classname,
// e.g. <object class="wxDialog">.
- bool IsOfClass(wxXmlNode *node, const wxString& classname)
- { return node->GetPropVal(wxT("class"), wxEmptyString) == classname; }
+ bool IsOfClass(wxXmlNode *node, const wxString& classname);
// Gets node content from wxXML_ENTITY_NODE
// The problem is, <tag>content<tag> is represented as
float GetFloat(const wxString& param, float defaultv = 0);
// Gets colour in HTML syntax (#RRGGBB).
- wxColour GetColour(const wxString& param);
+ wxColour GetColour(const wxString& param, const wxColour& defaultv = wxNullColour);
// Gets the size (may be in dialog units).
wxSize GetSize(const wxString& param = wxT("size"),