X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..9a62fa17b1c342b5b1e1bb9b96373e170a9d8b6f:/include/wx/xrc/xmlres.h diff --git a/include/wx/xrc/xmlres.h b/include/wx/xrc/xmlres.h index c253b6cdee..2644c6e86a 100644 --- a/include/wx/xrc/xmlres.h +++ b/include/wx/xrc/xmlres.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: xmlres.h +// Name: wx/xrc/xmlres.h // Purpose: XML resources // Author: Vaclav Slavik // Created: 2000/03/05 @@ -24,6 +24,7 @@ #include "wx/bitmap.h" #include "wx/icon.h" #include "wx/artprov.h" +#include "wx/colour.h" #include "wx/xml/xml.h" @@ -68,12 +69,18 @@ class wxXmlResourceModule; 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 }; @@ -120,10 +127,8 @@ public: // This method understands VFS (see filesys.h). bool Load(const wxString& filemask); -#if wxABI_VERSION > 20601 // Unload resource from the given XML file (wildcards not allowed) bool Unload(const wxString& filename); -#endif // wxABI_VERSION // Initialize handlers for all supported controls/windows. This will // make the executable quite big because it forces linking against @@ -207,10 +212,13 @@ public: 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; } @@ -251,7 +259,6 @@ protected: wxObject *instance = NULL, wxXmlResourceHandler *handlerToUse = NULL); -#if wxABI_VERSION > 20601 // Helper of Load() and Unload(): returns the URL corresponding to the // given file if it's indeed a file, otherwise returns the original string // unmodified @@ -263,8 +270,6 @@ protected: static bool IsArchive(const wxString& filename); #endif // wxUSE_FILESYSTEM -#endif // wxABI_VERSION - private: long m_version; @@ -360,8 +365,7 @@ protected: // Returns true if the node has a property class equal to classname, // e.g. . - 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, content is represented as @@ -412,7 +416,7 @@ protected: 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"),