]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: xrc_format.h | |
3 | // Purpose: XRC format specification | |
4 | // Author: Vaclav Slavik | |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows licence | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | ||
10 | /* | |
11 | NOTE: To make doxygen happy about <custom-tags> we're forced to | |
12 | escape all < and > symbols which appear inside a doxygen comment. | |
13 | Also, don't use < and > symbols in section titles. | |
14 | */ | |
15 | ||
16 | ||
17 | /** | |
18 | ||
19 | @page overview_xrcformat XRC File Format | |
20 | ||
21 | @tableofcontents | |
22 | ||
23 | This document describes the format of XRC resource files, as used by | |
24 | wxXmlResource. | |
25 | ||
26 | XRC file is a XML file with all of its elements in the | |
27 | @c http://www.wxwidgets.org/wxxrc namespace. For backward compatibility, | |
28 | @c http://www.wxwindows.org/wxxrc namespace is accepted as well (and treated | |
29 | as identical to @c http://www.wxwidgets.org/wxxrc), but it shouldn't be used | |
30 | in new XRC files. | |
31 | ||
32 | XRC file contains definitions for one or more @em objects -- typically | |
33 | windows. The objects may themselves contain child objects. | |
34 | ||
35 | Objects defined at the top level, under the | |
36 | @ref overview_xrcformat_root "root element", can be accessed using | |
37 | wxXmlResource::LoadDialog() and other LoadXXX methods. They must have | |
38 | @c name attribute that is used as LoadXXX's argument (see | |
39 | @ref overview_xrcformat_object for details). | |
40 | ||
41 | Child objects are not directly accessible via wxXmlResource, they can only | |
42 | be accessed using XRCCTRL(). | |
43 | ||
44 | ||
45 | ||
46 | @section overview_xrcformat_root Resource Root Element | |
47 | ||
48 | The root element is always @c \<resource\>. It has one optional attribute, @c | |
49 | version. If set, it specifies version of the file. In absence of @c version | |
50 | attribute, the default is @c "0.0.0.0". | |
51 | ||
52 | The version consists of four integers separated by periods. The first three | |
53 | components are major, minor and release number of the wxWidgets release when | |
54 | the change was introduced, the last one is revision number and is 0 for the | |
55 | first incompatible change in given wxWidgets release, 1 for the second and so | |
56 | on. The version changes only if there was an incompatible change introduced; | |
57 | merely adding new kind of objects does not constitute incompatible change. | |
58 | ||
59 | At the time of writing, the latest version is @c "2.5.3.0". | |
60 | ||
61 | Note that even though @c version attribute is optional, it should always be | |
62 | specified to take advantage of the latest capabilities: | |
63 | ||
64 | @code | |
65 | <?xml version="1.0"?> | |
66 | <resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0"> | |
67 | ... | |
68 | </resource> | |
69 | @endcode | |
70 | ||
71 | @c \<resource\> may have arbitrary number of | |
72 | @ref overview_xrcformat_objects "object elements" as its children; they are referred | |
73 | to as @em toplevel objects in the rest of this document. Unlike objects defined | |
74 | deeper in the hierarchy, toplevel objects @em must have their @c name attribute | |
75 | set and it must be set to a value unique among root's children. | |
76 | ||
77 | ||
78 | ||
79 | @section overview_xrcformat_objects Defining Objects | |
80 | ||
81 | @subsection overview_xrcformat_object Object Element | |
82 | ||
83 | The @c \<object\> element represents a single object (typically a GUI element) | |
84 | and it usually maps directly to a wxWidgets class instance. It has one | |
85 | mandatory attribute, @c class, and optional @c name and @c subclass attributes. | |
86 | ||
87 | The @c class attribute must always be present, it tells XRC what wxWidgets | |
88 | object should be created and by which wxXmlResourceHandler. | |
89 | ||
90 | @c name is the identifier used to identify the object. This name serves three | |
91 | purposes: | |
92 | ||
93 | -# It is used by wxXmlResource's various LoadXXX() methods to find the | |
94 | resource by name passed as argument. | |
95 | -# wxWindow's name (see wxWindow::GetName()) is set to it. | |
96 | -# Numeric ID of a window or menu item is derived from the name. | |
97 | If the value represents an integer (in decimal notation), it is used for | |
98 | the numeric ID unmodified. If it is one of the wxID_XXX literals defined | |
99 | by wxWidgets (see @ref page_stockitems), its respective value is used. | |
100 | Otherwise, the name is transformed into dynamically generated ID. See | |
101 | wxXmlResource::GetXRCID() for more information. | |
102 | ||
103 | Name attributes must be unique at the top level (where the name is used to | |
104 | load resources) and should be unique among all controls within the same | |
105 | toplevel window (wxDialog, wxFrame). | |
106 | ||
107 | The @c subclass attribute optional name of class whose constructor will be | |
108 | called instead of the constructor for "class". | |
109 | See @ref overview_xrcformat_extending_subclass for more details. | |
110 | ||
111 | @c \<object\> element may -- and almost always do -- have children elements. | |
112 | These come in two varieties: | |
113 | ||
114 | -# Object's properties. A @em property is a value describing part of object's | |
115 | behaviour, for example the "label" property on wxButton defines its label. | |
116 | In the most common form, property is a single element with text content | |
117 | ("\<label\>Cancel\</label\>"), but they may use nested subelements too (e.g. | |
118 | @ref overview_xrcformat_type_font "font property"). A property can only be | |
119 | listed once in an object's definition. | |
120 | -# Child objects. Window childs, sizers, sizer items or notebook pages | |
121 | are all examples of child objects. They are represented using nested | |
122 | @c \<object\> elements and are can be repeated more than once. The specifics | |
123 | of which object classes are allowed as children are class-specific and | |
124 | are documented below in @ref overview_xrcformat_controls. | |
125 | ||
126 | Example: | |
127 | @code | |
128 | <object class="wxDialog" name="example_dialog"> | |
129 | <!-- properties: --> | |
130 | <title>Non-Derived Dialog Example</title> | |
131 | <centered>1</centered> | |
132 | <!-- child objects: --> | |
133 | <object class="wxBoxSizer"> | |
134 | <orient>wxVERTICAL</orient> | |
135 | <cols>1</cols> | |
136 | <rows>0</rows> | |
137 | ... | |
138 | </object> | |
139 | </object> | |
140 | @endcode | |
141 | ||
142 | ||
143 | @subsection overview_xrcformat_object_ref Object References | |
144 | ||
145 | Anywhere an @c \<object\> element can be used, @c \<object_ref\> may be used | |
146 | instead. @c \<object_ref\> is a @em reference to another named (i.e. with the | |
147 | @c name attribute) @c \<object\> element. It has one mandatory attribute, | |
148 | @c ref, with value containing the name of a named @c \<object\> element. When an | |
149 | @c \<object_ref\> is encountered, a copy of the referenced @c \<object\> element | |
150 | is made in place of @c \<object_ref\> occurrence and processed as usual. | |
151 | ||
152 | For example, the following code: | |
153 | @code | |
154 | <object class="wxDialog" name="my_dlg"> | |
155 | ... | |
156 | </object> | |
157 | <object_ref name="my_dlg_alias" ref="my_dlg"/> | |
158 | @endcode | |
159 | is equivalent to | |
160 | @code | |
161 | <object class="wxDialog" name="my_dlg"> | |
162 | ... | |
163 | </object> | |
164 | <object class="wxDialog" name="my_dlg_alias"> | |
165 | ... <!-- same as in my_dlg --> | |
166 | </object> | |
167 | @endcode | |
168 | ||
169 | Additionally, it is possible to override some parts of the referenced object | |
170 | in the @c \<object_ref\> pointing to it. This is useful for putting repetitive | |
171 | parts of XRC definitions into a template that can be reused and customized in | |
172 | several places. The two parts are merged as follows: | |
173 | ||
174 | -# The referred object is used as the initial content. | |
175 | -# All attributes set on @c \<object_ref\> are added to it. | |
176 | -# All child elements of @c \<object_ref\> are scanned. If an element with | |
177 | the same name (and, if specified, the @c name attribute too) is found | |
178 | in the referred object, they are recursively merged. | |
179 | -# Child elements in @c \<object_ref\> that do not have a match in the referred | |
180 | object are appended to the list of children of the resulting element by | |
181 | default. Optionally, they may have @c insert_at attribute with two possible | |
182 | values, "begin" or "end". When set to "begin", the element is prepended to | |
183 | the list of children instead of appended. | |
184 | ||
185 | For example, "my_dlg" in this snippet: | |
186 | @code | |
187 | <object class="wxDialog" name="template"> | |
188 | <title>Dummy dialog</title> | |
189 | <size>400,400</size> | |
190 | </object> | |
191 | <object_ref ref="template" name="my_dlg"> | |
192 | <title>My dialog</title> | |
193 | <centered>1</centered> | |
194 | </object_ref> | |
195 | @endcode | |
196 | is identical to: | |
197 | @code | |
198 | <object class="wxDialog" name="my_dlg"> | |
199 | <title>My dialog</title> | |
200 | <size>400,400</size> | |
201 | <centered>1</centered> | |
202 | </object> | |
203 | @endcode | |
204 | ||
205 | ||
206 | @section overview_xrcformat_datatypes Data Types | |
207 | ||
208 | There are several property data types that are frequently reused by different | |
209 | properties. Rather than describing their format in the documentation of | |
210 | every property, we list commonly used types in this section and document | |
211 | their format. | |
212 | ||
213 | ||
214 | @subsection overview_xrcformat_type_bool Boolean | |
215 | ||
216 | Boolean values are expressed using either "1" literal (true) or "0" (false). | |
217 | ||
218 | ||
219 | @subsection overview_xrcformat_type_float Floating-point value | |
220 | ||
221 | Floating point values use POSIX (C locale) formatting -- decimal separator | |
222 | is "." regardless of the locale. | |
223 | ||
224 | ||
225 | @subsection overview_xrcformat_type_colour Colour | |
226 | ||
227 | Colour specification can be either any string colour representation accepted | |
228 | by wxColour::Set() or any wxSYS_COLOUR_XXX symbolic name accepted by | |
229 | wxSystemSettings::GetColour(). In particular, the following forms are supported: | |
230 | ||
231 | @li named colours from wxColourDatabase | |
232 | @li HTML-like "#rrggbb" syntax (but not "#rgb") | |
233 | @li CSS-style "rgb(r,g,b)" and "rgba(r,g,b,a)" | |
234 | @li wxSYS_COLOUR_XXX symbolic names | |
235 | ||
236 | Some examples: | |
237 | @code | |
238 | <fg>red</fg> | |
239 | <fg>#ff0000</fg> | |
240 | <fg>rgb(255,0,0)</fg> | |
241 | <fg>wxSYS_COLOUR_HIGHLIGHT</fg> | |
242 | @endcode | |
243 | ||
244 | ||
245 | @subsection overview_xrcformat_type_size Size | |
246 | ||
247 | Sizes and positions have the form of string with two comma-separated integer | |
248 | components, with optional "d" suffix. Semi-formally: | |
249 | ||
250 | size := x "," y ["d"] | |
251 | ||
252 | where x and y are integers. Either of the components (or both) may be "-1" to | |
253 | signify default value. As a shortcut, empty string is equivalent to "-1,-1" | |
254 | (= wxDefaultSize or wxDefaultPosition). | |
255 | ||
256 | When the "d" suffix is used, integer values are interpreted as | |
257 | @ref wxWindow::ConvertDialogToPixels() "dialog units" in the parent window. | |
258 | ||
259 | Examples: | |
260 | @code | |
261 | 42,-1 | |
262 | 100,100 | |
263 | 100,50d | |
264 | @endcode | |
265 | ||
266 | @subsection overview_xrcformat_type_pos Position | |
267 | ||
268 | Same as @ref overview_xrcformat_type_size. | |
269 | ||
270 | ||
271 | @subsection overview_xrcformat_type_dimension Dimension | |
272 | ||
273 | Similarly to @ref overview_xrcformat_type_size "sizes", dimensions are expressed | |
274 | as integers with optional "d" suffix. When "d" suffix is used, the integer | |
275 | preceding it is interpreted as dialog units in the parent window. | |
276 | ||
277 | ||
278 | @subsection overview_xrcformat_type_text Text | |
279 | ||
280 | String properties use several escape sequences that are translated according to | |
281 | the following table: | |
282 | @beginDefList | |
283 | @itemdef{ "_", "&" (used for accelerators in wxWidgets) } | |
284 | @itemdef{ "__", "_" } | |
285 | @itemdef{ "\n", line break } | |
286 | @itemdef{ "\r", carriage return } | |
287 | @itemdef{ "\t", tab } | |
288 | @itemdef{ "\\", "\" } | |
289 | @endDefList | |
290 | ||
291 | By default, the text is translated using wxLocale::GetTranslation() before | |
292 | it is used. This can be disabled either globally by not passing | |
293 | wxXRC_USE_LOCALE to wxXmlResource constructor, or by setting the @c translate | |
294 | attribute on the property node to "0": | |
295 | @code | |
296 | <!-- this is not translated: --> | |
297 | <label translate="0">_Unix</label> | |
298 | <!-- but this is: --> | |
299 | <help>Use Unix-style newlines</help> | |
300 | @endcode | |
301 | ||
302 | @note Even though the "_" character is used instead of "&" for accelerators, | |
303 | it is still possible to use "&". The latter has to be encoded as "&", | |
304 | though, so using "_" is more convenient. | |
305 | ||
306 | @see @ref overview_xrcformat_pre_v2530, @ref overview_xrcformat_pre_v2301 | |
307 | ||
308 | ||
309 | @subsection overview_xrcformat_type_text_notrans Non-Translatable Text | |
310 | ||
311 | Like @ref overview_xrcformat_type_text, but the text is never translated and | |
312 | @c translate attribute cannot be used. | |
313 | ||
314 | ||
315 | @subsection overview_xrcformat_type_string String | |
316 | ||
317 | An unformatted string. Unlike with @ref overview_xrcformat_type_text, no escaping | |
318 | or translations are done. | |
319 | ||
320 | ||
321 | @subsection overview_xrcformat_type_url URL | |
322 | ||
323 | Any URL accepted by wxFileSystem (typically relative to XRC file's location, | |
324 | but can be absolute too). Unlike with @ref overview_xrcformat_type_text, no escaping | |
325 | or translations are done. | |
326 | ||
327 | ||
328 | @subsection overview_xrcformat_type_bitmap Bitmap | |
329 | ||
330 | Bitmap properties contain specification of a single bitmap or icon. In the most | |
331 | basic form, their text value is simply a relative filename (or another | |
332 | wxFileSystem URL) of the bitmap to use. For example: | |
333 | @code | |
334 | <object class="tool" name="wxID_NEW"> | |
335 | <tooltip>New</tooltip> | |
336 | <bitmap>new.png</bitmap> | |
337 | </object> | |
338 | @endcode | |
339 | The value is interpreted as path relative to the location of XRC file where the | |
340 | reference occurs. | |
341 | ||
342 | Alternatively, it is possible to specify the bitmap using wxArtProvider IDs. | |
343 | In this case, the property element has no textual value (filename) and instead | |
344 | has the @c stock_id XML attribute that contains stock art ID as accepted by | |
345 | wxArtProvider::GetBitmap(). This can be either custom value (if the app uses | |
346 | app-specific art provider) or one of the predefined wxART_XXX constants. | |
347 | ||
348 | Optionally, @c stock_client attribute may be specified too and contain one of | |
349 | the predefined wxArtClient values. If it is not specified, the default client | |
350 | ID most appropriate in the context where the bitmap is referenced will be used. | |
351 | In most cases, specifying @c stock_client is not needed. | |
352 | ||
353 | Examples of stock bitmaps usage: | |
354 | @code | |
355 | <bitmap stock_id="fixed-width"/> <!-- custom app-specific art --> | |
356 | <bitmap stock_id="wxART_FILE_OPEN"/> <!-- standard art --> | |
357 | @endcode | |
358 | ||
359 | Specifying the bitmap directly and using @c stock_id are mutually exclusive. | |
360 | ||
361 | ||
362 | @subsection overview_xrcformat_type_style Style | |
363 | ||
364 | Style properties (such as window's style or sizer flags) use syntax similar to | |
365 | C++: the style value is OR-combination of individual flags. Symbolic names | |
366 | identical to those used in C++ code are used for the flags. Flags are separated | |
367 | with "|" (whitespace is allowed but not required around it). | |
368 | ||
369 | The flags that are allowed for a given property are context-dependent. | |
370 | ||
371 | Examples: | |
372 | @code | |
373 | <style>wxCAPTION|wxSYSTEM_MENU | wxRESIZE_BORDER</style> | |
374 | <exstyle>wxDIALOG_EX_CONTEXTHELP</exstyle> | |
375 | @endcode | |
376 | ||
377 | ||
378 | @subsection overview_xrcformat_type_font Font | |
379 | ||
380 | XRC uses similar, but more flexible, abstract description of fonts to that | |
381 | used by wxFont class. A font can be described either in terms of its elementary | |
382 | properties, or it can be derived from one of system fonts or the parent window | |
383 | font. | |
384 | ||
385 | The font property element is "composite" element: unlike majority of | |
386 | properties, it doesn't have text value but contains several child elements | |
387 | instead. These children are handled in the same way as object properties | |
388 | and can be one of the following "sub-properties": | |
389 | ||
390 | @beginTable | |
391 | @hdr3col{property, type, description} | |
392 | @row3col{size, unsigned integer, | |
393 | Pixel size of the font (default: wxNORMAL_FONT's size or @c sysfont's | |
394 | size if the @c sysfont property is used or the current size of the font | |
395 | of the enclosing control if the @c inherit property is used.} | |
396 | @row3col{style, enum, | |
397 | One of "normal", "italic" or "slant" (default: normal).} | |
398 | @row3col{weight, enum, | |
399 | One of "normal", "bold" or "light" (default: normal).} | |
400 | @row3col{family, enum, | |
401 | One of "roman", "script", "decorative", "swiss", "modern" or "teletype" | |
402 | (default: roman).} | |
403 | @row3col{underlined, @ref overview_xrcformat_type_bool, | |
404 | Whether the font should be underlined (default: 0).} | |
405 | @row3col{face, , | |
406 | Comma-separated list of face names; the first one available is used | |
407 | (default: unspecified).} | |
408 | @row3col{encoding, , | |
409 | Charset of the font, unused in Unicode build), as string | |
410 | (default: unspecified).} | |
411 | @row3col{sysfont, , | |
412 | Symbolic name of system standard font(one of wxSYS_*_FONT constants).} | |
413 | @row3col{inherit, @ref overview_xrcformat_type_bool, | |
414 | If true, the font of the enclosing control is used. If this property and the | |
415 | @c sysfont property are specified the @c sysfont property takes precedence.} | |
416 | @row3col{relativesize, float, | |
417 | Float, font size relative to chosen system font's or inherited font's size; | |
418 | can only be used when 'sysfont' or 'inherit' is used and when 'size' is not | |
419 | used.} | |
420 | @endTable | |
421 | ||
422 | All of them are optional, if they are missing, appropriate wxFont default is | |
423 | used. If the @c sysfont or @c inherit property is used, then the defaults are | |
424 | taken from it instead. | |
425 | ||
426 | Examples: | |
427 | @code | |
428 | <font> | |
429 | <!-- fixed font: Arial if available, fall back to Helvetica --> | |
430 | <face>arial,helvetica</face> | |
431 | <size>12</size> | |
432 | </font> | |
433 | ||
434 | <font> | |
435 | <!-- enlarged, enboldened standard font: --> | |
436 | <sysfont>wxSYS_DEFAULT_GUI_FONT</sysfont> | |
437 | <weight>bold</weight> | |
438 | <relativesize>1.5</relativesize> | |
439 | </font> | |
440 | @endcode | |
441 | ||
442 | @note You cannot use @c inherit for a font that gets used before the enclosing | |
443 | control is created, e.g. if the control gets the font passed as parameter | |
444 | for its constructor, or if the control is not derived from wxWindow. | |
445 | ||
446 | ||
447 | @section overview_xrcformat_windows Controls and Windows | |
448 | ||
449 | This section describes support wxWindow-derived classes in XRC format. | |
450 | ||
451 | @subsection overview_xrcformat_std_props Standard Properties | |
452 | ||
453 | The following properties are always (unless stated otherwise in | |
454 | control-specific docs) available for @em windows objects. They are omitted | |
455 | from properties lists below. | |
456 | ||
457 | @beginTable | |
458 | @hdr3col{property, type, description} | |
459 | @row3col{pos, @ref overview_xrcformat_type_pos, | |
460 | Initial position of the window (default: wxDefaultPosition).} | |
461 | @row3col{size, @ref overview_xrcformat_type_size, | |
462 | Initial size of the window (default: wxDefaultSize).} | |
463 | @row3col{style, @ref overview_xrcformat_type_style, | |
464 | Window style for this control. The allowed values depend on what | |
465 | window is being created, consult respective class' constructor | |
466 | documentation for details (default: window-dependent default, usually | |
467 | wxFOO_DEFAULT_STYLE if defined for class wxFoo, 0 if not).} | |
468 | @row3col{exstyle, @ref overview_xrcformat_type_style, | |
469 | Extra style for the window, if any. See wxWindow::SetExtraStyle() | |
470 | (default: not set).} | |
471 | @row3col{fg, @ref overview_xrcformat_type_colour, | |
472 | Foreground colour of the window (default: window's default).} | |
473 | @row3col{ownfg, @ref overview_xrcformat_type_colour, | |
474 | Non-inheritable foreground colour of the window, see | |
475 | wxWindow::SetOwnForegroundColour() (default: none).} | |
476 | @row3col{bg, @ref overview_xrcformat_type_colour, | |
477 | Background colour of the window (default: window's default).} | |
478 | @row3col{ownbg, @ref overview_xrcformat_type_colour, | |
479 | Non-inheritable background colour of the window, see | |
480 | wxWindow::SetOwnBackgroundColour() (default: none).} | |
481 | @row3col{enabled, @ref overview_xrcformat_type_bool, | |
482 | If set to 0, the control is disabled (default: 1).} | |
483 | @row3col{hidden, @ref overview_xrcformat_type_bool, | |
484 | If set to 1, the control is created hidden (default: 0).} | |
485 | @row3col{tooltip, @ref overview_xrcformat_type_text, | |
486 | Tooltip to use for the control (default: not set).} | |
487 | @row3col{font, @ref overview_xrcformat_type_font, | |
488 | Font to use for the control (default: window's default).} | |
489 | @row3col{ownfont, @ref overview_xrcformat_type_font, | |
490 | Non-inheritable font to use for the control, see | |
491 | wxWindow::SetOwnFont() (default: none).} | |
492 | @row3col{help, @ref overview_xrcformat_type_text, | |
493 | Context-sensitive help for the control, used by wxHelpProvider | |
494 | (default: not set).} | |
495 | @endTable | |
496 | ||
497 | All of these properties are optional. | |
498 | ||
499 | ||
500 | @subsection overview_xrcformat_controls Supported Controls | |
501 | ||
502 | This section lists all controls supported by default. For each control, its | |
503 | control-specific properties are listed. If the control can have child objects, | |
504 | it is documented there too; unless said otherwise, XRC elements for these | |
505 | controls cannot have children. | |
506 | ||
507 | @subsubsection xrc_wxanimationctrl wxAnimationCtrl | |
508 | ||
509 | @beginTable | |
510 | @hdr3col{property, type, description} | |
511 | @row3col{animation, @ref overview_xrcformat_type_url, | |
512 | Animation file to load into the control (required).} | |
513 | @endTable | |
514 | ||
515 | ||
516 | @subsubsection xrc_wxauinotebook wxAuiNotebook | |
517 | ||
518 | A wxAuiNotebook can have one or more child objects of the @c notebookpage | |
519 | pseudo-class. | |
520 | @c notebookpage objects have the following properties: | |
521 | ||
522 | @beginTable | |
523 | @hdr3col{property, type, description} | |
524 | @row3col{label, @ref overview_xrcformat_type_text, | |
525 | Page label (required).} | |
526 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
527 | Bitmap shown alongside the label (default: none).} | |
528 | @row3col{selected, @ref overview_xrcformat_type_bool, | |
529 | Is the page selected initially (only one page can be selected; default: 0)?} | |
530 | @endTable | |
531 | ||
532 | Each @c notebookpage must have exactly one non-toplevel window as its child. | |
533 | ||
534 | Example: | |
535 | @code | |
536 | <object class="wxAuiNotebook"> | |
537 | <style>wxBK_BOTTOM</style> | |
538 | <object class="notebookpage"> | |
539 | <label>Page 1</label> | |
540 | <bitmap>bitmap.png</bitmap> | |
541 | <object class="wxPanel" name="page_1"> | |
542 | ... | |
543 | </object> | |
544 | </object> | |
545 | </object> | |
546 | @endcode | |
547 | ||
548 | Notice that wxAuiNotebook support in XRC is available in wxWidgets 2.9.5 and | |
549 | later only and you need to explicitly register its handler using | |
550 | @code | |
551 | #include <wx/xrc/xh_auinotbk.h> | |
552 | ||
553 | AddHandler(new wxAuiNotebookXmlHandler); | |
554 | @endcode | |
555 | to use it. | |
556 | ||
557 | ||
558 | @subsubsection xrc_wxbannerwindow wxBannerWindow | |
559 | ||
560 | @beginTable | |
561 | @hdr3col{property, type, description} | |
562 | @row3col{direction, @c wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, | |
563 | The side along which the banner will be positioned.} | |
564 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
565 | Bitmap to use as the banner background.} | |
566 | @row3col{title, @ref overview_xrcformat_type_text, | |
567 | Banner title, should be single line.} | |
568 | @row3col{message, @ref overview_xrcformat_type_text, | |
569 | Possibly multi-line banner message.} | |
570 | @row3col{gradient-start, @ref overview_xrcformat_type_colour, | |
571 | Starting colour of the gradient used as banner background. Can't be used if | |
572 | a valid bitmap is specified.} | |
573 | @row3col{gradient-end, @ref overview_xrcformat_type_colour, | |
574 | End colour of the gradient used as banner background. Can't be used if | |
575 | a valid bitmap is specified.} | |
576 | @endTable | |
577 | ||
578 | ||
579 | @subsubsection xrc_wxbitmapbutton wxBitmapButton | |
580 | ||
581 | @beginTable | |
582 | @hdr3col{property, type, description} | |
583 | @row3col{default, @ref overview_xrcformat_type_bool, | |
584 | Should this button be the default button in dialog (default: 0)?} | |
585 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
586 | Bitmap to show on the button (required).} | |
587 | @row3col{selected, @ref overview_xrcformat_type_bitmap, | |
588 | Bitmap to show when the button is selected (default: none, same as @c bitmap).} | |
589 | @row3col{focus, @ref overview_xrcformat_type_bitmap, | |
590 | Bitmap to show when the button has focus (default: none, same as @c bitmap).} | |
591 | @row3col{disabled, @ref overview_xrcformat_type_bitmap, | |
592 | Bitmap to show when the button is disabled (default: none, same as @c bitmap).} | |
593 | @row3col{hover, @ref overview_xrcformat_type_bitmap, | |
594 | Bitmap to show when mouse cursor hovers above the bitmap (default: none, same as @c bitmap).} | |
595 | @endTable | |
596 | ||
597 | ||
598 | @subsubsection xrc_wxbitmapcombobox wxBitmapComboBox | |
599 | ||
600 | @beginTable | |
601 | @hdr3col{property, type, description} | |
602 | @row3col{selection, integer, | |
603 | Index of the initially selected item or -1 for no selection (default: -1).} | |
604 | @row3col{value, @ref overview_xrcformat_type_string, | |
605 | Initial value in the control (doesn't have to be one of @ content values; | |
606 | default: empty).} | |
607 | @endTable | |
608 | ||
609 | If both @c value and @c selection are specified and @c selection is not -1, | |
610 | then @c selection takes precedence. | |
611 | ||
612 | A wxBitmapComboBox can have one or more child objects of the @c ownerdrawnitem | |
613 | pseudo-class. @c ownerdrawnitem objects have the following properties: | |
614 | ||
615 | @beginTable | |
616 | @hdr3col{property, type, description} | |
617 | @row3col{text, @ref overview_xrcformat_type_text, | |
618 | Item's label (required).} | |
619 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
620 | Item's bitmap (default: no bitmap).} | |
621 | @endTable | |
622 | ||
623 | Example: | |
624 | @code | |
625 | <object class="wxBitmapComboBox"> | |
626 | <selection>1</selection> | |
627 | <object class="ownerdrawnitem"> | |
628 | <text>Foo</text> | |
629 | <bitmap>foo.png</bitmap> | |
630 | </object> | |
631 | <object class="ownerdrawnitem"> | |
632 | <text>Bar</text> | |
633 | <bitmap>bar.png</bitmap> | |
634 | </object> | |
635 | </object> | |
636 | @endcode | |
637 | ||
638 | ||
639 | @subsubsection xrc_wxbitmaptogglebutton wxBitmapToggleButton | |
640 | ||
641 | @beginTable | |
642 | @hdr3col{property, type, description} | |
643 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
644 | Label to display on the button (required).} | |
645 | @row3col{checked, @ref overview_xrcformat_type_bool, | |
646 | Should the button be checked/pressed initially (default: 0)?} | |
647 | @endTable | |
648 | ||
649 | ||
650 | @subsubsection xrc_wxbutton wxButton | |
651 | ||
652 | @beginTable | |
653 | @hdr3col{property, type, description} | |
654 | @row3col{label, @ref overview_xrcformat_type_text, | |
655 | Label to display on the button (may be empty if only bitmap is used).} | |
656 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
657 | Bitmap to display in the button (optional).} | |
658 | @row3col{bitmapposition, @c wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, | |
659 | Position of the bitmap in the button, see wxButton::SetBitmapPosition().} | |
660 | @row3col{default, @ref overview_xrcformat_type_bool, | |
661 | Should this button be the default button in dialog (default: 0)?} | |
662 | @endTable | |
663 | ||
664 | ||
665 | @subsubsection xrc_wxcalendarctrl wxCalendarCtrl | |
666 | ||
667 | No additional properties. | |
668 | ||
669 | ||
670 | @subsubsection xrc_wxcheckbox wxCheckBox | |
671 | ||
672 | @beginTable | |
673 | @hdr3col{property, type, description} | |
674 | @row3col{label, @ref overview_xrcformat_type_text, | |
675 | Label to use for the checkbox (required).} | |
676 | @row3col{checked, @ref overview_xrcformat_type_bool, | |
677 | Should the checkbox be checked initially (default: 0)?} | |
678 | @endTable | |
679 | ||
680 | ||
681 | @subsubsection xrc_wxchecklistbox wxCheckListBox | |
682 | ||
683 | @beginTable | |
684 | @hdr3col{property, type, description} | |
685 | @row3col{content, items, | |
686 | Content of the control; this property has any number of @c \<item\> XML | |
687 | elements as its children, with the items text as their text values | |
688 | (default: empty).} | |
689 | @endTable | |
690 | ||
691 | The @c \<item\> elements have listbox items' labels as their text values. They | |
692 | can also have optional @c checked XML attribute -- if set to "1", the value is | |
693 | initially checked. | |
694 | ||
695 | Example: | |
696 | @code | |
697 | <object class="wxCheckListBox"> | |
698 | <content> | |
699 | <item checked="1">Download library</item> | |
700 | <item checked="1">Compile samples</item> | |
701 | <item checked="1">Skim docs</item> | |
702 | <item checked="1">Finish project</item> | |
703 | <item>Wash car</item> | |
704 | </content> | |
705 | </object> | |
706 | @endcode | |
707 | ||
708 | ||
709 | @subsubsection xrc_wxchoice wxChoice | |
710 | ||
711 | @beginTable | |
712 | @hdr3col{property, type, description} | |
713 | @row3col{selection, integer, | |
714 | Index of the initially selected item or -1 for no selection (default: -1).} | |
715 | @row3col{content, items, | |
716 | Content of the control; this property has any number of @c \<item\> XML | |
717 | elements as its children, with the items text as their text values | |
718 | (default: empty).} | |
719 | @endTable | |
720 | ||
721 | Example: | |
722 | @code | |
723 | <object class="wxChoice" name="controls_choice"> | |
724 | <content> | |
725 | <item>See</item> | |
726 | <item>Hear</item> | |
727 | <item>Feel</item> | |
728 | <item>Smell</item> | |
729 | <item>Taste</item> | |
730 | <item>The Sixth Sense!</item> | |
731 | </content> | |
732 | </object> | |
733 | @endcode | |
734 | ||
735 | ||
736 | @subsubsection xrc_wxchoicebook wxChoicebook | |
737 | ||
738 | A choicebook can have one or more child objects of the @c choicebookpage | |
739 | pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its | |
740 | @c notebookpage) and one child object of the @ref xrc_wximagelist class. | |
741 | @c choicebookpage objects have the following properties: | |
742 | ||
743 | @beginTable | |
744 | @hdr3col{property, type, description} | |
745 | @row3col{label, @ref overview_xrcformat_type_text, | |
746 | Sheet page's title (required).} | |
747 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
748 | Bitmap shown alongside the label (default: none).} | |
749 | @row3col{image, integer, | |
750 | The zero-based index of the image associated with the item | |
751 | into the image list.} | |
752 | @row3col{selected, @ref overview_xrcformat_type_bool, | |
753 | Is the page selected initially (only one page can be selected; default: 0)?} | |
754 | @endTable | |
755 | ||
756 | Each @c choicebookpage has exactly one non-toplevel window as its child. | |
757 | ||
758 | ||
759 | @subsubsection xrc_wxcommandlinkbutton wxCommandLinkButton | |
760 | ||
761 | The wxCommandLinkButton contains a main title-like @c label and an optional | |
762 | @c note for longer description. The main @c label and the @c note can be | |
763 | concatenated into a single string using a new line character between them | |
764 | (notice that the @c note part can have more new lines in it). | |
765 | ||
766 | @beginTable | |
767 | @hdr3col{property, type, description} | |
768 | @row3col{label, @ref overview_xrcformat_type_text, | |
769 | First line of text on the button, typically the label of an action that | |
770 | will be made when the button is pressed. } | |
771 | @row3col{note, @ref overview_xrcformat_type_text, | |
772 | Second line of text describing the action performed when the button is pressed. } | |
773 | @endTable | |
774 | ||
775 | ||
776 | @subsubsection xrc_wxcollapsiblepane wxCollapsiblePane | |
777 | ||
778 | @beginTable | |
779 | @hdr3col{property, type, description} | |
780 | @row3col{label, @ref overview_xrcformat_type_text, | |
781 | Label to use for the collapsible section (required).} | |
782 | @row3col{collapsed, @ref overview_xrcformat_type_bool, | |
783 | Should the pane be collapsed initially (default: 0)?} | |
784 | @endTable | |
785 | ||
786 | wxCollapsiblePane may contain single optional child object of the @c panewindow | |
787 | pseudo-class type. @c panewindow itself must contain exactly one child that | |
788 | is a @ref overview_xrcformat_sizers "sizer" or a non-toplevel window | |
789 | object. | |
790 | ||
791 | ||
792 | @subsubsection xrc_wxcolourpickerctrl wxColourPickerCtrl | |
793 | ||
794 | @beginTable | |
795 | @hdr3col{property, type, description} | |
796 | @row3col{value, @ref overview_xrcformat_type_colour, | |
797 | Initial value of the control (default: wxBLACK).} | |
798 | @endTable | |
799 | ||
800 | ||
801 | @subsubsection xrc_wxcombobox wxComboBox | |
802 | ||
803 | @beginTable | |
804 | @hdr3col{property, type, description} | |
805 | @row3col{selection, integer, | |
806 | Index of the initially selected item or -1 for no selection (default: not used).} | |
807 | @row3col{content, items, | |
808 | Content of the control; this property has any number of @c \<item\> XML | |
809 | elements as its children, with the items text as their text values | |
810 | (default: empty).} | |
811 | @row3col{value, @ref overview_xrcformat_type_string, | |
812 | Initial value in the control (doesn't have to be one of @ content values; | |
813 | default: empty).} | |
814 | @endTable | |
815 | ||
816 | If both @c value and @c selection are specified and @c selection is not -1, | |
817 | then @c selection takes precedence. | |
818 | ||
819 | Example: | |
820 | @code | |
821 | <object class="wxComboBox" name="controls_combobox"> | |
822 | <style>wxCB_DROPDOWN</style> | |
823 | <value>nedit</value> | |
824 | <content> | |
825 | <item>vim</item> | |
826 | <item>emacs</item> | |
827 | <item>notepad.exe</item> | |
828 | <item>bbedit</item> | |
829 | </content> | |
830 | </object> | |
831 | @endcode | |
832 | ||
833 | @subsubsection xrc_wxdatepickerctrl wxDatePickerCtrl | |
834 | ||
835 | No additional properties. | |
836 | ||
837 | ||
838 | @subsubsection xrc_wxdialog wxDialog | |
839 | ||
840 | @beginTable | |
841 | @hdr3col{property, type, description} | |
842 | @row3col{title, @ref overview_xrcformat_type_text, | |
843 | Dialog's title (default: empty).} | |
844 | @row3col{icon, @ref overview_xrcformat_type_bitmap, | |
845 | Dialog's icon (default: not used).} | |
846 | @row3col{centered, @ref overview_xrcformat_type_bool, | |
847 | Whether the dialog should be centered on the screen (default: 0).} | |
848 | @endTable | |
849 | ||
850 | wxDialog may have optional children: either exactly one | |
851 | @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window | |
852 | objects. If sizer child is used, it sets | |
853 | @ref wxSizer::SetSizeHints() "size hints" too. | |
854 | ||
855 | @subsubsection xrc_wxdirpickerctrl wxDirPickerCtrl | |
856 | ||
857 | @beginTable | |
858 | @hdr3col{property, type, description} | |
859 | @row3col{value, @ref overview_xrcformat_type_string, | |
860 | Initial value of the control (default: empty).} | |
861 | @row3col{message, @ref overview_xrcformat_type_text, | |
862 | Message shown to the user in wxDirDialog shown by the control (required).} | |
863 | @endTable | |
864 | ||
865 | ||
866 | @subsubsection xrc_wxfilectrl wxFileCtrl | |
867 | ||
868 | @beginTable | |
869 | @hdr3col{property, type, description} | |
870 | @row3col{defaultdirectory, @ref overview_xrcformat_type_string, | |
871 | Sets the current directory displayed in the control. } | |
872 | @row3col{defaultfilename, @ref overview_xrcformat_type_string, | |
873 | Selects a certain file.} | |
874 | @row3col{wildcard, @ref overview_xrcformat_type_string, | |
875 | Sets the wildcard, which can contain multiple file types, for example: | |
876 | "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".} | |
877 | @endTable | |
878 | ||
879 | ||
880 | @subsubsection xrc_wxfilepickerctrl wxFilePickerCtrl | |
881 | ||
882 | @beginTable | |
883 | @hdr3col{property, type, description} | |
884 | @row3col{value, @ref overview_xrcformat_type_string, | |
885 | Initial value of the control (default: empty).} | |
886 | @row3col{message, @ref overview_xrcformat_type_text, | |
887 | Message shown to the user in wxDirDialog shown by the control (required).} | |
888 | @row3col{wildcard, @ref overview_xrcformat_type_string, | |
889 | Sets the wildcard, which can contain multiple file types, for example: | |
890 | "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".} | |
891 | @endTable | |
892 | ||
893 | ||
894 | @subsubsection xrc_wxfontpickerctrl wxFontPickerCtrl | |
895 | ||
896 | @beginTable | |
897 | @hdr3col{property, type, description} | |
898 | @row3col{value, @ref overview_xrcformat_type_font, | |
899 | Initial value of the control (default: wxNORMAL_FONT).} | |
900 | @endTable | |
901 | ||
902 | @subsubsection xrc_wxfrane wxFrame | |
903 | ||
904 | @beginTable | |
905 | @hdr3col{property, type, description} | |
906 | @row3col{title, @ref overview_xrcformat_type_text, | |
907 | Frame's title (default: empty).} | |
908 | @row3col{icon, @ref overview_xrcformat_type_bitmap, | |
909 | Frame's icon (default: not used).} | |
910 | @row3col{centered, @ref overview_xrcformat_type_bool, | |
911 | Whether the frame should be centered on the screen (default: 0).} | |
912 | @endTable | |
913 | ||
914 | wxFrame may have optional children: either exactly one | |
915 | @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window | |
916 | objects. If sizer child is used, it sets | |
917 | @ref wxSizer::SetSizeHints() "size hints" too. | |
918 | ||
919 | ||
920 | @subsubsection xrc_wxgauge wxGauge | |
921 | ||
922 | @beginTable | |
923 | @hdr3col{property, type, description} | |
924 | @row3col{range, integer, | |
925 | Maximum value of the gauge (default: 100).} | |
926 | @row3col{value, integer, | |
927 | Initial value of the control (default: 0).} | |
928 | @row3col{shadow, @ref overview_xrcformat_type_dimension, | |
929 | Rendered shadow size (default: none; ignored by most platforms).} | |
930 | @row3col{bezel, @ref overview_xrcformat_type_dimension, | |
931 | Rendered bezel size (default: none; ignored by most platforms).} | |
932 | @endTable | |
933 | ||
934 | @subsubsection xrc_wxgenericdirctrl wxGenericDirCtrl | |
935 | ||
936 | @beginTable | |
937 | @hdr3col{property, type, description} | |
938 | @row3col{defaultfolder, @ref overview_xrcformat_type_text, | |
939 | Initial folder (default: empty).} | |
940 | @row3col{filter, @ref overview_xrcformat_type_text, | |
941 | Filter string, using the same syntax as used by wxFileDialog, e.g. | |
942 | "All files (*.*)|*.*|JPEG files (*.jpg)|*.jpg" (default: empty).} | |
943 | @row3col{defaultfilter, integer, | |
944 | Zero-based index of default filter (default: 0).} | |
945 | @endTable | |
946 | ||
947 | @subsubsection xrc_wxgrid wxGrid | |
948 | ||
949 | No additional properties. | |
950 | ||
951 | ||
952 | @subsubsection xrc_wxhtmlwindow wxHtmlWindow | |
953 | ||
954 | @beginTable | |
955 | @hdr3col{property, type, description} | |
956 | @row3col{url, @ref overview_xrcformat_type_url, | |
957 | Page to display in the window.} | |
958 | @row3col{htmlcode, @ref overview_xrcformat_type_text, | |
959 | HTML markup to display in the window.} | |
960 | @row3col{borders, @ref overview_xrcformat_type_dimension, | |
961 | Border around HTML content (default: 0).} | |
962 | @endTable | |
963 | ||
964 | At most one of @c url and @c htmlcode properties may be specified, they are | |
965 | mutually exclusive. If neither is set, the window is initialized to show empty | |
966 | page. | |
967 | ||
968 | ||
969 | @subsubsection xrc_wxhyperlinkctrl wxHyperlinkCtrl | |
970 | ||
971 | @beginTable | |
972 | @hdr3col{property, type, description} | |
973 | @row3col{label, @ref overview_xrcformat_type_text, | |
974 | Label to display on the control (required).} | |
975 | @row3col{url, @ref overview_xrcformat_type_url, | |
976 | URL to open when the link is clicked (required).} | |
977 | @endTable | |
978 | ||
979 | ||
980 | @subsubsection xrc_wximagelist wxImageList | |
981 | ||
982 | The imagelist can be used as a child object for the following classes: | |
983 | - @ref xrc_wxchoicebook | |
984 | - @ref xrc_wxlistbook | |
985 | - @ref xrc_wxlistctrl | |
986 | - @ref xrc_wxnotebook | |
987 | - @ref xrc_wxtreebook | |
988 | - @ref xrc_wxtreectrl | |
989 | ||
990 | The available properties are: | |
991 | ||
992 | @beginTable | |
993 | @hdr3col{property, type, description} | |
994 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
995 | Adds a new image by keeping its optional mask bitmap (see below).} | |
996 | @row3col{mask, @ref overview_xrcformat_type_bool, | |
997 | If masks should be created for all images (default: true).} | |
998 | @row3col{size, @ref overview_xrcformat_type_size, | |
999 | The size of the images in the list (default: the size of the first bitmap).} | |
1000 | @endTable | |
1001 | ||
1002 | Example: | |
1003 | @code | |
1004 | <imagelist> | |
1005 | <size>32,32</size> | |
1006 | <bitmap stock_id="wxART_QUESTION"/> | |
1007 | <bitmap stock_id="wxART_INFORMATION"/> | |
1008 | </imagelist> | |
1009 | @endcode | |
1010 | ||
1011 | In the specific case of the @ref xrc_wxlistctrl, the tag can take the name | |
1012 | @c \<imagelist-small\> to define the 'small' image list, related to the flag | |
1013 | @c wxIMAGE_LIST_SMALL (see wxListCtrl documentation). | |
1014 | ||
1015 | ||
1016 | @subsubsection xrc_wxlistbox wxListBox | |
1017 | ||
1018 | @beginTable | |
1019 | @hdr3col{property, type, description} | |
1020 | @row3col{selection, integer, | |
1021 | Index of the initially selected item or -1 for no selection (default: -1).} | |
1022 | @row3col{content, items, | |
1023 | Content of the control; this property has any number of @c \<item\> XML | |
1024 | elements as its children, with the items text as their text values | |
1025 | (default: empty).} | |
1026 | @endTable | |
1027 | ||
1028 | Example: | |
1029 | @code | |
1030 | <object class="wxListBox" name="controls_listbox"> | |
1031 | <size>250,160</size> | |
1032 | <style>wxLB_SINGLE</style> | |
1033 | <content> | |
1034 | <item>Milk</item> | |
1035 | <item>Pizza</item> | |
1036 | <item>Bread</item> | |
1037 | <item>Orange juice</item> | |
1038 | <item>Paper towels</item> | |
1039 | </content> | |
1040 | </object> | |
1041 | @endcode | |
1042 | ||
1043 | ||
1044 | @subsubsection xrc_wxlistbook wxListbook | |
1045 | ||
1046 | A listbook can have one or more child objects of the @c listbookpage | |
1047 | pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its | |
1048 | @c notebookpage) and one child object of the @ref xrc_wximagelist class. | |
1049 | @c listbookpage objects have the following properties: | |
1050 | ||
1051 | @beginTable | |
1052 | @hdr3col{property, type, description} | |
1053 | @row3col{label, @ref overview_xrcformat_type_text, | |
1054 | Sheet page's title (required).} | |
1055 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
1056 | Bitmap shown alongside the label (default: none).} | |
1057 | @row3col{image, integer, | |
1058 | The zero-based index of the image associated with the item | |
1059 | into the image list.} | |
1060 | @row3col{selected, @ref overview_xrcformat_type_bool, | |
1061 | Is the page selected initially (only one page can be selected; default: 0)?} | |
1062 | @endTable | |
1063 | ||
1064 | Each @c listbookpage has exactly one non-toplevel window as its child. | |
1065 | ||
1066 | ||
1067 | @subsubsection xrc_wxlistctrl wxListCtrl | |
1068 | ||
1069 | A list control can have one or more child objects of the class @ref xrc_wxlistitem | |
1070 | and one or more objects of the @ref xrc_wximagelist class. The latter is | |
1071 | defined either using @c \<imagelist\> tag for the control with @c wxLC_ICON | |
1072 | style or using @c \<imagelist-small\> tag for the control with @c | |
1073 | wxLC_SMALL_ICON style. | |
1074 | ||
1075 | Report mode list controls (i.e. created with @c wxLC_REPORT style) can in | |
1076 | addition have one or more @ref xrc_wxlistcol child elements. | |
1077 | ||
1078 | @paragraph xrc_wxlistcol listcol | |
1079 | ||
1080 | The @c listcol class can only be used for wxListCtrl children. It can have the | |
1081 | following properties: | |
1082 | @beginTable | |
1083 | @hdr3col{property, type, description} | |
1084 | @row3col{align, wxListColumnFormat, | |
1085 | The alignment for the item. | |
1086 | Can be one of @c wxLIST_FORMAT_LEFT, @c wxLIST_FORMAT_RIGHT or | |
1087 | @c wxLIST_FORMAT_CENTRE.} | |
1088 | @row3col{text, @ref overview_xrcformat_type_string, | |
1089 | The title of the column. } | |
1090 | @row3col{width, integer, | |
1091 | The column width. } | |
1092 | @row3col{image, integer, | |
1093 | The zero-based index of the image associated with the item in the 'small' image list. } | |
1094 | @endTable | |
1095 | ||
1096 | The columns are appended to the control in order of their appearance and may be | |
1097 | referenced by 0-based index in the @c col attributes of subsequent @c listitem | |
1098 | objects. | |
1099 | ||
1100 | @paragraph xrc_wxlistitem listitem | |
1101 | ||
1102 | The @c listitem is a child object for the class @ref xrc_wxlistctrl. | |
1103 | It can have the following properties: | |
1104 | ||
1105 | @beginTable | |
1106 | @hdr3col{property, type, description} | |
1107 | @row3col{align, wxListColumnFormat, | |
1108 | The alignment for the item. | |
1109 | Can be one of @c wxLIST_FORMAT_LEFT, @c wxLIST_FORMAT_RIGHT or | |
1110 | @c wxLIST_FORMAT_CENTRE.} | |
1111 | @row3col{bg, @ref overview_xrcformat_type_colour, | |
1112 | The background color for the item.} | |
1113 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
1114 | Add a bitmap to the (normal) @ref xrc_wximagelist associated with the | |
1115 | @ref xrc_wxlistctrl parent and associate it with this item. | |
1116 | If the imagelist is not defined it will be created implicitly.} | |
1117 | @row3col{bitmap-small, @ref overview_xrcformat_type_bitmap, | |
1118 | Add a bitmap in the 'small' @ref xrc_wximagelist associated with the | |
1119 | @ref xrc_wxlistctrl parent and associate it with this item. | |
1120 | If the 'small' imagelist is not defined it will be created implicitly.} | |
1121 | @row3col{col, integer, | |
1122 | The zero-based column index.} | |
1123 | @row3col{image, integer, | |
1124 | The zero-based index of the image associated with the item | |
1125 | in the (normal) image list.} | |
1126 | @row3col{image-small, integer, | |
1127 | The zero-based index of the image associated with the item | |
1128 | in the 'small' image list.} | |
1129 | @row3col{data, integer, | |
1130 | The client data for the item.} | |
1131 | @row3col{font, @ref overview_xrcformat_type_font, | |
1132 | The font for the item.} | |
1133 | @row3col{image, integer, | |
1134 | The zero-based index of the image associated with the item | |
1135 | into the image list.} | |
1136 | @row3col{state, @ref overview_xrcformat_type_style, | |
1137 | The item state. Can be any combination of the following values: | |
1138 | - @c wxLIST_STATE_FOCUSED: The item has the focus. | |
1139 | - @c wxLIST_STATE_SELECTED: The item is selected.} | |
1140 | @row3col{text, @ref overview_xrcformat_type_string, | |
1141 | The text label for the item. } | |
1142 | @row3col{textcolour, @ref overview_xrcformat_type_colour, | |
1143 | The text colour for the item. } | |
1144 | @endTable | |
1145 | ||
1146 | Notice that the item position can't be specified here, the items are appended | |
1147 | to the list control in order of their appearance. | |
1148 | ||
1149 | ||
1150 | @subsubsection xrc_wxmdiparentframe wxMDIParentFrame | |
1151 | ||
1152 | wxMDIParentFrame supports the same properties that @ref xrc_wxfrane does. | |
1153 | ||
1154 | wxMDIParentFrame may have optional children. When used, the child objects | |
1155 | must be of wxMDIChildFrame type. | |
1156 | ||
1157 | ||
1158 | @subsubsection xrc_wxmdichildframe wxMDIChildFrame | |
1159 | ||
1160 | wxMDIChildFrame supports the same properties that @ref xrc_wxfrane and | |
1161 | @ref xrc_wxmdiparentframe do. | |
1162 | ||
1163 | wxMDIChildFrame can only be used as as immediate child of @ref | |
1164 | xrc_wxmdiparentframe. | |
1165 | ||
1166 | wxMDIChildFrame may have optional children: either exactly one | |
1167 | @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window | |
1168 | objects. If sizer child is used, it sets | |
1169 | @ref wxSizer::SetSizeHints() "size hints" too. | |
1170 | ||
1171 | ||
1172 | @subsubsection xrc_wxmenu wxMenu | |
1173 | ||
1174 | @beginTable | |
1175 | @hdr3col{property, type, description} | |
1176 | @row3col{label, @ref overview_xrcformat_type_text, | |
1177 | Menu's label (default: empty, but required for menus other | |
1178 | than popup menus).} | |
1179 | @row3col{help, @ref overview_xrcformat_type_text, | |
1180 | Help shown in statusbar when the menu is selected (only for submenus | |
1181 | of another wxMenu, default: none).} | |
1182 | @row3col{enabled, @ref overview_xrcformat_type_bool, | |
1183 | Is the submenu item enabled (only for submenus of another wxMenu, | |
1184 | default: 1)?} | |
1185 | @endTable | |
1186 | ||
1187 | Note that unlike most controls, wxMenu does @em not have | |
1188 | @ref overview_xrcformat_std_props. | |
1189 | ||
1190 | A menu object can have one or more child objects of the wxMenuItem or wxMenu | |
1191 | classes or @c break or @c separator pseudo-classes. | |
1192 | ||
1193 | The @c separator pseudo-class is used to insert separators into the menu and | |
1194 | has neither properties nor children. Likewise, @c break inserts a break (see | |
1195 | wxMenu::Break()). | |
1196 | ||
1197 | wxMenuItem objects support the following properties: | |
1198 | ||
1199 | @beginTable | |
1200 | @hdr3col{property, type, description} | |
1201 | @row3col{label, @ref overview_xrcformat_type_text, | |
1202 | Item's label (required).} | |
1203 | @row3col{accel, @ref overview_xrcformat_type_text_notrans, | |
1204 | Item's accelerator (default: none).} | |
1205 | @row3col{radio, @ref overview_xrcformat_type_bool, | |
1206 | Item's kind is wxITEM_RADIO (default: 0)?} | |
1207 | @row3col{checkable, @ref overview_xrcformat_type_bool, | |
1208 | Item's kind is wxITEM_CHECK (default: 0)?} | |
1209 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
1210 | Bitmap to show with the item (default: none).} | |
1211 | @row3col{bitmap2, @ref overview_xrcformat_type_bitmap, | |
1212 | Bitmap for the checked state (wxMSW, if checkable; default: none).} | |
1213 | @row3col{help, @ref overview_xrcformat_type_text, | |
1214 | Help shown in statusbar when the item is selected (default: none).} | |
1215 | @row3col{enabled, @ref overview_xrcformat_type_bool, | |
1216 | Is the item enabled (default: 1)?} | |
1217 | @row3col{checked, @ref overview_xrcformat_type_bool, | |
1218 | Is the item checked initially (default: 0)?} | |
1219 | @endTable | |
1220 | ||
1221 | Example: | |
1222 | @code | |
1223 | <object class="wxMenu" name="menu_edit"> | |
1224 | <style>wxMENU_TEAROFF</style> | |
1225 | <label>_Edit</label> | |
1226 | <object class="wxMenuItem" name="wxID_FIND"> | |
1227 | <label>_Find...</label> | |
1228 | <accel>Ctrl-F</accel> | |
1229 | </object> | |
1230 | <object class="separator"/> | |
1231 | <object class="wxMenuItem" name="menu_fuzzy"> | |
1232 | <label>Translation is _fuzzy</label> | |
1233 | <checkable>1</checkable> | |
1234 | </object> | |
1235 | <object class="wxMenu" name="submenu"> | |
1236 | <label>A submenu</label> | |
1237 | <object class="wxMenuItem" name="foo">...</object> | |
1238 | ... | |
1239 | </object> | |
1240 | <object class="separator" platform="unix"/> | |
1241 | <object class="wxMenuItem" name="wxID_PREFERENCES" platform="unix"> | |
1242 | <label>_Preferences</label> | |
1243 | </object> | |
1244 | </object> | |
1245 | @endcode | |
1246 | ||
1247 | @subsubsection xrc_wxmenubar wxMenuBar | |
1248 | ||
1249 | No properties. Note that unlike most controls, wxMenuBar does @em not have | |
1250 | @ref overview_xrcformat_std_props. | |
1251 | ||
1252 | A menubar can have one or more child objects of the @ref xrc_wxmenu "wxMenu" | |
1253 | class. | |
1254 | ||
1255 | ||
1256 | @subsubsection xrc_wxnotebook wxNotebook | |
1257 | ||
1258 | A notebook can have one or more child objects of the @c notebookpage | |
1259 | pseudo-class and one child object of the @ref xrc_wximagelist class. | |
1260 | @c notebookpage objects have the following properties: | |
1261 | ||
1262 | @beginTable | |
1263 | @hdr3col{property, type, description} | |
1264 | @row3col{label, @ref overview_xrcformat_type_text, | |
1265 | Page's title (required).} | |
1266 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
1267 | Bitmap shown alongside the label (default: none).} | |
1268 | @row3col{image, integer, | |
1269 | The zero-based index of the image associated with the item | |
1270 | into the image list.} | |
1271 | @row3col{selected, @ref overview_xrcformat_type_bool, | |
1272 | Is the page selected initially (only one page can be selected; default: 0)?} | |
1273 | @endTable | |
1274 | ||
1275 | Each @c notebookpage has exactly one non-toplevel window as its child. | |
1276 | ||
1277 | Example: | |
1278 | @code | |
1279 | <object class="wxNotebook"> | |
1280 | <style>wxBK_BOTTOM</style> | |
1281 | <object class="notebookpage"> | |
1282 | <label>Page 1</label> | |
1283 | <object class="wxPanel" name="page_1"> | |
1284 | ... | |
1285 | </object> | |
1286 | </object> | |
1287 | <object class="notebookpage"> | |
1288 | <label>Page 2</label> | |
1289 | <object class="wxPanel" name="page_2"> | |
1290 | ... | |
1291 | </object> | |
1292 | </object> | |
1293 | </object> | |
1294 | @endcode | |
1295 | ||
1296 | ||
1297 | @subsubsection xrc_wxownerdrawncombobox wxOwnerDrawnComboBox | |
1298 | ||
1299 | wxOwnerDrawnComboBox has the same properties as | |
1300 | @ref xrc_wxcombobox "wxComboBox", plus the following additional properties: | |
1301 | ||
1302 | @beginTable | |
1303 | @hdr3col{property, type, description} | |
1304 | @row3col{buttonsize, @ref overview_xrcformat_type_size, | |
1305 | Size of the dropdown button (default: default).} | |
1306 | @endTable | |
1307 | ||
1308 | ||
1309 | @subsubsection xrc_wxpanel wxPanel | |
1310 | ||
1311 | No additional properties. | |
1312 | ||
1313 | wxPanel may have optional children: either exactly one | |
1314 | @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window | |
1315 | objects. | |
1316 | ||
1317 | ||
1318 | @subsubsection xrc_wxpropertysheetdialog wxPropertySheetDialog | |
1319 | ||
1320 | @beginTable | |
1321 | @hdr3col{property, type, description} | |
1322 | @row3col{title, @ref overview_xrcformat_type_text, | |
1323 | Dialog's title (default: empty).} | |
1324 | @row3col{icon, @ref overview_xrcformat_type_bitmap, | |
1325 | Dialog's icon (default: not used).} | |
1326 | @row3col{centered, @ref overview_xrcformat_type_bool, | |
1327 | Whether the dialog should be centered on the screen (default: 0).} | |
1328 | @row3col{buttons, @ref overview_xrcformat_type_style, | |
1329 | Buttons to show, combination of flags accepted by | |
1330 | wxPropertySheetDialog::CreateButtons() (default: 0).} | |
1331 | @endTable | |
1332 | ||
1333 | A sheet dialog can have one or more child objects of the @c propertysheetpage | |
1334 | pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its | |
1335 | @c notebookpage). @c propertysheetpage objects have the following properties: | |
1336 | ||
1337 | @beginTable | |
1338 | @hdr3col{property, type, description} | |
1339 | @row3col{label, @ref overview_xrcformat_type_text, | |
1340 | Sheet page's title (required).} | |
1341 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
1342 | Bitmap shown alongside the label (default: none).} | |
1343 | @row3col{selected, @ref overview_xrcformat_type_bool, | |
1344 | Is the page selected initially (only one page can be selected; default: 0)?} | |
1345 | @endTable | |
1346 | ||
1347 | Each @c propertysheetpage has exactly one non-toplevel window as its child. | |
1348 | ||
1349 | ||
1350 | @subsubsection xrc_wxradiobutton wxRadioButton | |
1351 | ||
1352 | @beginTable | |
1353 | @hdr3col{property, type, description} | |
1354 | @row3col{label, @ref overview_xrcformat_type_text, | |
1355 | Label shown on the radio button (required).} | |
1356 | @row3col{value, @ref overview_xrcformat_type_bool, | |
1357 | Initial value of the control (default: 0).} | |
1358 | @endTable | |
1359 | ||
1360 | ||
1361 | @subsubsection xrc_wxradiobox wxRadioBox | |
1362 | ||
1363 | @beginTable | |
1364 | @hdr3col{property, type, description} | |
1365 | @row3col{label, @ref overview_xrcformat_type_text, | |
1366 | Label for the whole box (required).} | |
1367 | @row3col{dimension, integer, | |
1368 | Specifies the maximum number of rows (if style contains | |
1369 | @c wxRA_SPECIFY_ROWS) or columns (if style contains @c wxRA_SPECIFY_COLS) | |
1370 | for a two-dimensional radiobox (default: 1).} | |
1371 | @row3col{selection, integer, | |
1372 | Index of the initially selected item or -1 for no selection (default: -1).} | |
1373 | @row3col{content, items, | |
1374 | Content of the control; this property has any number of @c \<item\> XML | |
1375 | elements as its children, with the items text as their text values | |
1376 | (see below; default: empty).} | |
1377 | @endTable | |
1378 | ||
1379 | The @c \<item\> elements have radio buttons' labels as their text values. They | |
1380 | can also have some optional XML @em attributes (not properties!): | |
1381 | ||
1382 | @beginTable | |
1383 | @hdr3col{attribute, type, description} | |
1384 | @row3col{tooltip, @ref overview_xrcformat_type_string, | |
1385 | Tooltip to show over this ratio button (default: none).} | |
1386 | @row3col{helptext, @ref overview_xrcformat_type_string, | |
1387 | Contextual help for this radio button (default: none).} | |
1388 | @row3col{enabled, @ref overview_xrcformat_type_bool, | |
1389 | Is the button enabled (default: 1)?} | |
1390 | @row3col{hidden, @ref overview_xrcformat_type_bool, | |
1391 | Is the button hidden initially (default: 0)?} | |
1392 | @endTable | |
1393 | ||
1394 | Example: | |
1395 | @code | |
1396 | <object class="wxRadioBox" name="controls_radiobox"> | |
1397 | <style>wxRA_SPECIFY_COLS</style> | |
1398 | <label>Radio stations</label> | |
1399 | <dimension>1</dimension> | |
1400 | <selection>0</selection> | |
1401 | <content> | |
1402 | <item tooltip="Powerful radio station" helptext="This station is for amateurs of hard rock and heavy metal">Power 108</item> | |
1403 | <item tooltip="Disabled radio station" enabled="0">Power 0</item> | |
1404 | <item tooltip="">WMMS 100.7</item> | |
1405 | <item tooltip="E=mc^2">Energy 98.3</item> | |
1406 | <item helptext="Favourite chukcha's radio">CHUM FM</item> | |
1407 | <item>92FM</item> | |
1408 | <item hidden="1">Very quit station</item> | |
1409 | </content> | |
1410 | </object> | |
1411 | @endcode | |
1412 | ||
1413 | ||
1414 | @subsubsection xrc_wxribbon wxRibbon | |
1415 | ||
1416 | A wxRibbonBar is a container of ribbon pages which, in turn, contain elements | |
1417 | that can be wxRibbonControl or wxRibbonGallery. | |
1418 | ||
1419 | Example: | |
1420 | @code | |
1421 | <object class="wxRibbonBar" name="ribbonbar"> | |
1422 | <object class="page" name="FilePage"> | |
1423 | <label>First</label> | |
1424 | <object class="panel"> | |
1425 | <label>File</label> | |
1426 | <object class="wxRibbonButtonBar"> | |
1427 | <object class="button" name="Open"> | |
1428 | <bitmap>open.xpm</bitmap> | |
1429 | <label>Open</label> | |
1430 | </object> | |
1431 | </object> | |
1432 | </object> | |
1433 | </object> | |
1434 | <object class="page" name="ViewPage"> | |
1435 | <label>View</label> | |
1436 | <object class="panel"> | |
1437 | <label>Zoom</label> | |
1438 | <object class="wxRibbonGallery"> | |
1439 | <object class="item"> | |
1440 | <bitmap>zoomin.xpm</bitmap> | |
1441 | </object> | |
1442 | <object class="item"> | |
1443 | <bitmap>zoomout.xpm</bitmap> | |
1444 | </object> | |
1445 | </object> | |
1446 | </object> | |
1447 | </object> | |
1448 | </object> | |
1449 | @endcode | |
1450 | ||
1451 | Notice that wxRibbon support in XRC is available in wxWidgets 2.9.5 and | |
1452 | later only and you need to explicitly register its handler using | |
1453 | @code | |
1454 | #include <wx/xrc/xh_ribbon.h> | |
1455 | ||
1456 | AddHandler(new wxRibbonXmlHandler); | |
1457 | @endcode | |
1458 | to use it. | |
1459 | ||
1460 | ||
1461 | @subsubsection xrc_wxrichtextctrl wxRichTextCtrl | |
1462 | ||
1463 | @beginTable | |
1464 | @hdr3col{property, type, description} | |
1465 | @row3col{value, @ref overview_xrcformat_type_text, | |
1466 | Initial value of the control (default: empty).} | |
1467 | @row3col{maxlength, integer, | |
1468 | Maximum length of the text entered (default: unlimited).} | |
1469 | @endTable | |
1470 | ||
1471 | Notice that wxRichTextCtrl support in XRC is available in wxWidgets 2.9.5 and | |
1472 | later only and you need to explicitly register its handler using | |
1473 | @code | |
1474 | #include <wx/xrc/xh_richtext.h> | |
1475 | ||
1476 | AddHandler(new wxRichTextCtrl); | |
1477 | @endcode | |
1478 | to use it. | |
1479 | ||
1480 | ||
1481 | @subsubsection xrc_wxscrollbar wxScrollBar | |
1482 | ||
1483 | @beginTable | |
1484 | @hdr3col{property, type, description} | |
1485 | @row3col{value, integer, | |
1486 | Initial position of the scrollbar (default: 0).} | |
1487 | @row3col{range, integer, | |
1488 | Maximum value of the gauge (default: 10).} | |
1489 | @row3col{thumbsize, integer, | |
1490 | Size of the thumb (default: 1).} | |
1491 | @row3col{pagesize, integer, | |
1492 | Page size (default: 1).} | |
1493 | @endTable | |
1494 | ||
1495 | @subsubsection xrc_wxscrolledwindow wxScrolledWindow | |
1496 | ||
1497 | @beginTable | |
1498 | @hdr3col{property, type, description} | |
1499 | @row3col{scrollrate, @ref overview_xrcformat_type_size, | |
1500 | Scroll rate in @em x and @em y directions (default: not set; | |
1501 | required if the window has a sizer child).} | |
1502 | @endTable | |
1503 | ||
1504 | wxScrolledWindow may have optional children: either exactly one | |
1505 | @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window | |
1506 | objects. If sizer child is used, wxSizer::FitInside() is used (instead of | |
1507 | wxSizer::Fit() as usual) and so the children don't determine scrolled window's | |
1508 | minimal size, they only affect @em virtual size. Usually, both @c scrollrate | |
1509 | and either @c size or @c minsize on containing sizer item should be used | |
1510 | in this case. | |
1511 | ||
1512 | ||
1513 | @subsubsection xrc_wxsimplehtmllistbox wxSimpleHtmlListBox | |
1514 | ||
1515 | wxSimpleHtmlListBox has same properties as @ref xrc_wxlistbox "wxListBox". | |
1516 | The only difference is that the text contained in @c \<item\> elements is | |
1517 | HTML markup. Note that the markup has to be escaped: | |
1518 | ||
1519 | @code | |
1520 | <object class="wxSimpleHtmlListBox"> | |
1521 | <content> | |
1522 | <item><b>Bold</b> Milk</item> | |
1523 | </content> | |
1524 | </object> | |
1525 | @endcode | |
1526 | ||
1527 | (X)HTML markup elements cannot be included directly: | |
1528 | ||
1529 | @code | |
1530 | <object class="wxSimpleHtmlListBox"> | |
1531 | <content> | |
1532 | <!-- This is incorrect, doesn't work! --> | |
1533 | <item><b>Bold</b> Milk</item> | |
1534 | </content> | |
1535 | </object> | |
1536 | @endcode | |
1537 | ||
1538 | ||
1539 | @subsubsection xrc_wxslider wxSlider | |
1540 | ||
1541 | @beginTable | |
1542 | @hdr3col{property, type, description} | |
1543 | @row3col{value, integer, | |
1544 | Initial value of the control (default: 0).} | |
1545 | @row3col{min, integer, | |
1546 | Minimum allowed value (default: 0).} | |
1547 | @row3col{max, integer, | |
1548 | Maximum allowed value (default: 100).} | |
1549 | @row3col{pagesize, integer, | |
1550 | Page size; number of steps the slider moves when the user moves | |
1551 | pages up or down (default: unset).} | |
1552 | @row3col{linesize, integer, | |
1553 | Line size; number of steps the slider moves when the user moves it | |
1554 | up or down a line (default: unset).} | |
1555 | @row3col{tickfreq, integer, | |
1556 | Tick marks frequency (Windows only; default: unset).} | |
1557 | @row3col{tick, integer, | |
1558 | Tick position (Windows only; default: unset).} | |
1559 | @row3col{thumb, integer, | |
1560 | Thumb length (Windows only; default: unset).} | |
1561 | @row3col{selmin, integer, | |
1562 | Selection start position (Windows only; default: unset).} | |
1563 | @row3col{selmax, integer, | |
1564 | Selection end position (Windows only; default: unset).} | |
1565 | @endTable | |
1566 | ||
1567 | ||
1568 | @subsubsection xrc_wxspinbutton wxSpinButton | |
1569 | ||
1570 | @beginTable | |
1571 | @hdr3col{property, type, description} | |
1572 | @row3col{value, integer, | |
1573 | Initial value of the control (default: 0).} | |
1574 | @row3col{min, integer, | |
1575 | Minimum allowed value (default: 0).} | |
1576 | @row3col{max, integer, | |
1577 | Maximum allowed value (default: 100).} | |
1578 | @endTable | |
1579 | ||
1580 | ||
1581 | @subsubsection xrc_wxspinctrl wxSpinCtrl | |
1582 | ||
1583 | wxSpinCtrl supports the same properties as @ref xrc_wxspinbutton and, since | |
1584 | wxWidgets 2.9.5, another one: | |
1585 | @beginTable | |
1586 | @row3col{base, integer, | |
1587 | Numeric base, currently can be only 10 or 16 (default: 10).} | |
1588 | @endTable | |
1589 | ||
1590 | ||
1591 | @subsubsection xrc_wxsplitterwindow wxSplitterWindow | |
1592 | ||
1593 | @beginTable | |
1594 | @hdr3col{property, type, description} | |
1595 | @row3col{orientation, @ref overview_xrcformat_type_string, | |
1596 | Orientation of the splitter, either "vertical" or "horizontal" (default: horizontal).} | |
1597 | @row3col{sashpos, integer, | |
1598 | Initial position of the sash (default: 0).} | |
1599 | @row3col{minsize, integer, | |
1600 | Minimum child size (default: not set).} | |
1601 | @row3col{gravity, @ref overview_xrcformat_type_float, | |
1602 | Sash gravity, see wxSplitterWindow::SetSashGravity() (default: not set).} | |
1603 | @endTable | |
1604 | ||
1605 | wxSplitterWindow must have one or two children that are non-toplevel window | |
1606 | objects. If there's only one child, it is used as wxSplitterWindow's only | |
1607 | visible child. If there are two children, the first one is used for left/top | |
1608 | child and the second one for right/bottom child window. | |
1609 | ||
1610 | ||
1611 | @subsubsection xrc_wxsearchctrl wxSearchCtrl | |
1612 | ||
1613 | @beginTable | |
1614 | @hdr3col{property, type, description} | |
1615 | @row3col{value, @ref overview_xrcformat_type_text, | |
1616 | Initial value of the control (default: empty).} | |
1617 | @endTable | |
1618 | ||
1619 | ||
1620 | @subsubsection xrc_wxstatusbar wxStatusBar | |
1621 | ||
1622 | @beginTable | |
1623 | @hdr3col{property, type, description} | |
1624 | @row3col{fields, integer, | |
1625 | Number of status bar fields (default: 1).} | |
1626 | @row3col{widths, @ref overview_xrcformat_type_string, | |
1627 | Comma-separated list of @em fields integers. Each value specifies width | |
1628 | of one field; the values are interpreted using the same convention used | |
1629 | by wxStatusBar::SetStatusWidths().} | |
1630 | @row3col{styles, @ref overview_xrcformat_type_string, | |
1631 | Comma-separated list of @em fields flags. Each value specifies status bar | |
1632 | fieldd style and can be one of @c wxSB_NORMAL, @c wxSB_FLAT, | |
1633 | @c wxSB_RAISED or, since wxWidgets 2.9.5, @c wxSB_SUNKEN. See | |
1634 | wxStatusBar::SetStatusStyles() for their description.} | |
1635 | @endTable | |
1636 | ||
1637 | ||
1638 | ||
1639 | @subsubsection xrc_wxstaticbitmap wxStaticBitmap | |
1640 | ||
1641 | @beginTable | |
1642 | @hdr3col{property, type, description} | |
1643 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
1644 | Bitmap to display (required).} | |
1645 | @endTable | |
1646 | ||
1647 | @subsubsection xrc_wxstaticbox wxStaticBox | |
1648 | ||
1649 | @beginTable | |
1650 | @hdr3col{property, type, description} | |
1651 | @row3col{label, @ref overview_xrcformat_type_text, | |
1652 | Static box's label (required).} | |
1653 | @endTable | |
1654 | ||
1655 | ||
1656 | @subsubsection xrc_wxstaticline wxStaticLine | |
1657 | ||
1658 | No additional properties. | |
1659 | ||
1660 | ||
1661 | @subsubsection xrc_wxstatictext wxStaticText | |
1662 | ||
1663 | @beginTable | |
1664 | @hdr3col{property, type, description} | |
1665 | @row3col{label, @ref overview_xrcformat_type_text, | |
1666 | Label to display (required).} | |
1667 | @row3col{wrap, integer, | |
1668 | Wrap the text so that each line is at most the given number of pixels, see | |
1669 | wxStaticText::Wrap() (default: no wrap).} | |
1670 | @endTable | |
1671 | ||
1672 | @subsubsection xrc_wxtextctrl wxTextCtrl | |
1673 | ||
1674 | @beginTable | |
1675 | @hdr3col{property, type, description} | |
1676 | @row3col{value, @ref overview_xrcformat_type_text, | |
1677 | Initial value of the control (default: empty).} | |
1678 | @row3col{maxlength, integer, | |
1679 | Maximum length of the text which can be entered by user (default: unlimited).} | |
1680 | @endTable | |
1681 | ||
1682 | ||
1683 | @subsubsection xrc_wxtimepickerctrl wxTimePickerCtrl | |
1684 | ||
1685 | No additional properties. | |
1686 | ||
1687 | ||
1688 | @subsubsection xrc_wxtogglebutton wxToggleButton | |
1689 | ||
1690 | @beginTable | |
1691 | @hdr3col{property, type, description} | |
1692 | @row3col{label, @ref overview_xrcformat_type_text, | |
1693 | Label to display on the button (required).} | |
1694 | @row3col{checked, @ref overview_xrcformat_type_bool, | |
1695 | Should the button be checked/pressed initially (default: 0)?} | |
1696 | @endTable | |
1697 | ||
1698 | @subsubsection xrc_wxtoolbar wxToolBar | |
1699 | ||
1700 | @beginTable | |
1701 | @hdr3col{property, type, description} | |
1702 | @row3col{bitmapsize, @ref overview_xrcformat_type_size, | |
1703 | Size of toolbar bitmaps (default: not set).} | |
1704 | @row3col{margins, @ref overview_xrcformat_type_size, | |
1705 | Margins (default: platform default).} | |
1706 | @row3col{packing, integer, | |
1707 | Packing, see wxToolBar::SetToolPacking() (default: not set).} | |
1708 | @row3col{separation, integer, | |
1709 | Default separator size, see wxToolBar::SetToolSeparation() (default: not set).} | |
1710 | @row3col{dontattachtoframe, @ref overview_xrcformat_type_bool, | |
1711 | If set to 0 and the toolbar object is child of a wxFrame, | |
1712 | wxFrame::SetToolBar() is called; otherwise, you have to add it to a frame | |
1713 | manually. The toolbar is attached by default, you have to set this property | |
1714 | to 1 to disable this behaviour (default: 0).} | |
1715 | @endTable | |
1716 | ||
1717 | A toolbar can have one or more child objects of any wxControl-derived class or | |
1718 | one of two pseudo-classes: @c separator or @c tool. | |
1719 | ||
1720 | The @c separator pseudo-class is used to insert separators into the toolbar and | |
1721 | has neither properties nor children. Similarly, the @c space pseudo-class is | |
1722 | used for stretchable spaces (see wxToolBar::AddStretchableSpace(), new since | |
1723 | wxWidgets 2.9.1). | |
1724 | ||
1725 | The @c tool pseudo-class objects specify toolbar buttons and have the following | |
1726 | properties: | |
1727 | ||
1728 | @beginTable | |
1729 | @hdr3col{property, type, description} | |
1730 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
1731 | Tool's bitmap (required).} | |
1732 | @row3col{bitmap2, @ref overview_xrcformat_type_bitmap, | |
1733 | Bitmap for disabled tool (default: derived from @c bitmap).} | |
1734 | @row3col{label, @ref overview_xrcformat_type_text, | |
1735 | Label to display on the tool (default: no label).} | |
1736 | @row3col{radio, @ref overview_xrcformat_type_bool, | |
1737 | Item's kind is wxITEM_RADIO (default: 0)?} | |
1738 | @row3col{toggle, @ref overview_xrcformat_type_bool, | |
1739 | Item's kind is wxITEM_CHECK (default: 0)?} | |
1740 | @row3col{dropdown, see below, | |
1741 | Item's kind is wxITEM_DROPDOWN (default: 0)? (only available since wxWidgets 2.9.0)} | |
1742 | @row3col{tooltip, @ref overview_xrcformat_type_text, | |
1743 | Tooltip to use for the tool (default: none).} | |
1744 | @row3col{longhelp, @ref overview_xrcformat_type_text, | |
1745 | Help text shown in statusbar when the mouse is on the tool (default: none).} | |
1746 | @row3col{disabled, @ref overview_xrcformat_type_bool, | |
1747 | Is the tool initially disabled (default: 0)?} | |
1748 | @row3col{checked, @ref overview_xrcformat_type_bool, | |
1749 | Is the tool initially checked (default: 0)? (only available since wxWidgets 2.9.3)} | |
1750 | @endTable | |
1751 | ||
1752 | The presence of a @c dropdown property indicates that the tool is of type | |
1753 | wxITEM_DROPDOWN. It must be either empty or contain exactly one @ref | |
1754 | xrc_wxmenu child object defining the drop-down button associated menu. | |
1755 | ||
1756 | Notice that @c radio, @c toggle and @c dropdown are mutually exclusive. | |
1757 | ||
1758 | Children that are neither @c tool nor @c separator must be instances of classes | |
1759 | derived from wxControl and are added to the toolbar using | |
1760 | wxToolBar::AddControl(). | |
1761 | ||
1762 | Example: | |
1763 | @code | |
1764 | <object class="wxToolBar"> | |
1765 | <style>wxTB_FLAT|wxTB_NODIVIDER</style> | |
1766 | <object class="tool" name="foo"> | |
1767 | <bitmap>foo.png</bitmap> | |
1768 | <label>Foo</label> | |
1769 | </object> | |
1770 | <object class="tool" name="bar"> | |
1771 | <bitmap>bar.png</bitmap> | |
1772 | <label>Bar</label> | |
1773 | </object> | |
1774 | <object class="separator"/> | |
1775 | <object class="tool" name="view_auto"> | |
1776 | <bitmap>view.png</bitmap> | |
1777 | <label>View</label> | |
1778 | <dropdown> | |
1779 | <object class="wxMenu"> | |
1780 | <object class="wxMenuItem" name="view_as_text"> | |
1781 | <label>View as text</label> | |
1782 | </object> | |
1783 | <object class="wxMenuItem" name="view_as_hex"> | |
1784 | <label>View as binary</label> | |
1785 | </object> | |
1786 | </object> | |
1787 | </dropdown> | |
1788 | </object> | |
1789 | <object class="space"/> | |
1790 | <object class="wxComboBox"> | |
1791 | <content> | |
1792 | <item>Just</item> | |
1793 | <item>a combobox</item> | |
1794 | <item>in the toolbar</item> | |
1795 | </content> | |
1796 | </object> | |
1797 | </object> | |
1798 | ||
1799 | @endcode | |
1800 | ||
1801 | ||
1802 | @subsubsection xrc_wxtoolbook wxToolbook | |
1803 | ||
1804 | A toolbook can have one or more child objects of the @c toolbookpage | |
1805 | pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its | |
1806 | @c notebookpage) and one child object of the @ref xrc_wximagelist class. | |
1807 | @c toolbookpage objects have the following properties: | |
1808 | ||
1809 | @beginTable | |
1810 | @hdr3col{property, type, description} | |
1811 | @row3col{label, @ref overview_xrcformat_type_text, | |
1812 | Sheet page's title (required).} | |
1813 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
1814 | Bitmap shown alongside the label (default: none).} | |
1815 | @row3col{image, integer, | |
1816 | The zero-based index of the image associated with the item | |
1817 | into the image list.} | |
1818 | @row3col{selected, @ref overview_xrcformat_type_bool, | |
1819 | Is the page selected initially (only one page can be selected; default: 0)?} | |
1820 | @endTable | |
1821 | ||
1822 | Each @c toolbookpage has exactly one non-toplevel window as its child. | |
1823 | ||
1824 | ||
1825 | @subsubsection xrc_wxtreectrl wxTreeCtrl | |
1826 | ||
1827 | A treectrl can have one child object of the @ref xrc_wximagelist class. | |
1828 | ||
1829 | No additional properties. | |
1830 | ||
1831 | ||
1832 | @subsubsection xrc_wxtreebook wxTreebook | |
1833 | ||
1834 | A treebook can have one or more child objects of the @c treebookpage | |
1835 | pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its | |
1836 | @c notebookpage) and one child object of the @ref xrc_wximagelist class. | |
1837 | @c treebookpage objects have the following properties: | |
1838 | ||
1839 | @beginTable | |
1840 | @hdr3col{property, type, description} | |
1841 | @row3col{depth, integer, | |
1842 | Page's depth in the labels tree (required; see below).} | |
1843 | @row3col{label, @ref overview_xrcformat_type_text, | |
1844 | Sheet page's title (required).} | |
1845 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
1846 | Bitmap shown alongside the label (default: none).} | |
1847 | @row3col{image, integer, | |
1848 | The zero-based index of the image associated with the item | |
1849 | into the image list.} | |
1850 | @row3col{selected, @ref overview_xrcformat_type_bool, | |
1851 | Is the page selected initially (only one page can be selected; default: 0)?} | |
1852 | @row3col{expanded, @ref overview_xrcformat_type_bool, | |
1853 | If set to 1, the page is initially expanded. By default all pages are | |
1854 | initially collapsed.} | |
1855 | @endTable | |
1856 | ||
1857 | Each @c treebookpage has exactly one non-toplevel window as its child. | |
1858 | ||
1859 | The tree of labels is not described using nested @c treebookpage objects, but | |
1860 | using the @em depth property. Toplevel pages have depth 0, their child pages | |
1861 | have depth 1 and so on. A @c treebookpage's label is inserted as child of | |
1862 | the latest preceding page with depth equal to @em depth-1. For example, this | |
1863 | XRC markup: | |
1864 | ||
1865 | @code | |
1866 | <object class="wxTreebook"> | |
1867 | ... | |
1868 | <object class="treebookpage"> | |
1869 | <depth>0</depth> | |
1870 | <label>Page 1</label> | |
1871 | <object class="wxPanel">...</object> | |
1872 | </object> | |
1873 | <object class="treebookpage"> | |
1874 | <depth>1</depth> | |
1875 | <label>Subpage 1A</label> | |
1876 | <object class="wxPanel">...</object> | |
1877 | </object> | |
1878 | <object class="treebookpage"> | |
1879 | <depth>2</depth> | |
1880 | <label>Subsubpage 1</label> | |
1881 | <object class="wxPanel">...</object> | |
1882 | </object> | |
1883 | <object class="treebookpage"> | |
1884 | <depth>1</depth> | |
1885 | <label>Subpage 1B</label> | |
1886 | <object class="wxPanel">...</object> | |
1887 | </object> | |
1888 | <object class="treebookpage"> | |
1889 | <depth>2</depth> | |
1890 | <label>Subsubpage 2</label> | |
1891 | <object class="wxPanel">...</object> | |
1892 | </object> | |
1893 | <object class="treebookpage"> | |
1894 | <depth>0</depth> | |
1895 | <label>Page 2</label> | |
1896 | <object class="wxPanel">...</object> | |
1897 | </object> | |
1898 | </object> | |
1899 | @endcode | |
1900 | ||
1901 | corresponds to the following tree of labels: | |
1902 | ||
1903 | - Page 1 | |
1904 | - Subpage 1A | |
1905 | - Subsubpage 1 | |
1906 | - Subpage 1B | |
1907 | - Subsubpage 2 | |
1908 | - Page 2 | |
1909 | ||
1910 | ||
1911 | @subsubsection xrc_wxwizard wxWizard | |
1912 | ||
1913 | @beginTable | |
1914 | @hdr3col{property, type, description} | |
1915 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
1916 | Bitmap to display on the left side of the wizard (default: none).} | |
1917 | @endTable | |
1918 | ||
1919 | A wizard object can have one or more child objects of the wxWizardPage or | |
1920 | wxWizardPageSimple classes. They both support the following properties | |
1921 | (in addition to @ref overview_xrcformat_std_props): | |
1922 | ||
1923 | @beginTable | |
1924 | @hdr3col{property, type, description} | |
1925 | @row3col{bitmap, @ref overview_xrcformat_type_bitmap, | |
1926 | Page-specific bitmap (default: none).} | |
1927 | @endTable | |
1928 | ||
1929 | wxWizardPageSimple pages are automatically chained together; wxWizardPage pages | |
1930 | transitions must be handled programmatically. | |
1931 | ||
1932 | ||
1933 | @section overview_xrcformat_sizers Sizers | |
1934 | ||
1935 | Sizers are handled slightly differently in XRC resources than they are in | |
1936 | wxWindow hierarchy. wxWindow's sizers hierarchy is parallel to the wxWindow | |
1937 | children hierarchy: child windows are children of their parent window and | |
1938 | the sizer (or sizers) form separate hierarchy attached to the window with | |
1939 | wxWindow::SetSizer(). | |
1940 | ||
1941 | In XRC, the two hierarchies are merged together: sizers are children of other | |
1942 | sizers or windows and they can contain child window objects. | |
1943 | ||
1944 | If a sizer is child of a window object in the resource, it must be the only | |
1945 | child and it will be attached to the parent with wxWindow::SetSizer(). | |
1946 | Additionally, if the window doesn't have its size explicitly set, | |
1947 | wxSizer::Fit() is used to resize the window. If the parent window is | |
1948 | toplevel window, wxSizer::SetSizeHints() is called to set its hints. | |
1949 | ||
1950 | A sizer object can have one or more child objects of one of two pseudo-classes: | |
1951 | @c sizeritem or @c spacer (see @ref overview_xrcformat_wxstddialogbuttonsizer for | |
1952 | an exception). The former specifies an element (another sizer or a window) | |
1953 | to include in the sizer, the latter adds empty space to the sizer. | |
1954 | ||
1955 | @c sizeritem objects have exactly one child object: either another sizer | |
1956 | object, or a window object. @c spacer objects don't have any children, but | |
1957 | they have one property: | |
1958 | ||
1959 | @beginTable | |
1960 | @hdr3col{property, type, description} | |
1961 | @row3col{size, @ref overview_xrcformat_type_size, Size of the empty space (required).} | |
1962 | @endTable | |
1963 | ||
1964 | Both @c sizeritem and @c spacer objects can have any of the following | |
1965 | properties: | |
1966 | ||
1967 | @beginTable | |
1968 | @hdr3col{property, type, description} | |
1969 | @row3col{option, integer, | |
1970 | The "option" value for sizers. Used by wxBoxSizer to set proportion of | |
1971 | the item in the growable direction (default: 0).} | |
1972 | @row3col{flag, @ref overview_xrcformat_type_style, | |
1973 | wxSizerItem flags (default: 0).} | |
1974 | @row3col{border, @ref overview_xrcformat_type_dimension, | |
1975 | Size of the border around the item (directions are specified in flags) | |
1976 | (default: 0).} | |
1977 | @row3col{minsize, @ref overview_xrcformat_type_size, | |
1978 | Minimal size of this item (default: no min size).} | |
1979 | @row3col{ratio, @ref overview_xrcformat_type_size, | |
1980 | Item ratio, see wxSizer::SetRatio() (default: no ratio).} | |
1981 | @row3col{cellpos, @ref overview_xrcformat_type_pos, | |
1982 | (wxGridBagSizer only) Position, see wxGBSizerItem::SetPos() (required). } | |
1983 | @row3col{cellspan, @ref overview_xrcformat_type_size, | |
1984 | (wxGridBagSizer only) Span, see wxGBSizerItem::SetSpan() (required). } | |
1985 | @endTable | |
1986 | ||
1987 | Example of sizers XRC code: | |
1988 | @code | |
1989 | <object class="wxDialog" name="derived_dialog"> | |
1990 | <title>Derived Dialog Example</title> | |
1991 | <centered>1</centered> | |
1992 | <!-- this sizer is set to be this dialog's sizer: --> | |
1993 | <object class="wxFlexGridSizer"> | |
1994 | <cols>1</cols> | |
1995 | <rows>0</rows> | |
1996 | <vgap>0</vgap> | |
1997 | <hgap>0</hgap> | |
1998 | <growablecols>0:1</growablecols> | |
1999 | <growablerows>0:1</growablerows> | |
2000 | <object class="sizeritem"> | |
2001 | <flag>wxALIGN_CENTRE|wxALL</flag> | |
2002 | <border>5</border> | |
2003 | <object class="wxButton" name="my_button"> | |
2004 | <label>My Button</label> | |
2005 | </object> | |
2006 | </object> | |
2007 | <object class="sizeritem"> | |
2008 | <flag>wxALIGN_CENTRE|wxALL</flag> | |
2009 | <border>5</border> | |
2010 | <object class="wxBoxSizer"> | |
2011 | <orient>wxHORIZONTAL</orient> | |
2012 | <object class="sizeritem"> | |
2013 | <flag>wxALIGN_CENTRE|wxALL</flag> | |
2014 | <border>5</border> | |
2015 | <object class="wxCheckBox" name="my_checkbox"> | |
2016 | <label>Enable this text control:</label> | |
2017 | </object> | |
2018 | </object> | |
2019 | <object class="sizeritem"> | |
2020 | <flag>wxALIGN_CENTRE|wxALL</flag> | |
2021 | <border>5</border> | |
2022 | <object class="wxTextCtrl" name="my_textctrl"> | |
2023 | <size>80,-1</size> | |
2024 | <value></value> | |
2025 | </object> | |
2026 | </object> | |
2027 | </object> | |
2028 | </object> | |
2029 | ... | |
2030 | </object> | |
2031 | </object> | |
2032 | @endcode | |
2033 | ||
2034 | The sizer classes that can be used are listed below, together with their | |
2035 | class-specific properties. All classes support the following properties: | |
2036 | ||
2037 | @beginTable | |
2038 | @hdr3col{property, type, description} | |
2039 | @row3col{minsize, @ref overview_xrcformat_type_size, | |
2040 | Minimal size that this sizer will have, see wxSizer::SetMinSize() | |
2041 | (default: no min size).} | |
2042 | @endTable | |
2043 | ||
2044 | @subsection overview_xrcformat_wxboxsizer wxBoxSizer | |
2045 | ||
2046 | @beginTable | |
2047 | @hdr3col{property, type, description} | |
2048 | @row3col{orient, @ref overview_xrcformat_type_style, | |
2049 | Sizer orientation, "wxHORIZONTAL" or "wxVERTICAL" (default: wxHORIZONTAL).} | |
2050 | @endTable | |
2051 | ||
2052 | @subsection overview_xrcformat_wxstaticsboxizer wxStaticBoxSizer | |
2053 | ||
2054 | @beginTable | |
2055 | @hdr3col{property, type, description} | |
2056 | @row3col{orient, @ref overview_xrcformat_type_style, | |
2057 | Sizer orientation, "wxHORIZONTAL" or "wxVERTICAL" (default: wxHORIZONTAL).} | |
2058 | @row3col{label, @ref overview_xrcformat_type_text, | |
2059 | Label to be used for the static box around the sizer (required).} | |
2060 | @endTable | |
2061 | ||
2062 | @subsection overview_xrcformat_wxgridsizer wxGridSizer | |
2063 | ||
2064 | @beginTable | |
2065 | @hdr3col{property, type, description} | |
2066 | @row3col{rows, integer, Number of rows in the grid (default: 0 - determine automatically).} | |
2067 | @row3col{cols, integer, Number of columns in the grid (default: 0 - determine automatically).} | |
2068 | @row3col{vgap, integer, Vertical gap between children (default: 0).} | |
2069 | @row3col{hgap, integer, Horizontal gap between children (default: 0).} | |
2070 | @endTable | |
2071 | ||
2072 | @subsection overview_xrcformat_wxflexgridsizer wxFlexGridSizer | |
2073 | ||
2074 | @beginTable | |
2075 | @hdr3col{property, type, description} | |
2076 | @row3col{rows, integer, Number of rows in the grid (default: 0 - determine automatically).} | |
2077 | @row3col{cols, integer, Number of columns in the grid (default: 0 - determine automatically).} | |
2078 | @row3col{vgap, integer, Vertical gap between children (default: 0).} | |
2079 | @row3col{hgap, integer, Horizontal gap between children (default: 0).} | |
2080 | @row3col{flexibledirection, @ref overview_xrcformat_type_style, | |
2081 | Flexible direction, @c wxVERTICAL, @c wxHORIZONTAL or @c wxBOTH (default). | |
2082 | This property is only available since wxWidgets 2.9.5.} | |
2083 | @row3col{nonflexiblegrowmode, @ref overview_xrcformat_type_style, | |
2084 | Grow mode in the non-flexible direction, | |
2085 | @c wxFLEX_GROWMODE_NONE, @c wxFLEX_GROWMODE_SPECIFIED (default) or | |
2086 | @c wxFLEX_GROWMODE_ALL. | |
2087 | This property is only available since wxWidgets 2.9.5.} | |
2088 | @row3col{growablerows, comma-separated integers list, | |
2089 | Comma-separated list of indexes of rows that are growable (none by default). | |
2090 | Since wxWidgets 2.9.5 optional proportion can be appended to each number | |
2091 | after a colon (@c :).} | |
2092 | @row3col{growablecols, comma-separated integers list, | |
2093 | Comma-separated list of indexes of columns that are growable (none by default). | |
2094 | Since wxWidgets 2.9.5 optional proportion can be appended to each number | |
2095 | after a colon (@c :).} | |
2096 | @endTable | |
2097 | ||
2098 | @subsection overview_xrcformat_wxgridbagsizer wxGridBagSizer | |
2099 | ||
2100 | @beginTable | |
2101 | @hdr3col{property, type, description} | |
2102 | @row3col{vgap, integer, Vertical gap between children (default: 0).} | |
2103 | @row3col{hgap, integer, Horizontal gap between children (default: 0).} | |
2104 | @row3col{flexibledirection, @ref overview_xrcformat_type_style, | |
2105 | Flexible direction, @c wxVERTICAL, @c wxHORIZONTAL, @c wxBOTH (default: @c wxBOTH).} | |
2106 | @row3col{nonflexiblegrowmode, @ref overview_xrcformat_type_style, | |
2107 | Grow mode in the non-flexible direction, | |
2108 | @c wxFLEX_GROWMODE_NONE, @c wxFLEX_GROWMODE_SPECIFIED, @c wxFLEX_GROWMODE_ALL | |
2109 | (default: @c wxFLEX_GROWMODE_SPECIFIED).} | |
2110 | @row3col{growablerows, comma-separated integers list, | |
2111 | Comma-separated list of indexes of rows that are growable, | |
2112 | optionally the proportion can be appended after each number | |
2113 | separated by a @c : | |
2114 | (default: none).} | |
2115 | @row3col{growablecols, comma-separated integers list, | |
2116 | Comma-separated list of indexes of columns that are growable, | |
2117 | optionally the proportion can be appended after each number | |
2118 | separated by a @c : | |
2119 | (default: none).} | |
2120 | @endTable | |
2121 | ||
2122 | @subsection overview_xrcformat_wxwrapsizer wxWrapSizer | |
2123 | ||
2124 | @beginTable | |
2125 | @hdr3col{property, type, description} | |
2126 | @row3col{orient, @ref overview_xrcformat_type_style, | |
2127 | Sizer orientation, "wxHORIZONTAL" or "wxVERTICAL" (required).} | |
2128 | @row3col{flag, @ref overview_xrcformat_type_style, wxWrapSizer flags (default: 0).} | |
2129 | @endTable | |
2130 | ||
2131 | @subsection overview_xrcformat_wxstddialogbuttonsizer wxStdDialogButtonSizer | |
2132 | ||
2133 | Unlike other sizers, wxStdDialogButtonSizer has neither @c sizeritem | |
2134 | nor @c spacer children. Instead, it has one or more children of the | |
2135 | @c button pseudo-class. @c button objects have no properties and they must | |
2136 | always have exactly one child of the @c wxButton class or a class derived from | |
2137 | wxButton. | |
2138 | ||
2139 | Example: | |
2140 | @code | |
2141 | <object class="wxStdDialogButtonSizer"> | |
2142 | <object class="button"> | |
2143 | <object class="wxButton" name="wxID_OK"> | |
2144 | <label>OK</label> | |
2145 | </object> | |
2146 | </object> | |
2147 | <object class="button"> | |
2148 | <object class="wxButton" name="wxID_CANCEL"> | |
2149 | <label>Cancel</label> | |
2150 | </object> | |
2151 | </object> | |
2152 | </object> | |
2153 | @endcode | |
2154 | ||
2155 | ||
2156 | ||
2157 | @section overview_xrcformat_other_objects Other Objects | |
2158 | ||
2159 | In addition to describing UI elements, XRC files can contain non-windows | |
2160 | objects such as bitmaps or icons. This is a concession to Windows developers | |
2161 | used to storing them in Win32 resources. | |
2162 | ||
2163 | Note that unlike Win32 resources, bitmaps included in XRC files are @em not | |
2164 | embedded in the XRC file itself. XRC file only contains a reference to another | |
2165 | file with bitmap data. | |
2166 | ||
2167 | @subsection overview_xrcformat_bitmap wxBitmap | |
2168 | ||
2169 | Bitmaps are stored in @c \<object\> element with class set to @c wxBitmap. Such | |
2170 | bitmaps can then be loaded using wxXmlResource::LoadBitmap(). The content of | |
2171 | the element is exactly same as in the case of | |
2172 | @ref overview_xrcformat_type_bitmap "bitmap properties", except that toplevel | |
2173 | @c \<object\> is used. | |
2174 | ||
2175 | For example, instead of: | |
2176 | @code | |
2177 | <bitmap>mybmp.png</bitmap> | |
2178 | <bitmap stock_id="wxART_NEW"/> | |
2179 | @endcode | |
2180 | toplevel wxBitmap resources would look like: | |
2181 | @code | |
2182 | <object class="wxBitmap" name="my_bitmap">mybmp.png</object> | |
2183 | <object class="wxBitmap" name="my_new_bitmap" stock_id="wxART_NEW"/> | |
2184 | @endcode | |
2185 | ||
2186 | ||
2187 | @subsection overview_xrcformat_icon wxIcon | |
2188 | ||
2189 | wxIcon resources are identical to @ref overview_xrcformat_bitmap "wxBitmap ones", | |
2190 | except that the class is @c wxIcon. | |
2191 | ||
2192 | ||
2193 | @section overview_xrcformat_platform Platform Specific Content | |
2194 | ||
2195 | It is possible to conditionally process parts of XRC files on some platforms | |
2196 | only and ignore them on other platforms. @em Any element in XRC file, be it | |
2197 | toplevel or arbitrarily nested one, can have the @c platform attribute. When | |
2198 | used, @c platform contains |-separated list of platforms that this element | |
2199 | should be processed on. It is filtered out and ignored on any other platforms. | |
2200 | ||
2201 | Possible elemental values are: | |
2202 | @beginDefList | |
2203 | @itemdef{ @c win, Windows } | |
2204 | @itemdef{ @c mac, Mac OS X (or Mac Classic in wxWidgets version supporting it) } | |
2205 | @itemdef{ @c unix, Any Unix platform @em except OS X } | |
2206 | @itemdef{ @c os2, OS/2 } | |
2207 | @endDefList | |
2208 | ||
2209 | Examples: | |
2210 | @code | |
2211 | <label platform="win">Windows</label> | |
2212 | <label platform="unix">Unix</label> | |
2213 | <label platform="mac">Mac OS X</label> | |
2214 | <help platform="mac|unix">Not a Windows machine</help> | |
2215 | @endcode | |
2216 | ||
2217 | ||
2218 | ||
2219 | @section overview_xrcformat_idranges ID Ranges | |
2220 | ||
2221 | Usually you won't care what value the XRCID macro returns for the ID of an | |
2222 | object. Sometimes though it is convenient to have a range of IDs that are | |
2223 | guaranteed to be consecutive. An example of this would be connecting a group of | |
2224 | similar controls to the same event handler. | |
2225 | ||
2226 | The following XRC fragment 'declares' an ID range called @em foo and another | |
2227 | called @em bar; each with some items. | |
2228 | ||
2229 | @code | |
2230 | <object class="wxButton" name="foo[start]"> | |
2231 | <object class="wxButton" name="foo[end]"> | |
2232 | <object class="wxButton" name="foo[2]"> | |
2233 | ... | |
2234 | <object class="wxButton" name="bar[0]"> | |
2235 | <object class="wxButton" name="bar[2]"> | |
2236 | <object class="wxButton" name="bar[1]"> | |
2237 | ... | |
2238 | <ids-range name="foo" /> | |
2239 | <ids-range name="bar" size="30" start="10000" /> | |
2240 | @endcode | |
2241 | ||
2242 | For the range foo, no @em size or @em start parameters were given, so the size | |
2243 | will be calculated from the number of range items, and IDs allocated by | |
2244 | wxWindow::NewControlId (so they'll be negative). Range bar asked for a size of | |
2245 | 30, so this will be its minimum size: should it have more items, the range will | |
2246 | automatically expand to fit them. It specified a start ID of 10000, so | |
2247 | XRCID("bar[0]") will be 10000, XRCID("bar[1]") 10001 etc. Note that if you | |
2248 | choose to supply a start value it must be positive, and it's your | |
2249 | responsibility to avoid clashes. | |
2250 | ||
2251 | For every ID range, the first item can be referenced either as | |
2252 | <em>rangename</em>[0] or <em>rangename</em>[start]. Similarly | |
2253 | <em>rangename</em>[end] is the last item. Using [start] and [end] is more | |
2254 | descriptive in e.g. a Bind() event range or a @em for loop, and they don't have | |
2255 | to be altered whenever the number of items changes. | |
2256 | ||
2257 | Whether a range has positive or negative IDs, [start] is always a smaller | |
2258 | number than [end]; so code like this works as expected: | |
2259 | ||
2260 | @code | |
2261 | for (int n=XRCID("foo[start]"); n <= XRCID("foo[end]"); ++n) | |
2262 | ... | |
2263 | @endcode | |
2264 | ||
2265 | ID ranges can be seen in action in the <em>objref</em> dialog section of the | |
2266 | @sample{xrc}. | |
2267 | ||
2268 | @note | |
2269 | @li All the items in an ID range must be contained in the same XRC file. | |
2270 | @li You can't use an ID range in a situation where static initialisation | |
2271 | occurs; in particular, they won't work as expected in an event table. This is | |
2272 | because the event table's IDs are set to their integer values before the XRC | |
2273 | file is loaded, and aren't subsequently altered when the XRCID value changes. | |
2274 | ||
2275 | @since 2.9.2 | |
2276 | ||
2277 | @section overview_xrcformat_extending Extending the XRC Format | |
2278 | ||
2279 | The XRC format is designed to be extensible and allows specifying and loading | |
2280 | custom controls. The three available mechanisms are described in the rest of | |
2281 | this section in the order of increasing complexity. | |
2282 | ||
2283 | @subsection overview_xrcformat_extending_subclass Subclassing | |
2284 | ||
2285 | The simplest way to add custom controls is to set the @c subclass attribute | |
2286 | of @c \<object\> element: | |
2287 | ||
2288 | @code | |
2289 | <object name="my_value" class="wxTextCtrl" subclass="MyTextCtrl"> | |
2290 | <style>wxTE_MULTILINE</style> | |
2291 | ...etc., setup wxTextCtrl as usual... | |
2292 | </object> | |
2293 | @endcode | |
2294 | ||
2295 | In that case, wxXmlResource will create an instance of the specified subclass | |
2296 | (@c MyTextCtrl in the example above) instead of the class (@c wxTextCtrl above) | |
2297 | when loading the resource. However, the rest of the object's loading (calling | |
2298 | its Create() method, setting its properties, loading any children etc.) | |
2299 | will proceed in @em exactly the same way as it would without @c subclass | |
2300 | attribute. In other words, this approach is only sufficient when the custom | |
2301 | class is just a small modification (e.g. overridden methods or customized | |
2302 | events handling) of an already supported classes. | |
2303 | ||
2304 | The subclass must satisfy a number of requirements: | |
2305 | ||
2306 | -# It must be derived from the class specified in @c class attribute. | |
2307 | -# It must be visible in wxWidget's pseudo-RTTI mechanism, i.e. there must be | |
2308 | a DECLARE_DYNAMIC_CLASS() entry for it. | |
2309 | -# It must support two-phase creation. In particular, this means that it has | |
2310 | to have default constructor. | |
2311 | -# It cannot provide custom Create() method and must be constructible using | |
2312 | base @c class' Create() method (this is because XRC will call Create() of | |
2313 | @c class, not @c subclass). In other words, @em creation of the control | |
2314 | must not be customized. | |
2315 | ||
2316 | ||
2317 | @subsection overview_xrcformat_extending_unknown Unknown Objects | |
2318 | ||
2319 | A more flexible solution is to put a @em placeholder in the XRC file and | |
2320 | replace it with custom control after the resource is loaded. This is done by | |
2321 | using the @c unknown pseudo-class: | |
2322 | ||
2323 | @code | |
2324 | <object class="unknown" name="my_placeholder"/> | |
2325 | @endcode | |
2326 | ||
2327 | The placeholder is inserted as dummy wxPanel that will hold custom control in | |
2328 | it. At runtime, after the resource is loaded and a window created from it | |
2329 | (using e.g. wxXmlResource::LoadDialog()), use code must call | |
2330 | wxXmlResource::AttachUnknownControl() to insert the desired control into | |
2331 | placeholder container. | |
2332 | ||
2333 | This method makes it possible to insert controls that are not known to XRC at | |
2334 | all, but it's also impossible to configure the control in XRC description in | |
2335 | any way. The only properties that can be specified are | |
2336 | the @ref overview_xrcformat_std_props "standard window properties". | |
2337 | ||
2338 | @note @c unknown class cannot be combined with @c subclass attribute, | |
2339 | they are mutually exclusive. | |
2340 | ||
2341 | ||
2342 | @subsection overview_xrcformat_extending_custom Adding Custom Classes | |
2343 | ||
2344 | Finally, XRC allows adding completely new classes in addition to the ones | |
2345 | listed in this document. A class for which wxXmlResourceHandler is implemented | |
2346 | can be used as first-class object in XRC simply by passing class name as the | |
2347 | value of @c class attribute: | |
2348 | ||
2349 | @code | |
2350 | <object name="my_ctrl" class="MyWidget"> | |
2351 | <my_prop>foo</my_prop> | |
2352 | ...etc., whatever MyWidget handler accepts... | |
2353 | </object> | |
2354 | @endcode | |
2355 | ||
2356 | The only requirements on the class are that | |
2357 | -# the class must derive from wxObject | |
2358 | -# it must support wxWidget's pseudo-RTTI mechanism | |
2359 | ||
2360 | Child elements of @c \<object\> are handled by the custom handler and there are | |
2361 | no limitations on them imposed by XRC format. | |
2362 | ||
2363 | This is the only mechanism that works for toplevel objects -- custom controls | |
2364 | are accessible using the type-unsafe wxXmlResource::LoadObject() method. | |
2365 | ||
2366 | ||
2367 | ||
2368 | @section overview_xrcformat_packed Packed XRC Files | |
2369 | ||
2370 | In addition to plain XRC files, wxXmlResource supports (if wxFileSystem support | |
2371 | is compiled in) compressed XRC resources. Compressed resources have either | |
2372 | .zip or .xrs extension and are simply ZIP files that contain arbitrary | |
2373 | number of XRC files and their dependencies (bitmaps, icons etc.). | |
2374 | ||
2375 | ||
2376 | ||
2377 | @section overview_xrcformat_oldversions Older Format Versions | |
2378 | ||
2379 | This section describes differences in older revisions of XRC format (i.e. | |
2380 | files with older values of @c version attribute of @c \<resource\>). | |
2381 | ||
2382 | ||
2383 | @subsection overview_xrcformat_pre_v2530 Versions Before 2.5.3.0 | |
2384 | ||
2385 | Version 2.5.3.0 introduced C-like handling of "\\" in text. In older versions, | |
2386 | "\n", "\t" and "\r" escape sequences were replaced with respective characters | |
2387 | in the same matter it's done in C, but "\\" was left intact instead of being | |
2388 | replaced with single "\", as one would expect. Starting with 2.5.3.0, all of | |
2389 | them are handled in C-like manner. | |
2390 | ||
2391 | ||
2392 | @subsection overview_xrcformat_pre_v2301 Versions Before 2.3.0.1 | |
2393 | ||
2394 | Prior to version 2.3.0.1, "$" was used for accelerators instead of "_" | |
2395 | or "&". For example, | |
2396 | @code | |
2397 | <label>$File</label> | |
2398 | @endcode | |
2399 | was used in place of current version's | |
2400 | @code | |
2401 | <label>_File</label> | |
2402 | @endcode | |
2403 | (or "&File"). | |
2404 | ||
2405 | */ |