]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/xmlres.tex
Added first cut at XRC docs; added font spec for wxWindows manual (new Tex2RTF feature!);
[wxWidgets.git] / docs / latex / wx / xmlres.tex
1 %
2 % automatically generated by HelpGen $Revision$ from
3 % xmlres.h at 22/Jan/02 23:08:28
4 %
5
6
7 \section{\class{wxXmlResource}}\label{wxxmlresource}
8
9
10 This class holds XML resources from one or more .xml files
11 (or derived forms, either binary or zipped -- see manual for
12 details).
13
14 \wxheading{Derived from}
15
16 \helpref{wxObject}{wxobject}
17
18 \wxheading{Include files}
19
20 <xmlres.h>
21
22 \wxheading{Data structures}
23
24 \latexignore{\rtfignore{\wxheading{Members}}}
25
26
27 \membersection{wxXmlResource::wxXmlResource}\label{wxxmlresourcewxxmlresource}
28
29 \func{}{wxXmlResource}{\param{const wxString\& }{filemask}, \param{int }{flags = wxXRC\_USE\_LOCALE}}
30
31 Constructor.
32 Flags: wxXRC\_USE\_LOCALE
33 translatable strings will be translated via \_()
34 wxXRC\_NO\_SUBCLASSING
35 subclass property of object nodes will be ignored
36 (useful for previews in XRC editors)
37
38
39 \func{}{wxXmlResource}{\param{int }{flags = wxXRC\_USE\_LOCALE}}
40
41 Constructor.
42 Flags: wxXRC\_USE\_LOCALE
43 translatable strings will be translated via \_()
44 wxXRC\_NO\_SUBCLASSING
45 subclass property of object nodes will be ignored
46 (useful for previews in XRC editors)
47
48
49 \membersection{wxXmlResource::\destruct{wxXmlResource}}\label{wxxmlresourcedtor}
50
51 \func{}{\destruct{wxXmlResource}}{\void}
52
53 Destructor.
54
55
56 \membersection{wxXmlResource::AddHandler}\label{wxxmlresourceaddhandler}
57
58 \func{void}{AddHandler}{\param{wxXmlResourceHandler* }{handler}}
59
60 Initialize only a specific handler (or custom handler). Convention says
61 that handler name is equal to the control's name plus 'XmlHandler', for example
62 wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. The XML resource compiler
63 (xmlres) can create include file that contains initialization code for
64 all controls used within the resource.
65
66
67 \membersection{wxXmlResource::AttachUnknownControl}\label{wxxmlresourceattachunknowncontrol}
68
69 \func{bool}{AttachUnknownControl}{\param{const wxString\& }{name}, \param{wxWindow* }{control}, \param{wxWindow* }{parent = NULL}}
70
71 Attaches an unknown control to the given panel/window/dialog.
72 Unknown controls are used in conjunction with <object class="unknown">.
73
74
75 \membersection{wxXmlResource::ClearHandlers}\label{wxxmlresourceclearhandlers}
76
77 \func{void}{ClearHandlers}{\void}
78
79 Removes all handlers
80
81
82 \membersection{wxXmlResource::CompareVersion}\label{wxxmlresourcecompareversion}
83
84 \constfunc{int}{CompareVersion}{\param{int }{major}, \param{int }{minor}, \param{int }{release}, \param{int }{revision}}
85
86 Compares resources version to argument. Returns -1 if resources version
87 is less than the argument, +1 if greater and 0 if they equal.
88
89
90 \membersection{wxXmlResource::CreateResFromNode}\label{wxxmlresourcecreateresfromnode}
91
92 \func{wxObject*}{CreateResFromNode}{\param{wxXmlNode* }{node}, \param{wxObject* }{parent}, \param{wxObject* }{instance = NULL}}
93
94 Creates a resource from information in the given node.
95
96
97 \membersection{wxXmlResource::DoFindResource}\label{wxxmlresourcedofindresource}
98
99 \func{wxXmlNode*}{DoFindResource}{\param{wxXmlNode* }{parent}, \param{const wxString\& }{name}, \param{const wxString\& }{classname}, \param{bool }{recursive}}
100
101 Helper function: finds a resource (calls UpdateResources) and returns a node containing it.
102
103
104 \membersection{wxXmlResource::FindResource}\label{wxxmlresourcefindresource}
105
106 \func{wxXmlNode*}{FindResource}{\param{const wxString\& }{name}, \param{const wxString\& }{classname}, \param{bool }{recursive = FALSE}}
107
108 Finds a resource (calls UpdateResources) and returns a node containing it.
109
110
111 \membersection{wxXmlResource::Get}\label{wxxmlresourceget}
112
113 \func{wxXmlResource*}{Get}{\void}
114
115 Singleton accessors.
116 Gets the global resources object or creates one if none exists.
117
118
119 \membersection{wxXmlResource::GetFlags}\label{wxxmlresourcegetflags}
120
121 \func{int}{GetFlags}{\void}
122
123 Returns flags, which may be a bitlist of wxXRC\_USE\_LOCALE and wxXRC\_NO\_SUBCLASSING.
124
125
126 \membersection{wxXmlResource::GetVersion}\label{wxxmlresourcegetversion}
127
128 \constfunc{long}{GetVersion}{\void}
129
130 Returns version information (a.b.c.d = d+ 256*c + 256\verb|^|2*b + 256\verb|^|3*a).
131
132
133 \membersection{wxXmlResource::GetXMLID}\label{wxxmlresourcegetxmlid}
134
135 \func{int}{GetXMLID}{\param{const wxChar* }{str\_id}}
136
137 Returns a numeric ID that is equivalent to the string id used in an XML
138 resource. To be used in event tables.
139 Macro XMLID is provided for convenience
140
141
142 \membersection{wxXmlResource::InitAllHandlers}\label{wxxmlresourceinitallhandlers}
143
144 \func{void}{InitAllHandlers}{\void}
145
146 Initialize handlers for all supported controls/windows. This will
147 make the executable quite big because it forces linking against
148 most of the wxWindows library.
149
150
151 \membersection{wxXmlResource::Load}\label{wxxmlresourceload}
152
153 \func{bool}{Load}{\param{const wxString\& }{filemask}}
154
155 Loads resources from XML files that match given filemask.
156 This method understands VFS (see filesys.h).
157
158
159 \membersection{wxXmlResource::LoadBitmap}\label{wxxmlresourceloadbitmap}
160
161 \func{wxBitmap}{LoadBitmap}{\param{const wxString\& }{name}}
162
163 Loads a bitmap resource from a file.
164
165
166 \membersection{wxXmlResource::LoadDialog}\label{wxxmlresourceloaddialog}
167
168 \func{wxDialog*}{LoadDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
169
170 Loads a dialog. dlg points to parent window (if any).
171
172
173 \func{bool}{LoadDialog}{\param{wxDialog* }{dlg}, \param{wxWindow* }{parent}, \param{const wxString\& }{name}}
174
175 Loads a dialog. dlg points to parent window (if any). This form
176 is used to finish creation of already existing instance (main reason
177 for this is that you may want to use derived class with new event table)
178 Example (typical usage):
179 MyDialog dlg;
180 wxTheXmlResource->LoadDialog(\&dlg, mainFrame, "my\_dialog");
181 dlg->ShowModal();
182
183
184 \membersection{wxXmlResource::LoadFrame}\label{wxxmlresourceloadframe}
185
186 \func{bool}{LoadFrame}{\param{wxFrame* }{frame}, \param{wxWindow* }{parent}, \param{const wxString\& }{name}}
187
188 Loads a frame.
189
190
191 \membersection{wxXmlResource::LoadIcon}\label{wxxmlresourceloadicon}
192
193 \func{wxIcon}{LoadIcon}{\param{const wxString\& }{name}}
194
195 Loads an icon resource from a file.
196
197
198 \membersection{wxXmlResource::LoadMenu}\label{wxxmlresourceloadmenu}
199
200 \func{wxMenu*}{LoadMenu}{\param{const wxString\& }{name}}
201
202 Loads menu from resource. Returns NULL on failure.
203
204
205 \membersection{wxXmlResource::LoadMenuBar}\label{wxxmlresourceloadmenubar}
206
207 \func{wxMenuBar*}{LoadMenuBar}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
208
209 Loads menubar from resource. Returns NULL on failure.
210
211
212 \func{wxMenuBar*}{LoadMenuBar}{\param{const wxString\& }{name}}
213
214 Loads menubar from resource. Returns NULL on failure.
215
216
217 \membersection{wxXmlResource::LoadPanel}\label{wxxmlresourceloadpanel}
218
219 \func{wxPanel*}{LoadPanel}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
220
221 Loads a panel. panel points to parent window (if any).
222
223
224 \func{bool}{LoadPanel}{\param{wxPanel* }{panel}, \param{wxWindow* }{parent}, \param{const wxString\& }{name}}
225
226 Loads a panel. panel points to parent window (if any). This form
227 is used to finish creation of already existing instance.
228
229
230 \membersection{wxXmlResource::LoadToolBar}\label{wxxmlresourceloadtoolbar}
231
232 \func{wxToolBar*}{LoadToolBar}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
233
234 Loads a toolbar.
235
236
237 \membersection{wxXmlResource::Set}\label{wxxmlresourceset}
238
239 \func{wxXmlResource*}{Set}{\param{wxXmlResource* }{res}}
240
241 Sets the global resources object and returns a pointer to the previous one (may be NULL).
242
243
244 \membersection{wxXmlResource::UpdateResources}\label{wxxmlresourceupdateresources}
245
246 \func{void}{UpdateResources}{\void}
247
248 Scans the resources list for unloaded files and loads them. Also reloads
249 files that have been modified since last loading.
250