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