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