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