]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/xmlresh.tex
Deprecated wxSizer::Remove( wxWindow* ), s/Remove/Detach/ in most places.
[wxWidgets.git] / docs / latex / wx / xmlresh.tex
... / ...
CommitLineData
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
11See \helpref{XML-based resource system overview}{xrcoverview} for details.
12
13{\bf NOTE:} XRC is not yet a part of the core wxWindows library, so
14please see the overview for how to compile and link it. Otherwise if you
15try to use it, you will get link errors.
16
17\wxheading{Derived from}
18
19\helpref{wxObject}{wxobject}
20
21\wxheading{Include files}
22
23<wx/xrc/xmlres.h>
24
25\latexignore{\rtfignore{\wxheading{Members}}}
26
27\membersection{wxXmlResourceHandler::wxXmlResourceHandler}\label{wxxmlresourcehandlerwxxmlresourcehandler}
28
29\func{}{wxXmlResourceHandler}{\void}
30
31Default constructor.
32
33\membersection{wxXmlResourceHandler::\destruct{wxXmlResourceHandler}}\label{wxxmlresourcehandlerdtor}
34
35\func{}{\destruct{wxXmlResourceHandler}}{\void}
36
37Destructor.
38
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
46\membersection{wxXmlResourceHandler::AddWindowStyles}\label{wxxmlresourcehandleraddwindowstyles}
47
48\func{void}{AddWindowStyles}{\void}
49
50Add styles common to all wxWindow-derived classes.
51
52\membersection{wxXmlResourceHandler::CanHandle}\label{wxxmlresourcehandlercanhandle}
53
54\func{bool}{CanHandle}{\param{wxXmlNode* }{node}}
55
56Returns TRUE if it understands this node and can create
57a resource from it, FALSE otherwise.
58
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
66\membersection{wxXmlResourceHandler::CreateChildren}\label{wxxmlresourcehandlercreatechildren}
67
68\func{void}{CreateChildren}{\param{wxObject* }{parent}, \param{bool }{this\_hnd\_only = FALSE}}
69
70Creates children.
71
72\membersection{wxXmlResourceHandler::CreateChildrenPrivately}\label{wxxmlresourcehandlercreatechildrenprivately}
73
74\func{void}{CreateChildrenPrivately}{\param{wxObject* }{parent}, \param{wxXmlNode* }{rootnode = NULL}}
75
76Helper function.
77
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
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.
89Should check for validity. {\it parent} is a higher-level object (usually window, dialog or panel)
90that is often necessary to create the resource.
91If {\bf instance} is non-NULL it should not create a new instance via 'new' but
92should rather use this one, and call its Create method.
93
94\membersection{wxXmlResourceHandler::DoCreateResource}\label{wxxmlresourcehandlerdocreateresource}
95
96\func{wxObject*}{DoCreateResource}{\void}
97
98Called from CreateResource after variables
99were filled.
100
101\membersection{wxXmlResourceHandler::GetBitmap}\label{wxxmlresourcehandlergetbitmap}
102
103\func{wxBitmap}{GetBitmap}{\param{const wxString\& }{param = wxT("bitmap")}, \param{wxSize }{size = wxDefaultSize}}
104
105Gets a bitmap.
106
107\membersection{wxXmlResourceHandler::GetBool}\label{wxxmlresourcehandlergetbool}
108
109\func{bool}{GetBool}{\param{const wxString\& }{param}, \param{bool }{defaultv = FALSE}}
110
111Gets a bool flag (1, t, yes, on, true are TRUE, everything else is FALSE).
112
113\membersection{wxXmlResourceHandler::GetColour}\label{wxxmlresourcehandlergetcolour}
114
115\func{wxColour}{GetColour}{\param{const wxString\& }{param}}
116
117Gets colour in HTML syntax (\#RRGGBB).
118
119\membersection{wxXmlResourceHandler::GetCurFileSystem}\label{wxxmlresourcehandlergetcurfilesystem}
120
121\func{wxFileSystem\&}{GetCurFileSystem}{\void}
122
123Returns the current file system.
124
125\membersection{wxXmlResourceHandler::GetDimension}\label{wxxmlresourcehandlergetdimension}
126
127\func{wxCoord}{GetDimension}{\param{const wxString\& }{param}, \param{wxCoord }{defaultv = 0}}
128
129Gets a dimension (may be in dialog units).
130
131\membersection{wxXmlResourceHandler::GetFont}\label{wxxmlresourcehandlergetfont}
132
133\func{wxFont}{GetFont}{\param{const wxString\& }{param = wxT("font")}}
134
135Gets a font.
136
137\membersection{wxXmlResourceHandler::GetID}\label{wxxmlresourcehandlergetid}
138
139\func{int}{GetID}{\void}
140
141Returns the XRCID.
142
143\membersection{wxXmlResourceHandler::GetIcon}\label{wxxmlresourcehandlergeticon}
144
145\func{wxIcon}{GetIcon}{\param{const wxString\& }{param = wxT("icon")}, \param{wxSize }{size = wxDefaultSize}}
146
147Returns an icon.
148
149\membersection{wxXmlResourceHandler::GetLong}\label{wxxmlresourcehandlergetlong}
150
151\func{long}{GetLong}{\param{const wxString\& }{param}, \param{long }{defaultv = 0}}
152
153Gets the integer value from the parameter.
154
155\membersection{wxXmlResourceHandler::GetName}\label{wxxmlresourcehandlergetname}
156
157\func{wxString}{GetName}{\void}
158
159Returns the resource name.
160
161\membersection{wxXmlResourceHandler::GetNodeContent}\label{wxxmlresourcehandlergetnodecontent}
162
163\func{wxString}{GetNodeContent}{\param{wxXmlNode* }{node}}
164
165Gets node content from wxXML\_ENTITY\_NODE.
166
167\membersection{wxXmlResourceHandler::GetParamNode}\label{wxxmlresourcehandlergetparamnode}
168
169\func{wxXmlNode*}{GetParamNode}{\param{const wxString\& }{param}}
170
171Finds the node or returns NULL.
172
173\membersection{wxXmlResourceHandler::GetParamValue}\label{wxxmlresourcehandlergetparamvalue}
174
175\func{wxString}{GetParamValue}{\param{const wxString\& }{param}}
176
177Finds the parameter value or returns the empty string.
178
179\membersection{wxXmlResourceHandler::GetPosition}\label{wxxmlresourcehandlergetposition}
180
181\func{wxPoint}{GetPosition}{\param{const wxString\& }{param = wxT("pos")}}
182
183Gets the position (may be in dialog units).
184
185\membersection{wxXmlResourceHandler::GetSize}\label{wxxmlresourcehandlergetsize}
186
187\func{wxSize}{GetSize}{\param{const wxString\& }{param = wxT("size")}}
188
189Gets the size (may be in dialog units).
190
191\membersection{wxXmlResourceHandler::GetStyle}\label{wxxmlresourcehandlergetstyle}
192
193\func{int}{GetStyle}{\param{const wxString\& }{param = wxT("style")}, \param{int }{defaults = 0}}
194
195Gets style flags from text in form "flag | flag2| flag3 |..."
196Only understands flags added with AddStyle.
197
198\membersection{wxXmlResourceHandler::GetText}\label{wxxmlresourcehandlergettext}
199
200\func{wxString}{GetText}{\param{const wxString\& }{param}}
201
202Gets text from param and does some conversions:
203
204\begin{itemize}\itemsep=0pt
205\item replaces $\backslash$n, $\backslash$r, $\backslash$t by respective characters (according to C syntax)
206\item replaces {\tt\$} by {\tt\&} and {\tt\$\$} by {\tt\$} (needed for {\tt\_File} to {\tt\&File}
207translation because of XML syntax)
208\item calls wxGetTranslations (unless disabled in wxXmlResource)
209\end{itemize}
210
211\membersection{wxXmlResourceHandler::HasParam}\label{wxxmlresourcehandlerhasparam}
212
213\func{bool}{HasParam}{\param{const wxString\& }{param}}
214
215Check to see if a parameter exists.
216
217\membersection{wxXmlResourceHandler::IsOfClass}\label{wxxmlresourcehandlerisofclass}
218
219\func{bool}{IsOfClass}{\param{wxXmlNode* }{node}, \param{const wxString\& }{classname}}
220
221Convenience function. Returns true if the node has a property class equal to classname,
222e.g. <object class="wxDialog">.
223
224\membersection{wxXmlResourceHandler::SetParentResource}\label{wxxmlresourcehandlersetparentresource}
225
226\func{void}{SetParentResource}{\param{wxXmlResource* }{res}}
227
228Sets the parent resource.
229
230\membersection{wxXmlResourceHandler::SetupWindow}\label{wxxmlresourcehandlersetupwindow}
231
232\func{void}{SetupWindow}{\param{wxWindow* }{wnd}}
233
234Sets common window options.
235