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