]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/include/wx/xml/xmlres.h
Fixed buffer overrun in call to wxStripMenuCodes()
[wxWidgets.git] / contrib / include / wx / xml / xmlres.h
index 006c166a20e5a83d072b957eca49ef834c41b92b..0947c0634a07f09da8d6d80018906544eb9b2c0c 100644 (file)
@@ -45,7 +45,6 @@ class WXDLLEXPORT wxXmlResourceDataRecord
     
         wxString File;
         wxXmlDocument *Doc;
-        bool DocOwned;
         wxDateTime Time;
 };
 
@@ -110,7 +109,9 @@ class WXDLLEXPORT wxXmlResource : public wxObject
         wxPanel *LoadPanel(wxWindow *parent, const wxString& name);
         bool LoadPanel(wxPanel *panel, wxWindow *parent, const wxString& name);
 
-        // Load bitmap or icon resource from file:
+        bool LoadFrame(wxFrame* frame, wxWindow *parent, const wxString& name);
+
+        // Loads bitmap or icon resource from file:
         wxBitmap LoadBitmap(const wxString& name);
         wxIcon LoadIcon(const wxString& name);
 
@@ -125,7 +126,7 @@ class WXDLLEXPORT wxXmlResource : public wxObject
         void UpdateResources();
         
         // Finds resource (calls UpdateResources) and returns node containing it
-        wxXmlNode *FindResource(const wxString& name, const wxString& type);
+        wxXmlNode *FindResource(const wxString& name, const wxString& classname);
         
         // Creates resource from info in given node:
         wxObject *CreateResFromNode(wxXmlNode *node, wxObject *parent, wxObject *instance = NULL);
@@ -213,11 +214,17 @@ class WXDLLEXPORT wxXmlResourceHandler : public wxObject
 
         // Variables (filled by CreateResource)
         wxXmlNode *m_Node;
+        wxString m_Class;
         wxObject *m_Parent, *m_Instance;
         wxWindow *m_ParentAsWindow, *m_InstanceAsWindow;
         
         // --- Handy methods:
 
+        // Returns true if the node has property class equal to classname,
+        // e.g. <object class="wxDialog">
+        bool IsOfClass(wxXmlNode *node, const wxString& classname)
+            { return node->GetPropVal(_T("class"), wxEmptyString) == classname; }
+
         // Gets node content from wxXML_ENTITY_NODE
         // (the problem is, <tag>content<tag> is represented as
         // wxXML_ENTITY_NODE name="tag", content=""
@@ -279,9 +286,8 @@ class WXDLLEXPORT wxXmlResourceHandler : public wxObject
         // Sets common window options:
         void SetupWindow(wxWindow *wnd);
     
-        void CreateChildren(wxObject *parent, bool only_this_handler = FALSE,
-                          wxXmlNode *children_node = NULL /*stands for
-                             GetParamNode("children")*/);
+        void CreateChildren(wxObject *parent, bool this_hnd_only = FALSE);
+        void CreateChildrenPrivately(wxObject *parent, wxXmlNode *rootnode = NULL);
         wxObject *CreateResFromNode(wxXmlNode *node, wxObject *parent, wxObject *instance = NULL)
             { return m_Resource->CreateResFromNode(node, parent, instance); }