#include <wx/xrc/xmlres.h>

The class holds XML resources from one or more .xml files, binary files or zip archive files.
Public Member Functions | |
| wxXmlResource (const wxString &filemask, int flags=wxXRC_USE_LOCALE, const wxString domain=wxEmptyString) | |
| wxXmlResource (int flags=wxXRC_USE_LOCALE, const wxString domain=wxEmptyString) | |
| virtual | ~wxXmlResource () |
| void | AddHandler (wxXmlResourceHandler *handler) |
| bool | AttachUnknownControl (const wxString &name, wxWindow *control, wxWindow *parent=NULL) |
| void | ClearHandlers () |
| int | CompareVersion (int major, int minor, int release, int revision) const |
| const wxString & | GetDomain () const |
| int | GetFlags () const |
| long | GetVersion () const |
| void | InitAllHandlers () |
| bool | Load (const wxString &filemask) |
| wxBitmap | LoadBitmap (const wxString &name) |
| wxDialog * | LoadDialog (wxWindow *parent, const wxString &name) |
| bool | LoadDialog (wxDialog *dlg, wxWindow *parent, const wxString &name) |
| bool | LoadFrame (wxFrame *frame, wxWindow *parent, const wxString &name) |
| wxIcon | LoadIcon (const wxString &name) |
| wxMenu * | LoadMenu (const wxString &name) |
| wxPanel * | LoadPanel (wxWindow *parent, const wxString &name) |
| bool | LoadPanel (wxPanel *panel, wxWindow *parent, const wxString &name) |
| wxToolBar * | LoadToolBar (wxWindow *parent, const wxString &name) |
| void | SetDomain (const wxString &domain) |
| void | SetFlags (int flags) |
| bool | Unload (const wxString &filename) |
| wxMenuBar * | LoadMenuBar (wxWindow *parent, const wxString &name) |
| wxMenuBar * | LoadMenuBar (const wxString &name) |
| wxObject * | LoadObject (wxWindow *parent, const wxString &name, const wxString &classname) |
| bool | LoadObject (wxObject *instance, wxWindow *parent, const wxString &name, const wxString &classname) |
Static Public Member Functions | |
| static wxXmlResource * | Get () |
| static int | GetXRCID (const wxString &str_id, int value_if_not_found=wxID_NONE) |
| static wxXmlResource * | Set (wxXmlResource *res) |
| wxXmlResource::wxXmlResource | ( | const wxString & | filemask, | |
| int | flags = wxXRC_USE_LOCALE, |
|||
| const wxString | domain = wxEmptyString | |||
| ) |
Constructor.
| filemask | The XRC file, archive file, or wildcard specification that will be used to load all resource files inside a zip archive. | |
| flags | One or more value of the wxXmlResourceFlags enumeration. | |
| domain | The name of the gettext catalog to search for translatable strings. By default all loaded catalogs will be searched. This provides a way to allow the strings to only come from a specific catalog. |
| wxXmlResource::wxXmlResource | ( | int | flags = wxXRC_USE_LOCALE, |
|
| const wxString | domain = wxEmptyString | |||
| ) |
Constructor.
| flags | One or more value of the wxXmlResourceFlags enumeration. | |
| domain | The name of the gettext catalog to search for translatable strings. By default all loaded catalogs will be searched. This provides a way to allow the strings to only come from a specific catalog. |
| virtual wxXmlResource::~wxXmlResource | ( | ) | [virtual] |
Destructor.
| void wxXmlResource::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. Note that this handler must be allocated on the heap, since it will be deleted by ClearHandlers() later.
| bool wxXmlResource::AttachUnknownControl | ( | const wxString & | name, | |
| wxWindow * | control, | |||
| wxWindow * | parent = NULL | |||
| ) |
Attaches an unknown control to the given panel/window/dialog. Unknown controls are used in conjunction with <object class="unknown">.
| void wxXmlResource::ClearHandlers | ( | ) |
Removes all handlers and deletes them (this means that any handlers added using AddHandler() must be allocated on the heap).
| int wxXmlResource::CompareVersion | ( | int | major, | |
| int | minor, | |||
| int | release, | |||
| int | revision | |||
| ) | const |
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 are equal.
| static wxXmlResource* wxXmlResource::Get | ( | ) | [static] |
Gets the global resources object or creates one if none exists.
| const wxString& wxXmlResource::GetDomain | ( | ) | const |
Returns the domain (message catalog) that will be used to load translatable strings in the XRC.
| int wxXmlResource::GetFlags | ( | ) | const |
Returns flags, which may be a bitlist of wxXmlResourceFlags enumeration values.
| long wxXmlResource::GetVersion | ( | ) | const |
Returns version information (a.b.c.d = d + 256*c + 2562*b + 2563*a).
| static int wxXmlResource::GetXRCID | ( | const wxString & | str_id, | |
| int | value_if_not_found = wxID_NONE | |||
| ) | [static] |
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 is 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.
| void wxXmlResource::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.
| bool wxXmlResource::Load | ( | const wxString & | filemask | ) |
Loads resources from XML files that match given filemask. This method understands VFS (see filesys.h).
Loads a dialog. parent points to parent window (if any).
Loads a dialog. parent 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();
Loads a frame.
Loads menu from resource. Returns NULL on failure.
Loads a menubar from resource. Returns NULL on failure.
Loads a menubar from resource. Returns NULL on failure.
| wxObject* wxXmlResource::LoadObject | ( | wxWindow * | parent, | |
| const wxString & | name, | |||
| const wxString & | classname | |||
| ) |
Load an object from the resource specifying both the resource name and the class name.
The first overload lets you load nonstandard container windows and returns NULL on failure. The second one lets you finish the creation of an existing instance and returns false on failure.
| bool wxXmlResource::LoadObject | ( | wxObject * | instance, | |
| wxWindow * | parent, | |||
| const wxString & | name, | |||
| const wxString & | classname | |||
| ) |
Load an object from the resource specifying both the resource name and the class name.
The first overload lets you load nonstandard container windows and returns NULL on failure. The second one lets you finish the creation of an existing instance and returns false on failure.
Loads a panel. panel points to parent window (if any).
Loads a panel. panel points to parent window (if any). This form is used to finish creation of an already existing instance.
| static wxXmlResource* wxXmlResource::Set | ( | wxXmlResource * | res | ) | [static] |
Sets the global resources object and returns a pointer to the previous one (may be NULL).
| void wxXmlResource::SetDomain | ( | const wxString & | domain | ) |
Sets the domain (message catalog) that will be used to load translatable strings in the XRC.
| void wxXmlResource::SetFlags | ( | int | flags | ) |
Sets flags (bitlist of wxXmlResourceFlags enumeration values).
| bool wxXmlResource::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.
|
[ top ] |