]>
git.saurik.com Git - wxWidgets.git/blob - docs/doxygen/overviews/xrc_format.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: XRC format specification
4 // Author: Vaclav Slavik
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
11 NOTE: to make doxygen happy about <custom-tags> we're forced to
12 escape all < and > symbols which appear inside a doxygen comment
18 @page overview_xrcformat XRC file format
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
40 This document describes the format of XRC resource files, as used by wxXmlResource.
46 @section overview_xrcformat_overview Overview
48 XRC 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
51 as identical to @c http://www.wxwidgets.org/wxxrc), but it shouldn't be used
54 XRC file contains definitions for one or more @em objects -- typically
55 windows. The objects may themselves contain child objects.
57 Objects defined at the top level, under the
58 @ref overview_xrcformat_root "root element", can be accessed using
59 wxXmlResource::LoadDialog() and other LoadXXX methods. They must have
60 @c name attribute that is used as LoadXXX's argument (see
61 @ref overview_xrcformat_object for details).
63 Child objects are not directly accessible via wxXmlResource, they can only
64 be accessed using XRCCTRL().
67 @section overview_xrcformat_root Root element: \<resource\>
69 The root element is always @c \<resource\>. It has one optional attribute, @c
70 version. If set, it specifies version of the file. In absence of @c version
71 attribute, the default is @c "0.0.0.0".
73 The version consists of four integers separated by periods. The first three
74 components are major, minor and release number of the wxWidgets release when
75 the change was introduced, the last one is revision number and is 0 for the
76 first incompatible change in given wxWidgets release, 1 for the second and so
77 on. The version changes only if there was an incompatible change introduced;
78 merely adding new kind of objects does not constitute incompatible change.
80 At the time of writing, the latest version is @c "2.5.3.0".
82 Note that even though @c version attribute is optional, it should always be
83 specified to take advantage of the latest capabilities:
87 <resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
92 @c \<resource\> may have arbitrary number of
93 @ref overview_xrcformat_objects "object elements" as its children; they are referred
94 to as @em toplevel objects in the rest of this document. Unlike objects defined
95 deeper in the hierarchy, toplevel objects @em must have their @c name attribute
96 set and it must be set to a value unique among root's children.
100 @section overview_xrcformat_objects Defining objects
102 @subsection overview_xrcformat_object \<object\>
104 The @c \<object\> element represents a single object (typically a GUI element)
105 and it usually maps directly to a wxWidgets class instance. It has one
106 mandatory attribute, @c class, and optional @c name and @c subclass attributes.
108 The @c class attribute must always be present, it tells XRC what wxWidgets
109 object should be created and by which wxXmlResourceHandler.
111 @c name is the identifier used to identify the object. This name serves three
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.
124 Name attributes must be unique at the top level (where the name is used to
125 load resources) and should be unique among all controls within the same
126 toplevel window (wxDialog, wxFrame).
128 The @c subclass attribute optional name of class whose constructor will be
129 called instead of the constructor for "class".
130 See @ref overview_xrcformat_extending_subclass for more details.
132 @c \<object\> element may -- and almost always do -- have children elements.
133 These come in two varieties:
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
138 ("<label>Cancel</label>"), but they may use nested subelements too (e.g.
139 @ref overview_xrcformat_type_font "font property"). A property can only be
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
143 @c \<object\> elements and are can be repeated more than once. The specifics
144 of which object classes are allowed as children are class-specific and
145 are documented below in @ref overview_xrcformat_controls.
149 <object class="wxDialog" name="example_dialog">
151 <title>Non-Derived Dialog Example</title>
152 <centered>1</centered>
153 <!-- child objects: -->
154 <object class="wxBoxSizer">
155 <orient>wxVERTICAL</orient>
164 @subsection overview_xrcformat_object_ref \<object_ref\>
166 Anywhere an @c \<object\> element can be used, @c \<object_ref\> may be used
167 instead. @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
171 is made in place of @c \<object_ref\> occurrence and processed as usual.
173 For example, the following code:
175 <object class="wxDialog" name="my_dlg">
178 <object_ref name="my_dlg_alias" ref="my_dlg"/>
182 <object class="wxDialog" name="my_dlg">
185 <object class="wxDialog" name="my_dlg_alias">
186 ... <!-- same as in my_dlg -->
190 Additionally, it is possible to override some parts of the referenced object
191 in the @c \<object_ref\> pointing to it. This is useful for putting repetitive
192 parts of XRC definitions into a template that can be reused and customized in
193 several places. The two parts are merged as follows:
195 -# The referred object is used as the initial content.
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
198 the same name (and, if specified, the @c name attribute too) is found
199 in the referred object, they are recursively merged.
200 -# Child elements in @c \<object_ref\> that do not have a match in the referred
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.
206 For example, "my_dlg" in this snippet:
208 <object class="wxDialog" name="template">
209 <title>Dummy dialog</title>
212 <object_ref ref="template" name="my_dlg">
213 <title>My dialog</title>
214 <centered>1</centered>
219 <object_ref ref="template" name="my_dlg">
220 <title>My dialog</title>
222 <centered>1</centered>
227 @section overview_xrcformat_datatypes Data types
229 There are several property data types that are frequently reused by different
230 properties. Rather than describing their format in the documentation of
231 every property, we list commonly used types in this section and document
235 @subsection overview_xrcformat_type_bool Boolean
237 Boolean values are expressed using either "1" literal (true) or "0" (false).
240 @subsection overview_xrcformat_type_float Floating-point value
242 Floating point values use POSIX (C locale) formatting -- decimal separator
243 is "." regardless of the locale.
246 @subsection overview_xrcformat_type_colour Colour
248 Colour specification can be either any string colour representation accepted
249 by wxColour::Set() or any wxSYS_COLOUR_XXX symbolic name accepted by
250 wxSystemSettings::GetColour(). In particular, the following forms are supported:
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
261 <fg>rgb(255,0,0)</fg>
262 <fg>wxSYS_COLOUR_HIGHLIGHT</fg>
266 @subsection overview_xrcformat_type_size Size
268 Sizes and positions have the form of string with two comma-separated integer
269 components, with optional "d" suffix. Semi-formally:
271 size := x "," y ["d"]
273 where x and y are integers. Either of the components (or both) may be "-1" to
274 signify default value. As a shortcut, empty string is equivalent to "-1,-1"
275 (= wxDefaultSize or wxDefaultPosition).
277 When the "d" suffix is used, integer values are interpreted as
278 @ref wxWindow::ConvertDialogToPixels() "dialog units" in the parent window.
287 @subsection overview_xrcformat_type_pos Position
289 Same as @ref overview_xrcformat_type_size.
292 @subsection overview_xrcformat_type_dimension Dimension
294 Similarly to @ref overview_xrcformat_type_size "sizes", dimensions are expressed
295 as integers with optional "d" suffix. When "d" suffix is used, the integer
296 preceding it is interpreted as dialog units in the parent window.
299 @subsection overview_xrcformat_type_text Text
301 String properties use several escape sequences that are translated according to
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{ "\\", "\" }
312 By default, the text is translated using wxLocale::GetTranslation() before
313 it is used. This can be disabled either globally by not passing
314 wxXRC_USE_LOCALE to wxXmlResource constructor, or by setting the @c translate
315 attribute on the property node to "0":
317 <!-- this is not translated: -->
318 <label translate="0">_Unix</label>
319 <!-- but this is: -->
320 <help>Use Unix-style newlines</help>
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 "&",
325 though, so using "_" is more convenient.
327 @see @ref overview_xrcformat_pre_v2530, @ref overview_xrcformat_pre_v2301
330 @subsection overview_xrcformat_type_text_notrans Non-translatable text
332 Like @ref overview_xrcformat_type_text, but the text is never translated and
333 @c translate attribute cannot be used.
336 @subsection overview_xrcformat_type_string URL
338 An unformatted string. Unlike with @ref overview_xrcformat_type_text, no escaping
339 or translations are done.
342 @subsection overview_xrcformat_type_url URL
344 Any URL accepted by wxFileSystem (typically relative to XRC file's location,
345 but can be absolute too). Unlike with @ref overview_xrcformat_type_text, no escaping
346 or translations are done.
349 @subsection overview_xrcformat_type_bitmap Bitmap
351 Bitmap properties contain specification of a single bitmap or icon. In the most
352 basic form, their text value is simply a relative filename (or another
353 wxFileSystem URL) of the bitmap to use. For example:
355 <object class="tool" name="wxID_NEW">
356 <tooltip>New</tooltip>
357 <bitmap>new.png</bitmap>
360 The value is interpreted as path relative to the location of XRC file where the
363 Alternatively, it is possible to specify the bitmap using wxArtProvider IDs.
364 In this case, the property element has no textual value (filename) and instead
365 has the @c stock_id XML attribute that contains stock art ID as accepted by
366 wxArtProvider::GetBitmap(). This can be either custom value (if the app uses
367 app-specific art provider) or one of the predefined wxART_XXX constants.
369 Optionally, @c stock_client attribute may be specified too and contain one of
370 the predefined wxArtClient values. If it is not specified, the default client
371 ID most appropriate in the context where the bitmap is referenced will be used.
372 In most cases, specifying @c stock_client is not needed.
374 Examples of stock bitmaps usage:
376 <bitmap stock_id="fixed-width"/> <!-- custom app-specific art -->
377 <bitmap stock_id="wxART_FILE_OPEN"/> <!-- standard art -->
380 Specifying the bitmap directly and using @c stock_id are mutually exclusive.
383 @subsection overview_xrcformat_type_style Style
385 Style properties (such as window's style or sizer flags) use syntax similar to
386 C++: the style value is OR-combination of individual flags. Symbolic names
387 identical to those used in C++ code are used for the flags. Flags are separated
388 with "|" (whitespace is allowed but not required around it).
390 The flags that are allowed for a given property are context-dependent.
394 <style>wxCAPTION|wxSYSTEM_MENU | wxRESIZE_BORDER</style>
395 <exstyle>wxDIALOG_EX_CONTEXTHELP</exstyle>
399 @subsection overview_xrcformat_type_font Font
401 XRC uses similar, but more flexible, abstract description of fonts to that
402 used by wxFont class. A font can be described either in terms of its elementary
403 properties, or it can be derived from one of system fonts.
405 The font property element is "composite" element: unlike majority of
406 properties, it doesn't have text value but contains several child elements
407 instead. These children are handled in the same way as object properties
408 and can be one of the following "sub-properties":
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"
422 @row3col{underlined, @ref overview_xrcformat_type_bool,
423 Whether the font should be underlined (default: 0).}
425 Comma-separated list of face names; the first one available is used
426 (default: unspecified).}
428 Charset of the font, unused in Unicode build), as string
429 (default: unspecified).}
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.}
437 All of them are optional, if they are missing, appropriate wxFont default is
438 used. If the @c sysfont property is used, then the defaults are taken from it
444 <!-- fixed font: Arial if available, fall back to Helvetica -->
445 <face>arial,helvetica</face>
450 <!-- enlarged, enboldened standard font: -->
451 <sysfont>wxSYS_DEFAULT_GUI_FONT</sysfont>
452 <weight>bold</weight>
453 <relativesize>1.5</relativesize>
458 @section overview_xrcformat_windows Controls and windows
460 This section describes support wxWindow-derived classes in XRC format.
462 @subsection overview_xrcformat_std_props Standard properties
464 The following properties are always (unless stated otherwise in
465 control-specific docs) available for @em windows objects. They are omitted
466 from properties lists below.
469 @hdr3col{property, type, description}
470 @row3col{pos, @ref overview_xrcformat_type_pos,
471 Initial position of the window (default: wxDefaultPosition).}
472 @row3col{size, @ref overview_xrcformat_type_size,
473 Initial size of the window (default: wxDefaultSize).}
474 @row3col{style, @ref overview_xrcformat_type_style,
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).}
479 @row3col{exstyle, @ref overview_xrcformat_type_style,
480 Extra style for the window, if any. See wxWindow::SetExtraStyle()
482 @row3col{fg, @ref overview_xrcformat_type_colour,
483 Foreground colour of the window (default: window's default).}
484 @row3col{bg, @ref overview_xrcformat_type_colour,
485 Background colour of the window (default: window's default).}
486 @row3col{enabled, @ref overview_xrcformat_type_bool,
487 If set to 0, the control is disabled (default: 1).}
488 @row3col{hidden, @ref overview_xrcformat_type_bool,
489 If set to 1, the control is created hidden (default: 0).}
490 @row3col{tooltip, @ref overview_xrcformat_type_text,
491 Tooltip to use for the control (default: not set).}
492 @row3col{font, @ref overview_xrcformat_type_font,
493 Font to use for the control (default: window's default).}
494 @row3col{help, @ref overview_xrcformat_type_text,
495 Context-sensitive help for the control, used by wxHelpProvider
499 All of these properties are optional.
502 @subsection overview_xrcformat_controls Supported controls
504 This section lists all controls supported by default. For each control, its
505 control-specific properties are listed. If the control can have child objects,
506 it is documented there too; unless said otherwise, XRC elements for these
507 controls cannot have children.
509 @subsubsection xrc_wxanimationctrl wxAnimationCtrl
512 @hdr3col{property, type, description}
513 @row3col{animation, @ref overview_xrcformat_type_url,
514 Animation file to load into the control (required).}
518 @subsubsection xrc_wxbitmapbutton wxBitmapButton
521 @hdr3col{property, type, description}
522 @row3col{default, @ref overview_xrcformat_type_bool,
523 Should this button be the default button in dialog (default: 0)?}
524 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
525 Bitmap to show on the button (required).}
526 @row3col{selected, @ref overview_xrcformat_type_bitmap,
527 Bitmap to show when the button is selected (default: none, same as @c bitmap).}
528 @row3col{focus, @ref overview_xrcformat_type_bitmap,
529 Bitmap to show when the button has focus (default: none, same as @c bitmap).}
530 @row3col{disabled, @ref overview_xrcformat_type_bitmap,
531 Bitmap to show when the button is disabled (default: none, same as @c bitmap).}
532 @row3col{hover, @ref overview_xrcformat_type_bitmap,
533 Bitmap to show when mouse cursor hovers above the bitmap (default: none, same as @c bitmap).}
537 @subsubsection xrc_wxbitmapcombobox wxBitmapComboBox
540 @hdr3col{property, type, description}
541 @row3col{selection, integer,
542 Index of the initially selected item or -1 for no selection (default: -1).}
543 @row3col{value, @ref overview_xrcformat_type_string,
544 Initial value in the control (doesn't have to be one of @ content values;
548 If both @c value and @c selection are specified and @c selection is not -1,
549 then @c selection takes precedence.
551 A wxBitmapComboBox can have one or more child objects of the @c ownerdrawnitem
552 pseudo-class. @c ownerdrawnitem objects have the following properties:
555 @hdr3col{property, type, description}
556 @row3col{text, @ref overview_xrcformat_type_text,
557 Item's label (required).}
558 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
559 Item's bitmap (default: no bitmap).}
564 <object class="wxBitmapComboBox">
565 <selection>1</selection>
566 <object class="ownerdrawnitem">
568 <bitmap>foo.png</bitmap>
570 <object class="ownerdrawnitem">
572 <bitmap>bar.png</bitmap>
578 @subsubsection xrc_wxbutton wxButton
581 @hdr3col{property, type, description}
582 @row3col{label, @ref overview_xrcformat_type_text,
583 Label to display on the button (required).}
584 @row3col{default, @ref overview_xrcformat_type_bool,
585 Should this button be the default button in dialog (default: 0)?}
589 @subsubsection xrc_wxcalendarctrl wxCalendarCtrl
591 No additional properties.
594 @subsubsection xrc_wxcheckbox wxCheckBox
597 @hdr3col{property, type, description}
598 @row3col{label, @ref overview_xrcformat_type_text,
599 Label to use for the checkbox (required).}
600 @row3col{checked, @ref overview_xrcformat_type_bool,
601 Should the checkbox be checked initially (default: 0)?}
605 @subsubsection xrc_wxchecklistbox wxCheckListBox
608 @hdr3col{property, type, description}
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
615 The @c \<item\> elements have listbox items' labels as their text values. They
616 can also have optional @c checked XML attribute -- if set to "1", the value is
621 <object class="wxCheckListBox">
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>
633 @subsubsection xrc_wxchoice wxChoice
636 @hdr3col{property, type, description}
637 @row3col{selection, integer,
638 Index of the initially selected item or -1 for no selection (default: -1).}
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
647 <object class="wxChoice" name="controls_choice">
654 <item>The Sixth Sense!</item>
660 @subsubsection xrc_wxchoicebook wxChoicebook
662 No additional properties.
664 A choicebook can have one or more child objects of the @c choicebookpage
665 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
666 @c notebookpage). @c choicebookpage objects have the following properties:
669 @hdr3col{property, type, description}
670 @row3col{label, @ref overview_xrcformat_type_text,
671 Sheet page's title (required).}
672 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
673 Bitmap shown alongside the label (default: none).}
674 @row3col{selected, @ref overview_xrcformat_type_bool,
675 Is the page selected initially (only one page can be selected; default: 0)?}
678 Each @c choicebookpage has exactly one non-toplevel window as its child.
681 @subsubsection xrc_wxcollapsiblepane wxCollapsiblePane
684 @hdr3col{property, type, description}
685 @row3col{label, @ref overview_xrcformat_type_text,
686 Label to use for the collapsible section (required).}
687 @row3col{collapsed, @ref overview_xrcformat_type_bool,
688 Should the pane be collapsed initially (default: 0)?}
691 wxCollapsiblePane may contain single optional child object of the @c panewindow
692 pseudo-class type. @c panewindow itself must contain exactly one child that
693 is a @ref overview_xrcformat_sizers "sizer" or a non-toplevel window
697 @subsubsection xrc_wxcolourpickerctrl wxColourPickerCtrl
700 @hdr3col{property, type, description}
701 @row3col{value, @ref overview_xrcformat_type_colour,
702 Initial value of the control (default: wxBLACK).}
706 @subsubsection xrc_wxcombobox wxComboBox
709 @hdr3col{property, type, description}
710 @row3col{selection, integer,
711 Index of the initially selected item or -1 for no selection (default: not used).}
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
716 @row3col{value, @ref overview_xrcformat_type_string,
717 Initial value in the control (doesn't have to be one of @ content values;
721 If both @c value and @c selection are specified and @c selection is not -1,
722 then @c selection takes precedence.
726 <object class="wxComboBox" name="controls_combobox">
727 <style>wxCB_DROPDOWN</style>
732 <item>notepad.exe</item>
738 @subsubsection xrc_wxdatepickerctrl wxDatePickerCtrl
740 No additional properties.
743 @subsubsection xrc_wxdialog wxDialog
746 @hdr3col{property, type, description}
747 @row3col{title, @ref overview_xrcformat_type_text,
748 Dialog's title (default: empty).}
749 @row3col{icon, @ref overview_xrcformat_type_bitmap,
750 Dialog's icon (default: not used).}
751 @row3col{centered, @ref overview_xrcformat_type_bool,
752 Whether the dialog should be centered on the screen (default: 0).}
755 wxDialog may have optional children: either exactly one
756 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
757 objects. If sizer child is used, it sets
758 @ref wxSizer::SetSizeHints() "size hints" too.
760 @subsubsection xrc_wxdirpickerctrl wxDirPickerCtrl
763 @hdr3col{property, type, description}
764 @row3col{value, @ref overview_xrcformat_type_string,
765 Initial value of the control (default: empty).}
766 @row3col{message, @ref overview_xrcformat_type_text,
767 Message shown to the user in wxDirDialog shown by the control (required).}
771 @subsubsection xrc_wxfilepickerctrl wxFilePickerCtrl
774 @hdr3col{property, type, description}
775 @row3col{value, @ref overview_xrcformat_type_string,
776 Initial value of the control (default: empty).}
777 @row3col{message, @ref overview_xrcformat_type_text,
778 Message shown to the user in wxDirDialog shown by the control (required).}
779 @row3col{wildcard, @ref overview_xrcformat_type_string,
780 Message shown to the user in wxDirDialog shown by the control (required).}
784 @subsubsection xrc_wxfontpickerctrl wxFontPickerCtrl
787 @hdr3col{property, type, description}
788 @row3col{value, @ref overview_xrcformat_type_font,
789 Initial value of the control (default: wxNORMAL_FONT).}
792 @subsubsection xrc_wxfrane wxFrame
795 @hdr3col{property, type, description}
796 @row3col{title, @ref overview_xrcformat_type_text,
797 Frame's title (default: empty).}
798 @row3col{icon, @ref overview_xrcformat_type_bitmap,
799 Frame's icon (default: not used).}
800 @row3col{centered, @ref overview_xrcformat_type_bool,
801 Whether the frame should be centered on the screen (default: 0).}
804 wxFrame may have optional children: either exactly one
805 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
806 objects. If sizer child is used, it sets
807 @ref wxSizer::SetSizeHints() "size hints" too.
810 @subsubsection xrc_wxgauge wxGauge
813 @hdr3col{property, type, description}
814 @row3col{range, integer,
815 Maximum value of the gauge (default: 100).}
816 @row3col{value, integer,
817 Initial value of the control (default: 0).}
818 @row3col{shadow, @ref overview_xrcformat_type_dimension,
819 Rendered shadow size (default: none; ignored by most platforms).}
820 @row3col{bezel, @ref overview_xrcformat_type_dimension,
821 Rendered bezel size (default: none; ignored by most platforms).}
824 @subsubsection xrc_wxgenericdirctrl wxGenericDirCtrl
827 @hdr3col{property, type, description}
828 @row3col{defaultfolder, @ref overview_xrcformat_type_text,
829 Initial folder (default: empty).}
830 @row3col{filter, @ref overview_xrcformat_type_text,
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).}
837 @subsubsection xrc_wxgrid wxGrid
839 No additional properties.
842 @subsubsection xrc_wxhtmlwindow wxHtmlWindow
845 @hdr3col{property, type, description}
846 @row3col{url, @ref overview_xrcformat_type_url,
847 Page to display in the window.}
848 @row3col{htmlcode, @ref overview_xrcformat_type_text,
849 HTML markup to display in the window.}
850 @row3col{borders, @ref overview_xrcformat_type_dimension,
851 Border around HTML content (default: 0).}
854 At most one of @c url and @c htmlcode properties may be specified, they are
855 mutually exclusive. If neither is set, the window is initialized to show empty
859 @subsubsection xrc_wxhyperlinkctrl wxHyperlinkCtrl
862 @hdr3col{property, type, description}
863 @row3col{label, @ref overview_xrcformat_type_text,
864 Label to display on the control (required).}
865 @row3col{url, @ref overview_xrcformat_type_url,
866 URL to open when the link is clicked (required).}
870 @subsubsection xrc_wxlistbox wxListBox
873 @hdr3col{property, type, description}
874 @row3col{selection, integer,
875 Index of the initially selected item or -1 for no selection (default: -1).}
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
884 <object class="wxListBox" name="controls_listbox">
886 <style>wxLB_SINGLE</style>
891 <item>Orange juice</item>
892 <item>Paper towels</item>
898 @subsubsection xrc_wxlistbook wxListbook
900 No additional properties.
902 A listbook can have one or more child objects of the @c listbookpage
903 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
904 @c notebookpage). @c listbookpage objects have the following properties:
907 @hdr3col{property, type, description}
908 @row3col{label, @ref overview_xrcformat_type_text,
909 Sheet page's title (required).}
910 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
911 Bitmap shown alongside the label (default: none).}
912 @row3col{selected, @ref overview_xrcformat_type_bool,
913 Is the page selected initially (only one page can be selected; default: 0)?}
916 Each @c listbookpage has exactly one non-toplevel window as its child.
919 @subsubsection xrc_wxlistctrl wxListCtrl
921 No additional properties.
924 @subsubsection xrc_wxmdiparentframe wxMDIParentFrame
926 wxMDIParentFrame supports the same properties that @ref xrc_wxfrane does.
928 wxMDIParentFrame may have optional children. When used, the child objects
929 must be of wxMDIChildFrame type.
932 @subsubsection xrc_wxmdichildframe wxMDIChildFrame
934 wxMDIChildFrame supports the same properties that @ref xrc_wxfrane and
935 @ref xrc_wxmdiparentframe do.
937 wxMDIChildFrame can only be used as as immediate child of @ref
938 xrc_wxmdiparentframe.
940 wxMDIChildFrame may have optional children: either exactly one
941 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
942 objects. If sizer child is used, it sets
943 @ref wxSizer::SetSizeHints() "size hints" too.
946 @subsubsection xrc_wxmenu wxMenu
949 @hdr3col{property, type, description}
950 @row3col{label, @ref overview_xrcformat_type_text,
951 Menu's label (default: empty, but required for menus other
953 @row3col{help, @ref overview_xrcformat_type_text,
954 Help shown in statusbar when the menu is selected (only for submenus
955 of another wxMenu, default: none).}
956 @row3col{enabled, @ref overview_xrcformat_type_bool,
957 Is the submenu item enabled (only for submenus of another wxMenu,
961 Note that unlike most controls, wxMenu does @em not have
962 @ref overview_xrcformat_std_props.
964 A menu object can have one or more child objects of the wxMenuItem or wxMenu
965 classes or @c break or @c separator pseudo-classes.
967 The @c separator pseudo-class is used to insert separators into the menu and
968 has neither properties nor children. Likewise, @c break inserts a break (see
971 wxMenuItem objects support the following properties:
974 @hdr3col{property, type, description}
975 @row3col{label, @ref overview_xrcformat_type_text,
976 Item's label (required).}
977 @row3col{accel, @ref overview_xrcformat_type_text_notrans,
978 Item's accelerator (default: none).}
979 @row3col{radio, @ref overview_xrcformat_type_bool,
980 Item's kind is wxITEM_RADIO (default: 0)?}
981 @row3col{checkable, @ref overview_xrcformat_type_bool,
982 Item's kind is wxITEM_CHECK (default: 0)?}
983 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
984 Bitmap to show with the item (default: none).}
985 @row3col{bitmap2, @ref overview_xrcformat_type_bitmap,
986 Bitmap for the checked state (wxMSW, if checkable; default: none).}
987 @row3col{help, @ref overview_xrcformat_type_text,
988 Help shown in statusbar when the item is selected (default: none).}
989 @row3col{enabled, @ref overview_xrcformat_type_bool,
990 Is the item enabled (default: 1)?}
991 @row3col{checked, @ref overview_xrcformat_type_bool,
992 Is the item checked initially (default: 0)?}
997 <object class="wxMenu" name="menu_edit">
998 <style>wxMENU_TEAROFF</style>
1000 <object class="wxMenuItem" name="wxID_FIND">
1001 <label>_Find...</label>
1002 <accel>Ctrl-F</accel>
1004 <object class="separator"/>
1005 <object class="wxMenuItem" name="menu_fuzzy">
1006 <label>Translation is _fuzzy</label>
1007 <checkable>1</checkable>
1009 <object class="wxMenu" name="submenu">
1010 <label>A submenu</label>
1011 <object class="wxMenuItem" name="foo">...</object>
1014 <object class="separator" platform="unix"/>
1015 <object class="wxMenuItem" name="wxID_PREFERENCES" platform="unix">
1016 <label>_Preferences</label>
1021 @subsubsection xrc_wxmenubar wxMenuBar
1023 No properties. Note that unlike most controls, wxMenuBar does @em not have
1024 @ref overview_xrcformat_std_props.
1026 A menubar can have one or more child objects of the @ref xrc_wxmenu "wxMenu"
1030 @subsubsection xrc_wxnotebook wxNotebook
1032 No additional properties.
1034 A notebook can have one or more child objects of the @c notebookpage
1035 pseudo-class. @c notebookpage objects have the following properties:
1038 @hdr3col{property, type, description}
1039 @row3col{label, @ref overview_xrcformat_type_text,
1040 Page's title (required).}
1041 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1042 Bitmap shown alongside the label (default: none).}
1043 @row3col{selected, @ref overview_xrcformat_type_bool,
1044 Is the page selected initially (only one page can be selected; default: 0)?}
1047 Each @c notebookpage has exactly one non-toplevel window as its child.
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">
1059 <object class="notebookpage">
1060 <label>Page 2</label>
1061 <object class="wxPanel" name="page_2">
1069 @subsubsection xrc_wxownerdrawncombobox wxOwnerDrawnComboBox
1071 wxOwnerDrawnComboBox has the same properties as
1072 @ref xrc_wxcombobox "wxComboBox", plus the following additional properties:
1075 @hdr3col{property, type, description}
1076 @row3col{buttonsize, @ref overview_xrcformat_type_size,
1077 Size of the dropdown button (default: default).}
1081 @subsubsection xrc_wxpanel wxPanel
1083 No additional properties.
1085 wxPanel may have optional children: either exactly one
1086 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
1090 @subsubsection xrc_wxpropertysheetdialog wxPropertySheetDialog
1093 @hdr3col{property, type, description}
1094 @row3col{title, @ref overview_xrcformat_type_text,
1095 Dialog's title (default: empty).}
1096 @row3col{icon, @ref overview_xrcformat_type_bitmap,
1097 Dialog's icon (default: not used).}
1098 @row3col{centered, @ref overview_xrcformat_type_bool,
1099 Whether the dialog should be centered on the screen (default: 0).}
1100 @row3col{buttons, @ref overview_xrcformat_type_style,
1101 Buttons to show, combination of flags accepted by
1102 wxPropertySheetDialog::CreateButtons() (default: 0).}
1105 A sheet dialog can have one or more child objects of the @c propertysheetpage
1106 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
1107 @c notebookpage). @c propertysheetpage objects have the following properties:
1110 @hdr3col{property, type, description}
1111 @row3col{label, @ref overview_xrcformat_type_text,
1112 Sheet page's title (required).}
1113 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1114 Bitmap shown alongside the label (default: none).}
1115 @row3col{selected, @ref overview_xrcformat_type_bool,
1116 Is the page selected initially (only one page can be selected; default: 0)?}
1119 Each @c propertysheetpage has exactly one non-toplevel window as its child.
1122 @subsubsection xrc_wxradiobutton wxRadioButton
1125 @hdr3col{property, type, description}
1126 @row3col{label, @ref overview_xrcformat_type_text,
1127 Label shown on the radio button (required).}
1128 @row3col{value, @ref overview_xrcformat_type_bool,
1129 Initial value of the control (default: 0).}
1133 @subsubsection xrc_wxradiobox wxRadioBox
1136 @hdr3col{property, type, description}
1137 @row3col{label, @ref overview_xrcformat_type_text,
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).}
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).}
1151 The @c \<item\> elements have radio buttons' labels as their text values. They
1152 can also have some optional XML @em attributes (not properties!):
1155 @hdr3col{attribute, type, description}
1156 @row3col{tooltip, @ref overview_xrcformat_type_string,
1157 Tooltip to show over this ratio button (default: none).}
1158 @row3col{helptext, @ref overview_xrcformat_type_string,
1159 Contextual help for this radio button (default: none).}
1160 @row3col{enabled, @ref overview_xrcformat_type_bool,
1161 Is the button enabled (default: 1)?}
1162 @row3col{hidden, @ref overview_xrcformat_type_bool,
1163 Is the button hidden initially (default: 0)?}
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>
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>
1180 <item hidden="1">Very quit station</item>
1186 @subsubsection xrc_wxrichtextctrl wxRichTextCtrl
1189 @hdr3col{property, type, description}
1190 @row3col{value, @ref overview_xrcformat_type_text,
1191 Initial value of the control (default: empty).}
1192 @row3col{maxlength, integer,
1193 Maximum length of the text entered (default: unlimited).}
1197 @subsubsection xrc_wxscrollbar wxScrollBar
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).}
1211 @subsubsection xrc_wxscrolledwindow wxScrolledWindow
1214 @hdr3col{property, type, description}
1215 @row3col{scrollrate, @ref overview_xrcformat_type_size,
1216 Scroll rate in @em x and @em y directions (default: not set;
1217 required if the window has a sizer child).}
1220 wxScrolledWindow may have optional children: either exactly one
1221 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
1222 objects. If sizer child is used, wxSizer::FitInside() is used (instead of
1223 wxSizer::Fit() as usual) and so the children don't determine scrolled window's
1224 minimal size, they only affect @em virtual size. Usually, both @c scrollrate
1225 and either @c size or @c minsize on containing sizer item should be used
1229 @subsubsection xrc_wxsimplehtmllistbox wxSimpleHtmlListBox
1231 wxSimpleHtmlListBox has same properties as @ref xrc_wxlistbox "wxListBox".
1232 The only difference is that the text contained in @c \<item\> elements is
1233 HTML markup. Note that the markup has to be escaped:
1236 <object class="wxSimpleHtmlListBox">
1238 <item><b>Bold</b> Milk</item>
1243 (X)HTML markup elements cannot be included directly:
1246 <object class="wxSimpleHtmlListBox">
1248 <!-- This is incorrect, doesn't work! -->
1249 <item><b>Bold</b> Milk</item>
1255 @subsubsection xrc_wxslider wxSlider
1258 @hdr3col{property, type, description}
1259 @row3col{value, integer,
1260 Initial value of the control (default: 0).}
1261 @row3col{min, integer,
1262 Minimum allowed value (default: 0).}
1263 @row3col{max, integer,
1264 Maximum allowed value (default: 100).}
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).}
1284 @subsubsection xrc_wxspinbutton wxSpinButton
1287 @hdr3col{property, type, description}
1288 @row3col{value, integer,
1289 Initial value of the control (default: 0).}
1290 @row3col{min, integer,
1291 Minimum allowed value (default: 0).}
1292 @row3col{max, integer,
1293 Maximum allowed value (default: 100).}
1297 @subsubsection xrc_wxspinctrl wxSpinCtrl
1299 wxSpinCtrl supports the properties as @ref xrc_wxspinbutton.
1302 @subsubsection xrc_wxsplitterwindow wxSplitterWindow
1305 @hdr3col{property, type, description}
1306 @row3col{orientation, @ref overview_xrcformat_type_string,
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).}
1312 @row3col{minsize, @ref overview_xrcformat_type_float,
1313 Sash gravity, see wxSplitterWindow::SetSashGravity() (default: not set).}
1316 wxSplitterWindow must have one or two children that are non-toplevel window
1317 objects. If there's only one child, it is used as wxSplitterWindow's only
1318 visible child. If there are two children, the first one is used for left/top
1319 child and the second one for right/bottom child window.
1322 @subsubsection xrc_wxsearchctrl wxSearchCtrl
1325 @hdr3col{property, type, description}
1326 @row3col{value, @ref overview_xrcformat_type_text,
1327 Initial value of the control (default: empty).}
1331 @subsubsection xrc_wxstatusbar wxStatusBar
1334 @hdr3col{property, type, description}
1335 @row3col{fields, integer,
1336 Number of status bar fields (default: 1).}
1337 @row3col{widths, @ref overview_xrcformat_type_string,
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().}
1341 @row3col{styles, @ref overview_xrcformat_type_string,
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.}
1349 @subsubsection xrc_wxstaticbitmap wxStaticBitmap
1352 @hdr3col{property, type, description}
1353 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1354 Bitmap to display (required).}
1357 @subsubsection xrc_wxstaticbox wxStaticBox
1360 @hdr3col{property, type, description}
1361 @row3col{label, @ref overview_xrcformat_type_text,
1362 Static box's label (required).}
1366 @subsubsection xrc_wxstaticline wxStaticLine
1368 No additional properties.
1371 @subsubsection xrc_wxstatictext wxStaticText
1374 @hdr3col{property, type, description}
1375 @row3col{label, @ref overview_xrcformat_type_text,
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).}
1382 @subsubsection xrc_wxtextctrl wxTextCtrl
1385 @hdr3col{property, type, description}
1386 @row3col{value, @ref overview_xrcformat_type_text,
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).}
1393 @subsubsection xrc_wxtogglebuttton wxToggleButton
1396 @hdr3col{property, type, description}
1397 @row3col{label, @ref overview_xrcformat_type_text,
1398 Label to display on the button (required).}
1399 @row3col{checked, @ref overview_xrcformat_type_bool,
1400 Should the button be checked/pressed initially (default: 0)?}
1403 @subsubsection xrc_wxtoolbar wxToolBar
1406 @hdr3col{property, type, description}
1407 @row3col{bitmapsize, @ref overview_xrcformat_type_size,
1408 Size of toolbar bitmaps (default: not set).}
1409 @row3col{margins, @ref overview_xrcformat_type_size,
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).}
1415 @row3col{dontattachtoframe, @ref overview_xrcformat_type_bool,
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).}
1422 A toolbar can have one or more child objects of any wxControl-derived class or
1423 one of two pseudo-classes: @c separator or @c tool.
1425 The @c separator pseudo-class is used to insert separators into the toolbar and
1426 has neither properties nor children.
1428 The @c tool pseudo-class objects specify toolbar buttons and have the following
1432 @hdr3col{property, type, description}
1433 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1434 Tool's bitmap (required).}
1435 @row3col{bitmap2, @ref overview_xrcformat_type_bitmap,
1436 Bitmap for disabled tool (default: derived from @c bitmap).}
1437 @row3col{label, @ref overview_xrcformat_type_text,
1438 Label to display on the tool (default: no label).}
1439 @row3col{radio, @ref overview_xrcformat_type_bool,
1440 Item's kind is wxITEM_RADIO (default: 0)?}
1441 @row3col{toggle, @ref overview_xrcformat_type_bool,
1442 Item's kind is wxITEM_CHECK (default: 0)?}
1443 @row3col{tooltip, @ref overview_xrcformat_type_text,
1444 Tooltip to use for the tool (default: none).}
1445 @row3col{longhelp, @ref overview_xrcformat_type_text,
1446 Help text shown in statusbar when the mouse is on the tool (default: none).}
1447 @row3col{disabled, @ref overview_xrcformat_type_bool,
1448 Is the tool initially disabled (default: 0)?}
1451 @c radio and @c toggle are mutually exclusive.
1453 Children that are neither @c tool nor @c separator must be instances of classes
1454 derived from wxControl and are added to the toolbar using
1455 wxToolBar::AddControl().
1459 <object class="wxToolBar">
1460 <style>wxTB_FLAT|wxTB_NODIVIDER</style>
1461 <object class="tool" name="foo">
1462 <bitmap>foo.png</bitmap>
1465 <object class="tool" name="bar">
1466 <bitmap>bar.png</bitmap>
1469 <object class="separator"/>
1470 <object class="wxComboBox">
1473 <item>a combobox</item>
1474 <item>in the toolbar</item>
1482 @subsubsection xrc_wxtreectrl wxTreeCtrl
1484 No additional properties.
1487 @subsubsection xrc_wxtreebook wxTreebook
1489 No additional properties.
1491 A treebook can have one or more child objects of the @c treebookpage
1492 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
1493 @c notebookpage). @c treebookpage objects have the following properties:
1496 @hdr3col{property, type, description}
1497 @row3col{depth, integer,
1498 Page's depth in the labels tree (required; see below).}
1499 @row3col{label, @ref overview_xrcformat_type_text,
1500 Sheet page's title (required).}
1501 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1502 Bitmap shown alongside the label (default: none).}
1503 @row3col{selected, @ref overview_xrcformat_type_bool,
1504 Is the page selected initially (only one page can be selected; default: 0)?}
1507 Each @c treebookpage has exactly one non-toplevel window as its child.
1509 The tree of labels is not described using nested @c treebookpage objects, but
1510 using the @em depth property. Toplevel pages have depth 0, their child pages
1511 have depth 1 and so on. A @c treebookpage's label is inserted as child of
1512 the latest preceding page with depth equal to @em depth-1. For example, this
1516 <object class="wxTreebook">
1518 <object class="treebookpage">
1520 <label>Page 1</label>
1521 <object class="wxPanel">...</object>
1523 <object class="treebookpage">
1525 <label>Subpage 1A</label>
1526 <object class="wxPanel">...</object>
1528 <object class="treebookpage">
1530 <label>Subsubpage 1</label>
1531 <object class="wxPanel">...</object>
1533 <object class="treebookpage">
1535 <label>Subpage 1B</label>
1536 <object class="wxPanel">...</object>
1538 <object class="treebookpage">
1540 <label>Subsubpage 2</label>
1541 <object class="wxPanel">...</object>
1543 <object class="treebookpage">
1545 <label>Page 2</label>
1546 <object class="wxPanel">...</object>
1551 corresponds to the following tree of labels:
1561 @subsubsection xrc_wxwizard wxWizard
1564 @hdr3col{property, type, description}
1565 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1566 Bitmap to display on the left side of the wizard (default: none).}
1569 A wizard object can have one or more child objects of the wxWizardPage or
1570 wxWizardPageSimple classes. They both support the following properties
1571 (in addition to @ref overview_xrcformat_std_props):
1574 @hdr3col{property, type, description}
1575 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1576 Page-specific bitmap (default: none).}
1579 wxWizardPageSimple pages are automatically chained together; wxWizardPage pages
1580 transitions must be handled programatically.
1583 @section overview_xrcformat_sizers Sizers
1585 Sizers are handled slightly differently in XRC resources than they are in
1586 wxWindow hierarchy. wxWindow's sizers hierarchy is parallel to the wxWindow
1587 children hieararchy: child windows are children of their parent window and
1588 the sizer (or sizers) form separate hierarchy attached to the window with
1589 wxWindow::SetSizer().
1591 In XRC, the two hierarchies are merged together: sizers are children of other
1592 sizers or windows and they can contain child window objects.
1594 If a sizer is child of a window object in the resource, it must be the only
1595 child and it will be attached to the parent with wxWindow::SetSizer().
1596 Additionally, if the window doesn't have its size explicitly set,
1597 wxSizer::Fit() is used to resize the window. If the parent window is
1598 toplevel window, wxSizer::SetSizeHints() is called to set its hints.
1600 A sizer object can have one or more child objects of one of two pseudo-classes:
1601 @c sizeritem or @c spacer (see @ref overview_xrcformat_wxstddialogbuttonsizer for
1602 an exception). The former specifies an element (another sizer or a window)
1603 to include in the sizer, the latter adds empty space to the sizer.
1605 @c sizeritem objects have exactly one child object: either another sizer
1606 object, or a window object. @c spacer objects don't have any children, but
1607 they have one property:
1610 @hdr3col{property, type, description}
1611 @row3col{size, @ref overview_xrcformat_type_size, Size of the empty space (required).}
1614 Both @c sizeritem and @c spacer objects can have any of the following
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).}
1622 @row3col{flag, @ref overview_xrcformat_type_style,
1623 wxSizerItem flags (default: 0).}
1624 @row3col{border, @ref overview_xrcformat_type_dimension,
1625 Size of the border around the item (directions are specified in flags)
1627 @row3col{minsize, @ref overview_xrcformat_type_size,
1628 Minimal size of this item (default: no min size).}
1629 @row3col{ratio, @ref overview_xrcformat_type_size,
1630 Item ratio, see wxSizer::SetRatio() (default: no ratio).}
1631 @row3col{cellpos, @ref overview_xrcformat_type_pos,
1632 (wxGridBagSizer only) Position, see wxGBSizerItem::SetPos() (required). }
1633 @row3col{cellspan, @ref overview_xrcformat_type_size,
1634 (wxGridBagSizer only) Span, see wxGBSizerItem::SetSpan() (required). }
1637 Example of sizers XRC 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">
1648 <growablecols>0</growablecols>
1649 <growablerows>0</growablerows>
1650 <object class="sizeritem">
1651 <flag>wxALIGN_CENTRE|wxALL</flag>
1653 <object class="wxButton" name="my_button">
1654 <label>My Button</label>
1657 <object class="sizeritem">
1658 <flag>wxALIGN_CENTRE|wxALL</flag>
1660 <object class="wxBoxSizer">
1661 <orient>wxHORIZONTAL</orient>
1662 <object class="sizeritem">
1663 <flag>wxALIGN_CENTRE|wxALL</flag>
1665 <object class="wxCheckBox" name="my_checkbox">
1666 <label>Enable this text control:</label>
1669 <object class="sizeritem">
1670 <flag>wxALIGN_CENTRE|wxALL</flag>
1672 <object class="wxTextCtrl" name="my_textctrl">
1684 The sizer classes that can be used are listed below, together with their
1685 class-specific properties. All classes support the following properties:
1688 @hdr3col{property, type, description}
1689 @row3col{minsize, @ref overview_xrcformat_type_size,
1690 Minimal size that this sizer will have, see wxSizer::SetMinSize()
1691 (default: no min size).}
1694 @subsection overview_xrcformat_wxboxsizer wxBoxSizer
1697 @hdr3col{property, type, description}
1698 @row3col{orient, @ref overview_xrcformat_type_style,
1699 Sizer orientation, "wxHORIZONTAL" or "wxVERTICAL" (default: wxHORIZONTAL).}
1702 @subsection overview_xrcformat_wxstaticsboxizer wxStaticBoxSizer
1705 @hdr3col{property, type, description}
1706 @row3col{orient, @ref overview_xrcformat_type_style,
1707 Sizer orientation, "wxHORIZONTAL" or "wxVERTICAL" (default: wxHORIZONTAL).}
1708 @row3col{label, @ref overview_xrcformat_type_text,
1709 Label to be used for the static box around the sizer (required).}
1712 @subsection overview_xrcformat_wxgridsizer wxGridSizer
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).}
1722 @subsection overview_xrcformat_wxflexgridsizer wxFlexGridSizer
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
1733 @row3col{growablecols, comma-separated integers list,
1734 Comma-separated list of indexes of columns that are growable
1738 @subsection overview_xrcformat_wxgridbagsizer wxGridBagSizer
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
1747 @row3col{growablecols, comma-separated integers list,
1748 Comma-separated list of indexes of columns that are growable
1752 @subsection overview_xrcformat_wxwrapsizer wxWrapSizer
1755 @hdr3col{property, type, description}
1756 @row3col{orient, @ref overview_xrcformat_type_style,
1757 Sizer orientation, "wxHORIZONTAL" or "wxVERTICAL" (required).}
1758 @row3col{flag, @ref overview_xrcformat_type_style, wxWrapSizer flags (default: 0).}
1761 @subsection overview_xrcformat_wxstddialogbuttonsizer wxStdDialogButtonSizer
1763 Unlike other sizers, wxStdDialogButtonSizer doesn't have neither @c sizeritem
1764 nor @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
1766 always have exactly one child of the @c wxButton class or a class derived from
1771 <object class="wxStdDialogButtonSizer">
1772 <object class="button">
1773 <object class="wxButton" name="wxID_OK">
1777 <object class="button">
1778 <object class="wxButton" name="wxID_CANCEL">
1779 <label>Cancel</label>
1787 @section overview_xrcformat_other_objects Other objects
1789 In addition to describing UI elements, XRC files can contain non-windows
1790 objects such as bitmaps or icons. This is a concession to Windows developers
1791 used to storing them in Win32 resources.
1793 Note that unlike Win32 resources, bitmaps included in XRC files are @em not
1794 embedded in the XRC file itself. XRC file only contains a reference to another
1795 file with bitmap data.
1797 @subsection overview_xrcformat_bitmap wxBitmap
1799 Bitmaps are stored in @c \<object\> element with class set to @c wxBitmap. Such
1800 bitmaps can then be loaded using wxXmlResource::LoadBitmap(). The content of
1801 the element is exactly same as in the case of
1802 @ref overview_xrcformat_type_bitmap "bitmap properties", except that toplevel
1803 @c \<object\> is used.
1805 For example, instead of:
1807 <bitmap>mybmp.png</bitmap>
1808 <bitmap stock_id="wxART_NEW"/>
1810 toplevel wxBitmap resources would look like:
1812 <object class="wxBitmap" name="my_bitmap">mybmp.png</object>
1813 <object class="wxBitmap" name="my_new_bitmap" stock_id="wxART_NEW"/>
1817 @subsection overview_xrcformat_icon wxIcon
1819 wxIcon resources are identical to @ref overview_xrcformat_bitmap "wxBitmap ones",
1820 except that the class is @c wxIcon.
1823 @section overview_xrcformat_platform Platform specific content
1825 It is possible to conditionally process parts of XRC files on some platforms
1826 only and ignore them on other platforms. @em Any element in XRC file, be it
1827 toplevel or arbitrarily nested one, can have the @c platform attribute. When
1828 used, @c platform contains |-separated list of platforms that this element
1829 should be processed on. It is filtered out and ignored on any other platforms.
1831 Possible elemental values are:
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 }
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>
1849 @section overview_xrcformat_extending Extending XRC format
1851 The XRC format is designed to be extensible and allows specifying and loading
1852 custom controls. The three available mechanisms are described in the rest of
1853 this section in the order of increasing complexity.
1855 @subsection overview_xrcformat_extending_subclass Subclassing
1857 The simplest way to add custom controls is to set the @c subclass attribute
1858 of @c \<object\> element:
1861 <object name="my_value" class="wxTextCtrl" subclass="MyTextCtrl">
1862 <style>wxTE_MULTILINE</style>
1863 ...etc., setup wxTextCtrl as usual...
1867 In 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)
1869 when loading the resource. However, the rest of the object's loading (calling
1870 its Create() method, setting its properties, loading any children etc.)
1871 will proceed in @em exactly the same way as it would without @c subclass
1872 attribute. In other words, this approach is only sufficient when the custom
1873 class is just a small modification (e.g. overridden methods or customized
1874 events handling) of an already supported classes.
1876 The subclass must satisfy a number of requirements:
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.
1889 @subsection overview_xrcformat_extending_unknown \<object class="unknown"\>
1891 A more flexible solution is to put a @em placeholder in the XRC file and
1892 replace it with custom control after the resource is loaded. This is done by
1893 using the @c unknown pseudo-class:
1896 <object class="unknown" name="my_placeholder"/>
1899 The placeholder is inserted as dummy wxPanel that will hold custom control in
1900 it. At runtime, after the resource is loaded and a window created from it
1901 (using e.g. wxXmlResource::LoadDialog()), use code must call
1902 wxXmlResource::AttachUnknownControl() to insert the desired control into
1903 placeholder container.
1905 This method makes it possible to insert controls that are not known to XRC at
1906 all, but it's also impossible to configure the control in XRC description in
1907 any way. The only properties that can be specified are
1908 the @ref overview_xrcformat_std_props "standard window properties".
1910 @note @c unknown class cannot be combined with @c subclass attribute,
1911 they are mutually exclusive.
1914 @subsection overview_xrcformat_extending_custom Adding custom classes
1916 Finally, XRC allows adding completely new classes in addition to the ones
1917 listed in this document. A class for which wxXmlResourceHandler is implemented
1918 can be used as first-class object in XRC simply by passing class name as the
1919 value of @c class attribute:
1922 <object name="my_ctrl" class="MyWidget">
1923 <my_prop>foo</my_prop>
1924 ...etc., whatever MyWidget handler accepts...
1928 The only requirements on the class are that
1929 -# the class must derive from wxObject
1930 -# it must support wxWidget's pseudo-RTTI mechanism
1932 Child elements of @c \<object\> are handled by the custom handler and there are
1933 no limitations on them imposed by XRC format.
1935 This is the only mechanism that works for toplevel objects -- custom controls
1936 are accessible using type-unsafe wxXmlResource::LoadObject() method.
1940 @section overview_xrcformat_packed Packed XRC files
1942 In addition to plain XRC files, wxXmlResource supports (if wxFileSystem support
1943 is compiled in) compressed XRC resources. Compressed resources have either
1944 .zip or .xrs extension and are simply ZIP files that contain arbitrary
1945 number of XRC files and their dependencies (bitmaps, icons etc.).
1949 @section overview_xrcformat_oldversions Older format versions
1951 This section describes differences in older revisions of XRC format (i.e.
1952 files with older values of @c version attribute of @c \<resource\>).
1955 @subsection overview_xrcformat_pre_v2530 Versions before 2.5.3.0
1957 Version 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
1959 in the same matter it's done in C, but "\\" was left intact instead of being
1960 replaced with single "\", as one would expect. Starting with 2.5.3.0, all of
1961 them are handled in C-like manner.
1964 @subsection overview_xrcformat_pre_v2301 Versions before 2.3.0.1
1966 Prior to version 2.3.0.1, "$" was used for accelerators instead of "_"
1967 or "&". For example,
1969 <label>$File</label>
1971 was used in place of current version's
1973 <label>_File</label>