2002-01-23 10:17:44 -05:00
|
|
|
%
|
|
|
|
% automatically generated by HelpGen $Revision$ from
|
|
|
|
% xmlres.h at 22/Jan/02 23:08:28
|
|
|
|
%
|
|
|
|
|
|
|
|
\section{\class{wxXmlResource}}\label{wxxmlresource}
|
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
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 \helpref{XML-based resource system overview}{xrcoverview} for details.
|
2002-01-23 10:17:44 -05:00
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
|
|
|
\wxheading{Include files}
|
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
<wx/xrc/xmlres.h>
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2005-07-13 12:30:11 -04:00
|
|
|
\wxheading{Constants}
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2002-05-05 10:24:07 -04:00
|
|
|
\begin{verbatim}
|
2002-01-23 17:10:02 -05:00
|
|
|
enum wxXmlResourceFlags
|
|
|
|
{
|
2002-05-08 15:51:58 -04:00
|
|
|
wxXRC_USE_LOCALE = 1,
|
2005-07-13 12:30:11 -04:00
|
|
|
wxXRC_NO_SUBCLASSING = 2,
|
|
|
|
wxXRC_NO_RELOADING = 4
|
2002-01-23 17:10:02 -05:00
|
|
|
};
|
2002-05-05 10:24:07 -04:00
|
|
|
\end{verbatim}
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2004-09-21 09:24:41 -04:00
|
|
|
\membersection{wxXmlResource::wxXmlResource}\label{wxxmlresourcector}
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2006-08-21 14:27:15 -04:00
|
|
|
\func{}{wxXmlResource}{\param{const wxString\& }{filemask},
|
|
|
|
\param{int }{flags = wxXRC\_USE\_LOCALE},
|
|
|
|
\param{const wxString& }{domain = wxEmptyString}}
|
2002-01-23 10:17:44 -05:00
|
|
|
|
|
|
|
Constructor.
|
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
\docparam{filemask}{The XRC file, archive file, or wildcard specification that will be used to
|
|
|
|
load all resource files inside a zip archive.}
|
|
|
|
|
|
|
|
\docparam{flags}{wxXRC\_USE\_LOCALE: translatable strings will be translated via \_().
|
|
|
|
wxXRC\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
|
|
|
|
(useful for previews in XRC editors).}
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2006-08-21 14:27:15 -04:00
|
|
|
\docparam{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.}
|
|
|
|
|
|
|
|
\func{}{wxXmlResource}{\param{int }{flags = wxXRC\_USE\_LOCALE},
|
|
|
|
\param{const wxString& }{domain = wxEmptyString}}
|
2002-01-23 10:17:44 -05:00
|
|
|
|
|
|
|
Constructor.
|
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
\docparam{flags}{wxXRC\_USE\_LOCALE: translatable strings will be translated via \_().
|
|
|
|
wxXRC\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
|
2005-07-13 12:30:11 -04:00
|
|
|
(useful for previews in XRC editors). wxXRC\_NO\_RELOADING will prevent the
|
|
|
|
XRC files from being reloaded from disk in case they have been modified there
|
|
|
|
since being last loaded (may slightly speed up loading them).}
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2006-08-21 14:27:15 -04:00
|
|
|
\docparam{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.}
|
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::\destruct{wxXmlResource}}\label{wxxmlresourcedtor}
|
|
|
|
|
|
|
|
\func{}{\destruct{wxXmlResource}}{\void}
|
|
|
|
|
|
|
|
Destructor.
|
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::AddHandler}\label{wxxmlresourceaddhandler}
|
|
|
|
|
|
|
|
\func{void}{AddHandler}{\param{wxXmlResourceHandler* }{handler}}
|
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
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
|
2002-01-23 10:17:44 -05:00
|
|
|
wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. The XML resource compiler
|
2002-01-23 17:10:02 -05:00
|
|
|
(wxxrc) can create include file that contains initialization code for
|
2006-05-28 19:56:51 -04:00
|
|
|
all controls used within the resource. Note that this handler should be
|
2006-05-30 09:10:30 -04:00
|
|
|
allocated on the heap, since it will be delete by
|
|
|
|
\helpref{ClearHandlers}{wxxmlresourceclearhandlers} later.
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::AttachUnknownControl}\label{wxxmlresourceattachunknowncontrol}
|
|
|
|
|
|
|
|
\func{bool}{AttachUnknownControl}{\param{const wxString\& }{name}, \param{wxWindow* }{control}, \param{wxWindow* }{parent = NULL}}
|
|
|
|
|
|
|
|
Attaches an unknown control to the given panel/window/dialog.
|
|
|
|
Unknown controls are used in conjunction with <object class="unknown">.
|
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::ClearHandlers}\label{wxxmlresourceclearhandlers}
|
|
|
|
|
|
|
|
\func{void}{ClearHandlers}{\void}
|
|
|
|
|
2006-05-30 09:10:30 -04:00
|
|
|
Removes all handlers and deletes them (this means that any handlers added using
|
|
|
|
\helpref{AddHandler}{wxxmlresourceaddhandler} must be allocated on the heap).
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::CompareVersion}\label{wxxmlresourcecompareversion}
|
|
|
|
|
|
|
|
\constfunc{int}{CompareVersion}{\param{int }{major}, \param{int }{minor}, \param{int }{release}, \param{int }{revision}}
|
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
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.
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::Get}\label{wxxmlresourceget}
|
|
|
|
|
|
|
|
\func{wxXmlResource*}{Get}{\void}
|
|
|
|
|
|
|
|
Gets the global resources object or creates one if none exists.
|
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::GetFlags}\label{wxxmlresourcegetflags}
|
|
|
|
|
|
|
|
\func{int}{GetFlags}{\void}
|
|
|
|
|
|
|
|
Returns flags, which may be a bitlist of wxXRC\_USE\_LOCALE and wxXRC\_NO\_SUBCLASSING.
|
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::GetVersion}\label{wxxmlresourcegetversion}
|
|
|
|
|
|
|
|
\constfunc{long}{GetVersion}{\void}
|
|
|
|
|
2002-05-05 10:24:07 -04:00
|
|
|
Returns version information (a.b.c.d = d+ 256*c + 256\textasciicircum2*b + 256\textasciitilde3*a).
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-27 18:51:05 -05:00
|
|
|
\membersection{wxXmlResource::GetXRCID}\label{wxxmlresourcegetxmlid}
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2006-05-06 12:59:59 -04:00
|
|
|
\func{int}{GetXRCID}{\param{const wxChar* }{str\_id}, \param{int }{value\_if\_not\_found = -2}}
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
Returns a numeric ID that is equivalent to the string ID used in an XML
|
2006-05-06 12:59:59 -04:00
|
|
|
resource. If an unknown \arg{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 \arg{value\_if\_not\_found} is \texttt{wxID\_NONE}, the number is obtained via
|
|
|
|
\helpref{wxNewId()}{wxnewid}. Otherwise \arg{value\_if\_not\_found} is used.
|
|
|
|
Macro {\tt XRCID(name)} is provided for convenient use in event tables.
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::InitAllHandlers}\label{wxxmlresourceinitallhandlers}
|
|
|
|
|
|
|
|
\func{void}{InitAllHandlers}{\void}
|
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
Initializes handlers for all supported controls/windows. This will
|
2002-01-23 10:17:44 -05:00
|
|
|
make the executable quite big because it forces linking against
|
2004-05-04 04:27:20 -04:00
|
|
|
most of the wxWidgets library.
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::Load}\label{wxxmlresourceload}
|
|
|
|
|
|
|
|
\func{bool}{Load}{\param{const wxString\& }{filemask}}
|
|
|
|
|
|
|
|
Loads resources from XML files that match given filemask.
|
|
|
|
This method understands VFS (see filesys.h).
|
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::LoadBitmap}\label{wxxmlresourceloadbitmap}
|
|
|
|
|
|
|
|
\func{wxBitmap}{LoadBitmap}{\param{const wxString\& }{name}}
|
|
|
|
|
|
|
|
Loads a bitmap resource from a file.
|
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::LoadDialog}\label{wxxmlresourceloaddialog}
|
|
|
|
|
|
|
|
\func{wxDialog*}{LoadDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
|
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
Loads a dialog. {\it dlg} points to a parent window (if any).
|
2002-01-23 10:17:44 -05:00
|
|
|
|
|
|
|
\func{bool}{LoadDialog}{\param{wxDialog* }{dlg}, \param{wxWindow* }{parent}, \param{const wxString\& }{name}}
|
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
Loads a dialog. {\it 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).
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
Example:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
MyDialog dlg;
|
|
|
|
wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog");
|
|
|
|
dlg->ShowModal();
|
|
|
|
\end{verbatim}
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::LoadFrame}\label{wxxmlresourceloadframe}
|
|
|
|
|
|
|
|
\func{bool}{LoadFrame}{\param{wxFrame* }{frame}, \param{wxWindow* }{parent}, \param{const wxString\& }{name}}
|
|
|
|
|
|
|
|
Loads a frame.
|
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::LoadIcon}\label{wxxmlresourceloadicon}
|
|
|
|
|
|
|
|
\func{wxIcon}{LoadIcon}{\param{const wxString\& }{name}}
|
|
|
|
|
|
|
|
Loads an icon resource from a file.
|
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::LoadMenu}\label{wxxmlresourceloadmenu}
|
|
|
|
|
|
|
|
\func{wxMenu*}{LoadMenu}{\param{const wxString\& }{name}}
|
|
|
|
|
|
|
|
Loads menu from resource. Returns NULL on failure.
|
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::LoadMenuBar}\label{wxxmlresourceloadmenubar}
|
|
|
|
|
|
|
|
\func{wxMenuBar*}{LoadMenuBar}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
|
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
Loads a menubar from resource. Returns NULL on failure.
|
2002-01-23 10:17:44 -05:00
|
|
|
|
|
|
|
\func{wxMenuBar*}{LoadMenuBar}{\param{const wxString\& }{name}}
|
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
Loads a menubar from resource. Returns NULL on failure.
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::LoadPanel}\label{wxxmlresourceloadpanel}
|
|
|
|
|
|
|
|
\func{wxPanel*}{LoadPanel}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
|
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
Loads a panel. {\it panel} points to parent window (if any).
|
2002-01-23 10:17:44 -05:00
|
|
|
|
|
|
|
\func{bool}{LoadPanel}{\param{wxPanel* }{panel}, \param{wxWindow* }{parent}, \param{const wxString\& }{name}}
|
|
|
|
|
2002-01-23 17:10:02 -05:00
|
|
|
Loads a panel. {\it panel} points to parent window (if any). This form
|
|
|
|
is used to finish creation of an already existing instance.
|
2002-01-23 10:17:44 -05:00
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::LoadToolBar}\label{wxxmlresourceloadtoolbar}
|
|
|
|
|
|
|
|
\func{wxToolBar*}{LoadToolBar}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
|
|
|
|
|
|
|
|
Loads a toolbar.
|
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-01-23 10:17:44 -05:00
|
|
|
\membersection{wxXmlResource::Set}\label{wxxmlresourceset}
|
|
|
|
|
|
|
|
\func{wxXmlResource*}{Set}{\param{wxXmlResource* }{res}}
|
|
|
|
|
|
|
|
Sets the global resources object and returns a pointer to the previous one (may be NULL).
|
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
\membersection{wxXmlResource::SetFlags}\label{wxxmlresourcesetflags}
|
|
|
|
|
2005-02-06 13:25:54 -05:00
|
|
|
\func{void}{SetFlags}{\param{int }{flags}}
|
2002-12-04 09:11:26 -05:00
|
|
|
|
|
|
|
Sets flags (bitlist of wxXRC\_USE\_LOCALE and wxXRC\_NO\_SUBCLASSING).
|
|
|
|
|
2005-07-13 14:01:43 -04:00
|
|
|
|
|
|
|
\membersection{wxXmlResource::Unload}\label{wxxmlresourceunload}
|
|
|
|
|
|
|
|
\func{bool}{Unload}{\param{const wxString\& }{filename}}
|
|
|
|
|
|
|
|
This function unloads a resource previously loaded by
|
|
|
|
\helpref{Load()}{wxxmlresourceload}.
|
|
|
|
|
|
|
|
Returns \true if the resource was successfully unloaded and \false if it hasn't
|
|
|
|
been found in the list of loaded resources.
|
|
|
|
|
2006-08-21 14:27:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
\membersection{wxXmlResource::GetDomain}\label{wxxmlresourcegetdomain}
|
|
|
|
|
|
|
|
\func{wxChar*}{GetDomain}{}
|
|
|
|
|
|
|
|
Returns the domain (message catalog) that will be used to load
|
|
|
|
translatable strings in the XRC.
|
|
|
|
|
|
|
|
|
|
|
|
\membersection{wxXmlResource::SetDomain}\label{wxxmlresourcesetdomain}
|
|
|
|
|
|
|
|
\func{wxChar*}{SetDomain}{\param{const wxChar* }{domain}}
|
|
|
|
|
|
|
|
Sets the domain (message catalog) that will be used to load
|
|
|
|
translatable strings in the XRC.
|
2006-10-10 13:46:49 -04:00
|
|
|
|