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