.\" This is a wxWidgets manpage page generated from the XML docs .TH wxXmlResource 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxXmlResource \- The main class for working with resources. .SH DESCRIPTION This is the main class for interacting with the XML-based resource system. The class holds XML resources from one or more .xml files, binary files or zip archive files. See XML-based resource system overview for details. .SH "PARENTS" wxObject .SH "INCLUDE FILES" wx/xrc/xmlres.h .SH MEMBERS .SS wxXmlResource (const wxString& filemaskint flags = wxXRC_USE_LOCALE) Constructor. .SS wxXmlResource (int flags = wxXRC_USE_LOCALE) Constructor. .SS ~wxXmlResource () Destructor. .SS void AddHandler (wxXmlResourceHandler* handler) Initializes only a specific handler (or custom handler). Convention says that the handler name is equal to the control's name plus 'XmlHandler', for example wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. The XML resource compiler (wxxrc) can create include file that contains initialization code for all controls used within the resource. .SS bool AttachUnknownControl (const wxString& namewxWindow* controlwxWindow* parent = NULL) Attaches an unknown control to the given panel/window/dialog. Unknown controls are used in conjunction with . .SS void ClearHandlers () Removes all handlers. .SS int CompareVersion (int majorint minorint releaseint revision) Compares the XRC version to the argument. Returns -1 if the XRC version is less than the argument, +1 if greater, and 0 if they equal. .SS wxXmlResource* Get () Gets the global resources object or creates one if none exists. .SS int GetFlags () Returns flags, which may be a bitlist of wxXRC_USE_LOCALE and wxXRC_NO_SUBCLASSING. .SS long GetVersion () Returns version information (a.b.c.d = d+ 256*c + 256^2*b + 256\textasciitilde3*a). .SS int GetXRCID (const wxChar* str_id) Returns a numeric ID that is equivalent to the string ID used in an XML resource. To be used in event tables. The macro XRCID(name) is provided for convenience. .SS void InitAllHandlers () Initializes handlers for all supported controls/windows. This will make the executable quite big because it forces linking against most of the wxWidgets library. .SS bool Load (const wxString& filemask) Loads resources from XML files that match given filemask. This method understands VFS (see filesys.h). .SS wxBitmap LoadBitmap (const wxString& name) Loads a bitmap resource from a file. .SS wxDialog* LoadDialog (wxWindow* parentconst wxString& name) Loads a dialog. dlg points to a parent window (if any). .SS bool LoadDialog (wxDialog* dlgwxWindow* parentconst wxString& name) Loads a dialog. dlg points to parent window (if any). This form is used to finish creation of an already existing instance (the main reason for this is that you may want to use derived class with a new event table). Example: MyDialog dlg; wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog"); dlg->ShowModal(); .SS bool LoadFrame (wxFrame* framewxWindow* parentconst wxString& name) Loads a frame. .SS wxIcon LoadIcon (const wxString& name) Loads an icon resource from a file. .SS wxMenu* LoadMenu (const wxString& name) Loads menu from resource. Returns NULL on failure. .SS wxMenuBar* LoadMenuBar (wxWindow* parentconst wxString& name) Loads a menubar from resource. Returns NULL on failure. .SS wxMenuBar* LoadMenuBar (const wxString& name) Loads a menubar from resource. Returns NULL on failure. .SS wxPanel* LoadPanel (wxWindow* parentconst wxString& name) Loads a panel. panel points to parent window (if any). .SS bool LoadPanel (wxPanel* panelwxWindow* parentconst wxString& name) Loads a panel. panel points to parent window (if any). This form is used to finish creation of an already existing instance. .SS wxToolBar* LoadToolBar (wxWindow* parentconst wxString& name) Loads a toolbar. .SS wxXmlResource* Set (wxXmlResource* res) Sets the global resources object and returns a pointer to the previous one (may be NULL). .SS void SetFlags (int flags) Sets flags (bitlist of wxXRC_USE_LOCALE and wxXRC_NO_SUBCLASSING). .SS bool Unload (const wxString& filename) This function unloads a resource previously loaded by Load() . Returns true if the resource was successfully unloaded and false if it hasn't been found in the list of loaded resources. .SH "SEE ALSO" wxObject .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.