2 % automatically generated by HelpGen $Revision$ from
3 % xmlres.h at 22/Jan/02 23:08:28
6 \section{\class{wxXmlResource
}}\label{wxxmlresource
}
8 This is the main class for interacting with the XML-based resource system.
10 The class holds XML resources from one or more .xml files, binary files or zip archive files.
12 See
\helpref{XML-based resource system overview
}{xrcoverview
} for details.
14 \wxheading{Derived from
}
16 \helpref{wxObject
}{wxobject
}
18 \wxheading{Include files
}
24 \helpref{wxXrc
}{librarieslist
}
29 enum wxXmlResourceFlags
32 wxXRC_NO_SUBCLASSING =
2,
33 wxXRC_NO_RELOADING =
4
37 \latexignore{\rtfignore{\wxheading{Members
}}}
40 \membersection{wxXmlResource::wxXmlResource
}\label{wxxmlresourcector
}
42 \func{}{wxXmlResource
}{\param{const wxString\&
}{filemask
},
43 \param{int
}{flags = wxXRC
\_USE\_LOCALE},
44 \param{const wxString&
}{domain = wxEmptyString
}}
48 \docparam{filemask
}{The XRC file, archive file, or wildcard specification that will be used to
49 load all resource files inside a zip archive.
}
51 \docparam{flags
}{wxXRC
\_USE\_LOCALE: translatable strings will be translated via
\_().
52 wxXRC
\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
53 (useful for previews in XRC editors).
}
55 \docparam{domain
}{The name of the gettext catalog to search for
56 translatable strings. By default all loaded catalogs will be
57 searched. This provides a way to allow the strings to only come
58 from a specific catalog.
}
60 \func{}{wxXmlResource
}{\param{int
}{flags = wxXRC
\_USE\_LOCALE},
61 \param{const wxString&
}{domain = wxEmptyString
}}
65 \docparam{flags
}{wxXRC
\_USE\_LOCALE: translatable strings will be translated via
\_().
66 wxXRC
\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
67 (useful for previews in XRC editors). wxXRC
\_NO\_RELOADING will prevent the
68 XRC files from being reloaded from disk in case they have been modified there
69 since being last loaded (may slightly speed up loading them).
}
71 \docparam{domain
}{The name of the gettext catalog to search for
72 translatable strings. By default all loaded catalogs will be
73 searched. This provides a way to allow the strings to only come
74 from a specific catalog.
}
77 \membersection{wxXmlResource::
\destruct{wxXmlResource
}}\label{wxxmlresourcedtor
}
79 \func{}{\destruct{wxXmlResource
}}{\void}
84 \membersection{wxXmlResource::AddHandler
}\label{wxxmlresourceaddhandler
}
86 \func{void
}{AddHandler
}{\param{wxXmlResourceHandler*
}{handler
}}
88 Initializes only a specific handler (or custom handler). Convention says
89 that the handler name is equal to the control's name plus 'XmlHandler', for example
90 wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. The XML resource compiler
91 (wxxrc) can create include file that contains initialization code for
92 all controls used within the resource. Note that this handler should be
93 allocated on the heap, since it will be delete by
94 \helpref{ClearHandlers
}{wxxmlresourceclearhandlers
} later.
97 \membersection{wxXmlResource::AttachUnknownControl
}\label{wxxmlresourceattachunknowncontrol
}
99 \func{bool
}{AttachUnknownControl
}{\param{const wxString\&
}{name
},
\param{wxWindow*
}{control
},
\param{wxWindow*
}{parent =
\NULL}}
101 Attaches an unknown control to the given panel/window/dialog.
102 Unknown controls are used in conjunction with <object class="unknown">.
105 \membersection{wxXmlResource::ClearHandlers
}\label{wxxmlresourceclearhandlers
}
107 \func{void
}{ClearHandlers
}{\void}
109 Removes all handlers and deletes them (this means that any handlers added using
110 \helpref{AddHandler
}{wxxmlresourceaddhandler
} must be allocated on the heap).
113 \membersection{wxXmlResource::CompareVersion
}\label{wxxmlresourcecompareversion
}
115 \constfunc{int
}{CompareVersion
}{\param{int
}{major
},
\param{int
}{minor
},
\param{int
}{release
},
\param{int
}{revision
}}
117 Compares the XRC version to the argument. Returns -
1 if the XRC version
118 is less than the argument, +
1 if greater, and
0 if they equal.
121 \membersection{wxXmlResource::Get
}\label{wxxmlresourceget
}
123 \func{wxXmlResource*
}{Get
}{\void}
125 Gets the global resources object or creates one if none exists.
128 \membersection{wxXmlResource::GetFlags
}\label{wxxmlresourcegetflags
}
130 \func{int
}{GetFlags
}{\void}
132 Returns flags, which may be a bitlist of wxXRC
\_USE\_LOCALE and wxXRC
\_NO\_SUBCLASSING.
135 \membersection{wxXmlResource::GetVersion
}\label{wxxmlresourcegetversion
}
137 \constfunc{long
}{GetVersion
}{\void}
139 Returns version information (a.b.c.d = d+
256*c +
256\textasciicircum2*b +
256\textasciitilde3*a).
142 \membersection{wxXmlResource::GetXRCID
}\label{wxxmlresourcegetxmlid
}
144 \func{int
}{GetXRCID
}{\param{const wxString\&
}{str
\_id},
\param{int
}{value
\_if\_not\_found = -
2}}
146 Returns a numeric ID that is equivalent to the string ID used in an XML
147 resource. If an unknown
\arg{str
\_id} is requested (i.e. other than wxID
\_XXX
148 or integer), a new record is created which associates the given string with
149 a number. If
\arg{value
\_if\_not\_found} is
\texttt{wxID
\_NONE}, the number is obtained via
150 \helpref{wxNewId()
}{wxnewid
}. Otherwise
\arg{value
\_if\_not\_found} is used.
151 Macro
{\tt XRCID(name)
} is provided for convenient use in event tables.
153 \membersection{wxXmlResource::InitAllHandlers
}\label{wxxmlresourceinitallhandlers
}
155 \func{void
}{InitAllHandlers
}{\void}
157 Initializes handlers for all supported controls/windows. This will
158 make the executable quite big because it forces linking against
159 most of the wxWidgets library.
162 \membersection{wxXmlResource::Load
}\label{wxxmlresourceload
}
164 \func{bool
}{Load
}{\param{const wxString\&
}{filemask
}}
166 Loads resources from XML files that match given filemask.
167 This method understands VFS (see filesys.h).
170 \membersection{wxXmlResource::LoadBitmap
}\label{wxxmlresourceloadbitmap
}
172 \func{wxBitmap
}{LoadBitmap
}{\param{const wxString\&
}{name
}}
174 Loads a bitmap resource from a file.
177 \membersection{wxXmlResource::LoadDialog
}\label{wxxmlresourceloaddialog
}
179 \func{wxDialog*
}{LoadDialog
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
181 Loads a dialog.
{\it dlg
} points to a parent window (if any).
183 \func{bool
}{LoadDialog
}{\param{wxDialog*
}{dlg
},
\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
185 Loads a dialog.
{\it dlg
} points to parent window (if any).
187 This form is used to finish creation of an already existing instance (the main reason
188 for this is that you may want to use derived class with a new event table).
194 wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog");
199 \membersection{wxXmlResource::LoadFrame
}\label{wxxmlresourceloadframe
}
201 \func{bool
}{LoadFrame
}{\param{wxFrame*
}{frame
},
\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
206 \membersection{wxXmlResource::LoadIcon
}\label{wxxmlresourceloadicon
}
208 \func{wxIcon
}{LoadIcon
}{\param{const wxString\&
}{name
}}
210 Loads an icon resource from a file.
213 \membersection{wxXmlResource::LoadMenu
}\label{wxxmlresourceloadmenu
}
215 \func{wxMenu*
}{LoadMenu
}{\param{const wxString\&
}{name
}}
217 Loads menu from resource. Returns
\NULL on failure.
220 \membersection{wxXmlResource::LoadMenuBar
}\label{wxxmlresourceloadmenubar
}
222 \func{wxMenuBar*
}{LoadMenuBar
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
224 \func{wxMenuBar*
}{LoadMenuBar
}{\param{const wxString\&
}{name
}}
226 Loads a menubar from resource. Returns
\NULL on failure.
229 \membersection{wxXmlResource::LoadObject
}\label{wxxmlresourceloadobject
}
231 \func{wxObject*
}{LoadObject
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
},
\param{const wxString\&
}{classname
}}
233 \func{bool
}{LoadObject
}{\param{wxObject*
}{instance
},
\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
},
\param{const wxString\&
}{classname
}}
235 Load an object from the resource specifying both the resource name and the
238 The first overload lets you load nonstandard container windows and returns
\NULL
239 on failure. The second one lets you finish the creation of an existing
240 instance and returns
\false on failure.
243 \membersection{wxXmlResource::LoadPanel
}\label{wxxmlresourceloadpanel
}
245 \func{wxPanel*
}{LoadPanel
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
247 Loads a panel.
{\it panel
} points to parent window (if any).
249 \func{bool
}{LoadPanel
}{\param{wxPanel*
}{panel
},
\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
251 Loads a panel.
{\it panel
} points to parent window (if any). This form
252 is used to finish creation of an already existing instance.
255 \membersection{wxXmlResource::LoadToolBar
}\label{wxxmlresourceloadtoolbar
}
257 \func{wxToolBar*
}{LoadToolBar
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
262 \membersection{wxXmlResource::Set
}\label{wxxmlresourceset
}
264 \func{wxXmlResource*
}{Set
}{\param{wxXmlResource*
}{res
}}
266 Sets the global resources object and returns a pointer to the previous one (may be
\NULL).
269 \membersection{wxXmlResource::SetFlags
}\label{wxxmlresourcesetflags
}
271 \func{void
}{SetFlags
}{\param{int
}{flags
}}
273 Sets flags (bitlist of wxXRC
\_USE\_LOCALE and wxXRC
\_NO\_SUBCLASSING).
276 \membersection{wxXmlResource::Unload
}\label{wxxmlresourceunload
}
278 \func{bool
}{Unload
}{\param{const wxString\&
}{filename
}}
280 This function unloads a resource previously loaded by
281 \helpref{Load()
}{wxxmlresourceload
}.
283 Returns
\true if the resource was successfully unloaded and
\false if it hasn't
284 been found in the list of loaded resources.
288 \membersection{wxXmlResource::GetDomain
}\label{wxxmlresourcegetdomain
}
290 \func{wxChar*
}{GetDomain
}{}
292 Returns the domain (message catalog) that will be used to load
293 translatable strings in the XRC.
296 \membersection{wxXmlResource::SetDomain
}\label{wxxmlresourcesetdomain
}
298 \func{wxChar*
}{SetDomain
}{\param{const wxChar*
}{domain
}}
300 Sets the domain (message catalog) that will be used to load
301 translatable strings in the XRC.