X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8e4b5265cdd7aeea67c85eb0f50186641f09f7d8..d19ce8c49127a8550a784b4d54464c81003a102b:/include/wx/xrc/xmlres.h?ds=sidebyside diff --git a/include/wx/xrc/xmlres.h b/include/wx/xrc/xmlres.h index b2a2d2f3bc..7d29dd260d 100644 --- a/include/wx/xrc/xmlres.h +++ b/include/wx/xrc/xmlres.h @@ -17,6 +17,7 @@ #include "wx/string.h" #include "wx/dynarray.h" +#include "wx/arrstr.h" #include "wx/datetime.h" #include "wx/list.h" #include "wx/gdicmn.h" @@ -44,10 +45,6 @@ class wxXmlSubclassFactories; class wxXmlResourceModule; class wxXmlResourceDataRecords; -// make VC++ happy: otherwise it gives warnings when using this type for a -// member of DLL-exported wxXmlResource class in shared builds -template class WXDLLIMPEXP_FWD_XRC wxVector; - // These macros indicate current version of XML resources (this information is // encoded in root node of XRC file as "version" property). // @@ -111,8 +108,6 @@ public: // Destructor. virtual ~wxXmlResource(); - wxXmlNode *GetFirstRoot(); - // Loads resources from XML files that match given filemask. // This method understands VFS (see filesys.h). bool Load(const wxString& filemask); @@ -214,6 +209,15 @@ public: // version for internal use only static int DoGetXRCID(const char *str_id, int value_if_not_found = wxID_NONE); + + // Find the string ID with the given numeric value, returns an empty string + // if no such ID is found. + // + // Notice that unlike GetXRCID(), which is fast, this operation is slow as + // it checks all the IDs used in XRC. + static wxString FindXRCIDById(int numId); + + // Returns version information (a.b.c.d = d+ 256*c + 256^2*b + 256^3*a). long GetVersion() const { return m_version; } @@ -330,10 +334,10 @@ private: // 400, 300 // // -// wxSizerItem* item = XRCSIZERITEM(*this, wxT("area")) +// wxSizerItem* item = XRCSIZERITEM(*this, "area") #define XRCSIZERITEM(window, id) \ - ((window).GetSizer() ? (window).GetSizer()->GetItemById(id) : NULL) + ((window).GetSizer() ? (window).GetSizer()->GetItemById(XRCID(id)) : NULL) // wxXmlResourceHandler is an abstract base class for resource handlers // capable of creating a control from an XML node. @@ -465,6 +469,10 @@ protected: // Gets a font. wxFont GetFont(const wxString& param = wxT("font")); + // Gets the value of a boolean attribute (only "0" and "1" are valid values) + bool GetBoolAttr(const wxString& attr, bool defaultv); + + // Sets common window options. void SetupWindow(wxWindow *wnd);