]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/xmlresh.tex
Patches-1851591 ] dataview sample is crashing (under MSW)
[wxWidgets.git] / docs / latex / wx / xmlresh.tex
CommitLineData
d958c9bd
JS
1%
2% automatically generated by HelpGen $Revision$ from
3% xmlres.h at 22/Jan/02 23:08:28
4%
5
6\section{\class{wxXmlResourceHandler}}\label{wxxmlresourcehandler}
7
8wxXmlResourceHandler is an abstract base class for resource handlers
9capable of creating a control from an XML node.
10
bd330a69
JS
11See \helpref{XML-based resource system overview}{xrcoverview} for details.
12
d958c9bd
JS
13\wxheading{Derived from}
14
15\helpref{wxObject}{wxobject}
16
17\wxheading{Include files}
18
19<wx/xrc/xmlres.h>
20
a7af285d
VZ
21\wxheading{Library}
22
23\helpref{wxXrc}{librarieslist}
24
d958c9bd
JS
25\latexignore{\rtfignore{\wxheading{Members}}}
26
6d06e061 27\membersection{wxXmlResourceHandler::wxXmlResourceHandler}\label{wxxmlresourcehandlerctor}
d958c9bd
JS
28
29\func{}{wxXmlResourceHandler}{\void}
30
bd330a69 31Default constructor.
d958c9bd
JS
32
33\membersection{wxXmlResourceHandler::\destruct{wxXmlResourceHandler}}\label{wxxmlresourcehandlerdtor}
34
35\func{}{\destruct{wxXmlResourceHandler}}{\void}
36
37Destructor.
38
d958c9bd
JS
39\membersection{wxXmlResourceHandler::AddStyle}\label{wxxmlresourcehandleraddstyle}
40
41\func{void}{AddStyle}{\param{const wxString\& }{name}, \param{int }{value}}
42
43Add a style flag (e.g. wxMB\_DOCKABLE) to the list of flags
44understood by this handler.
45
d958c9bd
JS
46\membersection{wxXmlResourceHandler::AddWindowStyles}\label{wxxmlresourcehandleraddwindowstyles}
47
48\func{void}{AddWindowStyles}{\void}
49
50Add styles common to all wxWindow-derived classes.
51
d958c9bd
JS
52\membersection{wxXmlResourceHandler::CanHandle}\label{wxxmlresourcehandlercanhandle}
53
54\func{bool}{CanHandle}{\param{wxXmlNode* }{node}}
55
cc81d32f
VS
56Returns true if it understands this node and can create
57a resource from it, false otherwise.
d958c9bd 58
2b5f62a0
VZ
59\wxheading{Note}
60
61You must {\bf not} call any wxXmlResourceHandler methods except
62\helpref{IsOfClass}{wxxmlresourcehandlerisofclass} from this method! The instance
63is not yet initialized with node data at the time CanHandle is called and it is only
64safe to operate on {\it node} directly or to call IsOfClass.
65
d958c9bd
JS
66\membersection{wxXmlResourceHandler::CreateChildren}\label{wxxmlresourcehandlercreatechildren}
67
cc81d32f 68\func{void}{CreateChildren}{\param{wxObject* }{parent}, \param{bool }{this\_hnd\_only = false}}
d958c9bd
JS
69
70Creates children.
71
d958c9bd
JS
72\membersection{wxXmlResourceHandler::CreateChildrenPrivately}\label{wxxmlresourcehandlercreatechildrenprivately}
73
74\func{void}{CreateChildrenPrivately}{\param{wxObject* }{parent}, \param{wxXmlNode* }{rootnode = NULL}}
75
76Helper function.
77
d958c9bd
JS
78\membersection{wxXmlResourceHandler::CreateResFromNode}\label{wxxmlresourcehandlercreateresfromnode}
79
80\func{wxObject*}{CreateResFromNode}{\param{wxXmlNode* }{node}, \param{wxObject* }{parent}, \param{wxObject* }{instance = NULL}}
81
82Creates a resource from a node.
83
d958c9bd
JS
84\membersection{wxXmlResourceHandler::CreateResource}\label{wxxmlresourcehandlercreateresource}
85
86\func{wxObject*}{CreateResource}{\param{wxXmlNode* }{node}, \param{wxObject* }{parent}, \param{wxObject* }{instance}}
87
88Creates an object (menu, dialog, control, ...) from an XML node.
bd330a69 89Should check for validity. {\it parent} is a higher-level object (usually window, dialog or panel)
2edb0bde 90that is often necessary to create the resource.
bd330a69 91If {\bf instance} is non-NULL it should not create a new instance via 'new' but
d958c9bd
JS
92should rather use this one, and call its Create method.
93
d958c9bd
JS
94\membersection{wxXmlResourceHandler::DoCreateResource}\label{wxxmlresourcehandlerdocreateresource}
95
96\func{wxObject*}{DoCreateResource}{\void}
97
bd330a69 98Called from CreateResource after variables
d958c9bd
JS
99were filled.
100
6a121452
VZ
101\membersection{wxXmlResourceHandler::GetAnimation}\label{wxxmlresourcehandlergetanimation}
102
103\func{wxAnimation}{GetAnimation}{\param{const wxString\& }{param = wxT("animation")}}
104
105Creates a \helpref{animation}{wxanimation} from the filename specified in \arg{param}.
106
d958c9bd
JS
107\membersection{wxXmlResourceHandler::GetBitmap}\label{wxxmlresourcehandlergetbitmap}
108
109\func{wxBitmap}{GetBitmap}{\param{const wxString\& }{param = wxT("bitmap")}, \param{wxSize }{size = wxDefaultSize}}
110
111Gets a bitmap.
112
d958c9bd
JS
113\membersection{wxXmlResourceHandler::GetBool}\label{wxxmlresourcehandlergetbool}
114
cc81d32f 115\func{bool}{GetBool}{\param{const wxString\& }{param}, \param{bool }{defaultv = false}}
d958c9bd 116
cc81d32f 117Gets a bool flag (1, t, yes, on, true are true, everything else is false).
d958c9bd 118
d958c9bd
JS
119\membersection{wxXmlResourceHandler::GetColour}\label{wxxmlresourcehandlergetcolour}
120
984f1d84 121\func{wxColour}{GetColour}{\param{const wxString\& }{param}, \param{const wxColour\& }{default = wxNullColour}}
d958c9bd
JS
122
123Gets colour in HTML syntax (\#RRGGBB).
124
d958c9bd
JS
125\membersection{wxXmlResourceHandler::GetCurFileSystem}\label{wxxmlresourcehandlergetcurfilesystem}
126
127\func{wxFileSystem\&}{GetCurFileSystem}{\void}
128
bd330a69 129Returns the current file system.
d958c9bd
JS
130
131\membersection{wxXmlResourceHandler::GetDimension}\label{wxxmlresourcehandlergetdimension}
132
133\func{wxCoord}{GetDimension}{\param{const wxString\& }{param}, \param{wxCoord }{defaultv = 0}}
134
135Gets a dimension (may be in dialog units).
136
d958c9bd
JS
137\membersection{wxXmlResourceHandler::GetFont}\label{wxxmlresourcehandlergetfont}
138
139\func{wxFont}{GetFont}{\param{const wxString\& }{param = wxT("font")}}
140
141Gets a font.
142
d958c9bd
JS
143\membersection{wxXmlResourceHandler::GetID}\label{wxxmlresourcehandlergetid}
144
145\func{int}{GetID}{\void}
146
094eb71a 147Returns the XRCID.
d958c9bd 148
d958c9bd
JS
149\membersection{wxXmlResourceHandler::GetIcon}\label{wxxmlresourcehandlergeticon}
150
151\func{wxIcon}{GetIcon}{\param{const wxString\& }{param = wxT("icon")}, \param{wxSize }{size = wxDefaultSize}}
152
bd330a69 153Returns an icon.
d958c9bd
JS
154
155\membersection{wxXmlResourceHandler::GetLong}\label{wxxmlresourcehandlergetlong}
156
157\func{long}{GetLong}{\param{const wxString\& }{param}, \param{long }{defaultv = 0}}
158
159Gets the integer value from the parameter.
160
d958c9bd
JS
161\membersection{wxXmlResourceHandler::GetName}\label{wxxmlresourcehandlergetname}
162
163\func{wxString}{GetName}{\void}
164
165Returns the resource name.
166
d958c9bd
JS
167\membersection{wxXmlResourceHandler::GetNodeContent}\label{wxxmlresourcehandlergetnodecontent}
168
169\func{wxString}{GetNodeContent}{\param{wxXmlNode* }{node}}
170
bd330a69 171Gets node content from wxXML\_ENTITY\_NODE.
d958c9bd
JS
172
173\membersection{wxXmlResourceHandler::GetParamNode}\label{wxxmlresourcehandlergetparamnode}
174
175\func{wxXmlNode*}{GetParamNode}{\param{const wxString\& }{param}}
176
177Finds the node or returns NULL.
178
d958c9bd
JS
179\membersection{wxXmlResourceHandler::GetParamValue}\label{wxxmlresourcehandlergetparamvalue}
180
181\func{wxString}{GetParamValue}{\param{const wxString\& }{param}}
182
183Finds the parameter value or returns the empty string.
184
d958c9bd
JS
185\membersection{wxXmlResourceHandler::GetPosition}\label{wxxmlresourcehandlergetposition}
186
187\func{wxPoint}{GetPosition}{\param{const wxString\& }{param = wxT("pos")}}
188
189Gets the position (may be in dialog units).
190
d958c9bd
JS
191\membersection{wxXmlResourceHandler::GetSize}\label{wxxmlresourcehandlergetsize}
192
193\func{wxSize}{GetSize}{\param{const wxString\& }{param = wxT("size")}}
194
195Gets the size (may be in dialog units).
196
d958c9bd
JS
197\membersection{wxXmlResourceHandler::GetStyle}\label{wxxmlresourcehandlergetstyle}
198
199\func{int}{GetStyle}{\param{const wxString\& }{param = wxT("style")}, \param{int }{defaults = 0}}
200
201Gets style flags from text in form "flag | flag2| flag3 |..."
bd330a69 202Only understands flags added with AddStyle.
d958c9bd
JS
203
204\membersection{wxXmlResourceHandler::GetText}\label{wxxmlresourcehandlergettext}
205
206\func{wxString}{GetText}{\param{const wxString\& }{param}}
207
208Gets text from param and does some conversions:
209
210\begin{itemize}\itemsep=0pt
211\item replaces $\backslash$n, $\backslash$r, $\backslash$t by respective characters (according to C syntax)
7af3ca16 212\item replaces {\tt\$} by {\tt\&} and {\tt\$\$} by {\tt\$} (needed for {\tt\_File} to {\tt\&File}
d958c9bd
JS
213translation because of XML syntax)
214\item calls wxGetTranslations (unless disabled in wxXmlResource)
215\end{itemize}
216
217\membersection{wxXmlResourceHandler::HasParam}\label{wxxmlresourcehandlerhasparam}
218
219\func{bool}{HasParam}{\param{const wxString\& }{param}}
220
221Check to see if a parameter exists.
222
d958c9bd
JS
223\membersection{wxXmlResourceHandler::IsOfClass}\label{wxxmlresourcehandlerisofclass}
224
225\func{bool}{IsOfClass}{\param{wxXmlNode* }{node}, \param{const wxString\& }{classname}}
226
227Convenience function. Returns true if the node has a property class equal to classname,
228e.g. <object class="wxDialog">.
229
d958c9bd
JS
230\membersection{wxXmlResourceHandler::SetParentResource}\label{wxxmlresourcehandlersetparentresource}
231
232\func{void}{SetParentResource}{\param{wxXmlResource* }{res}}
233
234Sets the parent resource.
235
d958c9bd
JS
236\membersection{wxXmlResourceHandler::SetupWindow}\label{wxxmlresourcehandlersetupwindow}
237
238\func{void}{SetupWindow}{\param{wxWindow* }{wnd}}
239
240Sets common window options.
241