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