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