]>
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 licence
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.
13 Also, don't use < and > symbols in section titles.
19 @page overview_xrcformat XRC File Format
22 - @ref overview_xrcformat_overview
23 - @ref overview_xrcformat_root
24 - @ref overview_xrcformat_objects
25 - @ref overview_xrcformat_object
26 - @ref overview_xrcformat_object_ref
27 - @ref overview_xrcformat_datatypes
28 - @ref overview_xrcformat_windows
29 - @ref overview_xrcformat_std_props
30 - @ref overview_xrcformat_controls
31 - @ref overview_xrcformat_sizers
32 - @ref overview_xrcformat_other_objects
33 - @ref overview_xrcformat_platform
34 - @ref overview_xrcformat_idranges
35 - @ref overview_xrcformat_extending
36 - @ref overview_xrcformat_extending_subclass
37 - @ref overview_xrcformat_extending_unknown
38 - @ref overview_xrcformat_extending_custom
39 - @ref overview_xrcformat_packed
40 - @ref overview_xrcformat_oldversions
42 This document describes the format of XRC resource files, as used by wxXmlResource.
48 @section overview_xrcformat_overview Overview
50 XRC file is a XML file with all of its elements in the
51 @c http://www.wxwidgets.org/wxxrc namespace. For backward compatibility,
52 @c http://www.wxwindows.org/wxxrc namespace is accepted as well (and treated
53 as identical to @c http://www.wxwidgets.org/wxxrc), but it shouldn't be used
56 XRC file contains definitions for one or more @em objects -- typically
57 windows. The objects may themselves contain child objects.
59 Objects defined at the top level, under the
60 @ref overview_xrcformat_root "root element", can be accessed using
61 wxXmlResource::LoadDialog() and other LoadXXX methods. They must have
62 @c name attribute that is used as LoadXXX's argument (see
63 @ref overview_xrcformat_object for details).
65 Child objects are not directly accessible via wxXmlResource, they can only
66 be accessed using XRCCTRL().
69 @section overview_xrcformat_root Resource Root Element
71 The root element is always @c \<resource\>. It has one optional attribute, @c
72 version. If set, it specifies version of the file. In absence of @c version
73 attribute, the default is @c "0.0.0.0".
75 The version consists of four integers separated by periods. The first three
76 components are major, minor and release number of the wxWidgets release when
77 the change was introduced, the last one is revision number and is 0 for the
78 first incompatible change in given wxWidgets release, 1 for the second and so
79 on. The version changes only if there was an incompatible change introduced;
80 merely adding new kind of objects does not constitute incompatible change.
82 At the time of writing, the latest version is @c "2.5.3.0".
84 Note that even though @c version attribute is optional, it should always be
85 specified to take advantage of the latest capabilities:
89 <resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
94 @c \<resource\> may have arbitrary number of
95 @ref overview_xrcformat_objects "object elements" as its children; they are referred
96 to as @em toplevel objects in the rest of this document. Unlike objects defined
97 deeper in the hierarchy, toplevel objects @em must have their @c name attribute
98 set and it must be set to a value unique among root's children.
102 @section overview_xrcformat_objects Defining Objects
104 @subsection overview_xrcformat_object Object Element
106 The @c \<object\> element represents a single object (typically a GUI element)
107 and it usually maps directly to a wxWidgets class instance. It has one
108 mandatory attribute, @c class, and optional @c name and @c subclass attributes.
110 The @c class attribute must always be present, it tells XRC what wxWidgets
111 object should be created and by which wxXmlResourceHandler.
113 @c name is the identifier used to identify the object. This name serves three
116 -# It is used by wxXmlResource's various LoadXXX() methods to find the
117 resource by name passed as argument.
118 -# wxWindow's name (see wxWindow::GetName()) is set to it.
119 -# Numeric ID of a window or menu item is derived from the name.
120 If the value represents an integer (in decimal notation), it is used for
121 the numeric ID unmodified. If it is one of the wxID_XXX literals defined
122 by wxWidgets (see @ref page_stockitems), its respective value is used.
123 Otherwise, the name is transformed into dynamically generated ID. See
124 wxXmlResource::GetXRCID() for more information.
126 Name attributes must be unique at the top level (where the name is used to
127 load resources) and should be unique among all controls within the same
128 toplevel window (wxDialog, wxFrame).
130 The @c subclass attribute optional name of class whose constructor will be
131 called instead of the constructor for "class".
132 See @ref overview_xrcformat_extending_subclass for more details.
134 @c \<object\> element may -- and almost always do -- have children elements.
135 These come in two varieties:
137 -# Object's properties. A @em property is a value describing part of object's
138 behaviour, for example the "label" property on wxButton defines its label.
139 In the most common form, property is a single element with text content
140 ("\<label\>Cancel\</label\>"), but they may use nested subelements too (e.g.
141 @ref overview_xrcformat_type_font "font property"). A property can only be
142 listed once in an object's definition.
143 -# Child objects. Window childs, sizers, sizer items or notebook pages
144 are all examples of child objects. They are represented using nested
145 @c \<object\> elements and are can be repeated more than once. The specifics
146 of which object classes are allowed as children are class-specific and
147 are documented below in @ref overview_xrcformat_controls.
151 <object class="wxDialog" name="example_dialog">
153 <title>Non-Derived Dialog Example</title>
154 <centered>1</centered>
155 <!-- child objects: -->
156 <object class="wxBoxSizer">
157 <orient>wxVERTICAL</orient>
166 @subsection overview_xrcformat_object_ref Object References
168 Anywhere an @c \<object\> element can be used, @c \<object_ref\> may be used
169 instead. @c \<object_ref\> is a @em reference to another named (i.e. with the
170 @c name attribute) @c \<object\> element. It has one mandatory attribute,
171 @c ref, with value containing the name of a named @c \<object\> element. When an
172 @c \<object_ref\> is encountered, a copy of the referenced @c \<object\> element
173 is made in place of @c \<object_ref\> occurrence and processed as usual.
175 For example, the following code:
177 <object class="wxDialog" name="my_dlg">
180 <object_ref name="my_dlg_alias" ref="my_dlg"/>
184 <object class="wxDialog" name="my_dlg">
187 <object class="wxDialog" name="my_dlg_alias">
188 ... <!-- same as in my_dlg -->
192 Additionally, it is possible to override some parts of the referenced object
193 in the @c \<object_ref\> pointing to it. This is useful for putting repetitive
194 parts of XRC definitions into a template that can be reused and customized in
195 several places. The two parts are merged as follows:
197 -# The referred object is used as the initial content.
198 -# All attributes set on @c \<object_ref\> are added to it.
199 -# All child elements of @c \<object_ref\> are scanned. If an element with
200 the same name (and, if specified, the @c name attribute too) is found
201 in the referred object, they are recursively merged.
202 -# Child elements in @c \<object_ref\> that do not have a match in the referred
203 object are appended to the list of children of the resulting element by
204 default. Optionally, they may have @c insert_at attribute with two possible
205 values, "begin" or "end". When set to "begin", the element is prepended to
206 the list of children instead of appended.
208 For example, "my_dlg" in this snippet:
210 <object class="wxDialog" name="template">
211 <title>Dummy dialog</title>
214 <object_ref ref="template" name="my_dlg">
215 <title>My dialog</title>
216 <centered>1</centered>
221 <object class="wxDialog" name="my_dlg">
222 <title>My dialog</title>
224 <centered>1</centered>
229 @section overview_xrcformat_datatypes Data Types
231 There are several property data types that are frequently reused by different
232 properties. Rather than describing their format in the documentation of
233 every property, we list commonly used types in this section and document
237 @subsection overview_xrcformat_type_bool Boolean
239 Boolean values are expressed using either "1" literal (true) or "0" (false).
242 @subsection overview_xrcformat_type_float Floating-point value
244 Floating point values use POSIX (C locale) formatting -- decimal separator
245 is "." regardless of the locale.
248 @subsection overview_xrcformat_type_colour Colour
250 Colour specification can be either any string colour representation accepted
251 by wxColour::Set() or any wxSYS_COLOUR_XXX symbolic name accepted by
252 wxSystemSettings::GetColour(). In particular, the following forms are supported:
254 @li named colours from wxColourDatabase
255 @li HTML-like "#rrggbb" syntax (but not "#rgb")
256 @li CSS-style "rgb(r,g,b)" and "rgba(r,g,b,a)"
257 @li wxSYS_COLOUR_XXX symbolic names
263 <fg>rgb(255,0,0)</fg>
264 <fg>wxSYS_COLOUR_HIGHLIGHT</fg>
268 @subsection overview_xrcformat_type_size Size
270 Sizes and positions have the form of string with two comma-separated integer
271 components, with optional "d" suffix. Semi-formally:
273 size := x "," y ["d"]
275 where x and y are integers. Either of the components (or both) may be "-1" to
276 signify default value. As a shortcut, empty string is equivalent to "-1,-1"
277 (= wxDefaultSize or wxDefaultPosition).
279 When the "d" suffix is used, integer values are interpreted as
280 @ref wxWindow::ConvertDialogToPixels() "dialog units" in the parent window.
289 @subsection overview_xrcformat_type_pos Position
291 Same as @ref overview_xrcformat_type_size.
294 @subsection overview_xrcformat_type_dimension Dimension
296 Similarly to @ref overview_xrcformat_type_size "sizes", dimensions are expressed
297 as integers with optional "d" suffix. When "d" suffix is used, the integer
298 preceding it is interpreted as dialog units in the parent window.
301 @subsection overview_xrcformat_type_text Text
303 String properties use several escape sequences that are translated according to
306 @itemdef{ "_", "&" (used for accelerators in wxWidgets) }
307 @itemdef{ "__", "_" }
308 @itemdef{ "\n", line break }
309 @itemdef{ "\r", carriage return }
310 @itemdef{ "\t", tab }
311 @itemdef{ "\\", "\" }
314 By default, the text is translated using wxLocale::GetTranslation() before
315 it is used. This can be disabled either globally by not passing
316 wxXRC_USE_LOCALE to wxXmlResource constructor, or by setting the @c translate
317 attribute on the property node to "0":
319 <!-- this is not translated: -->
320 <label translate="0">_Unix</label>
321 <!-- but this is: -->
322 <help>Use Unix-style newlines</help>
325 @note Even though the "_" character is used instead of "&" for accelerators,
326 it is still possible to use "&". The latter has to be encoded as "&",
327 though, so using "_" is more convenient.
329 @see @ref overview_xrcformat_pre_v2530, @ref overview_xrcformat_pre_v2301
332 @subsection overview_xrcformat_type_text_notrans Non-Translatable Text
334 Like @ref overview_xrcformat_type_text, but the text is never translated and
335 @c translate attribute cannot be used.
338 @subsection overview_xrcformat_type_string String
340 An unformatted string. Unlike with @ref overview_xrcformat_type_text, no escaping
341 or translations are done.
344 @subsection overview_xrcformat_type_url URL
346 Any URL accepted by wxFileSystem (typically relative to XRC file's location,
347 but can be absolute too). Unlike with @ref overview_xrcformat_type_text, no escaping
348 or translations are done.
351 @subsection overview_xrcformat_type_bitmap Bitmap
353 Bitmap properties contain specification of a single bitmap or icon. In the most
354 basic form, their text value is simply a relative filename (or another
355 wxFileSystem URL) of the bitmap to use. For example:
357 <object class="tool" name="wxID_NEW">
358 <tooltip>New</tooltip>
359 <bitmap>new.png</bitmap>
362 The value is interpreted as path relative to the location of XRC file where the
365 Alternatively, it is possible to specify the bitmap using wxArtProvider IDs.
366 In this case, the property element has no textual value (filename) and instead
367 has the @c stock_id XML attribute that contains stock art ID as accepted by
368 wxArtProvider::GetBitmap(). This can be either custom value (if the app uses
369 app-specific art provider) or one of the predefined wxART_XXX constants.
371 Optionally, @c stock_client attribute may be specified too and contain one of
372 the predefined wxArtClient values. If it is not specified, the default client
373 ID most appropriate in the context where the bitmap is referenced will be used.
374 In most cases, specifying @c stock_client is not needed.
376 Examples of stock bitmaps usage:
378 <bitmap stock_id="fixed-width"/> <!-- custom app-specific art -->
379 <bitmap stock_id="wxART_FILE_OPEN"/> <!-- standard art -->
382 Specifying the bitmap directly and using @c stock_id are mutually exclusive.
385 @subsection overview_xrcformat_type_style Style
387 Style properties (such as window's style or sizer flags) use syntax similar to
388 C++: the style value is OR-combination of individual flags. Symbolic names
389 identical to those used in C++ code are used for the flags. Flags are separated
390 with "|" (whitespace is allowed but not required around it).
392 The flags that are allowed for a given property are context-dependent.
396 <style>wxCAPTION|wxSYSTEM_MENU | wxRESIZE_BORDER</style>
397 <exstyle>wxDIALOG_EX_CONTEXTHELP</exstyle>
401 @subsection overview_xrcformat_type_font Font
403 XRC uses similar, but more flexible, abstract description of fonts to that
404 used by wxFont class. A font can be described either in terms of its elementary
405 properties, or it can be derived from one of system fonts.
407 The font property element is "composite" element: unlike majority of
408 properties, it doesn't have text value but contains several child elements
409 instead. These children are handled in the same way as object properties
410 and can be one of the following "sub-properties":
413 @hdr3col{property, type, description}
414 @row3col{size, unsigned integer,
415 Pixel size of the font (default: wxNORMAL_FONT's size or @c sysfont's
416 size if the @c sysfont property is used.}
417 @row3col{style, enum,
418 One of "normal", "italic" or "slant" (default: normal).}
419 @row3col{weight, enum,
420 One of "normal", "bold" or "light" (default: normal).}
421 @row3col{family, enum,
422 One of "roman", "script", "decorative", "swiss", "modern" or "teletype"
424 @row3col{underlined, @ref overview_xrcformat_type_bool,
425 Whether the font should be underlined (default: 0).}
427 Comma-separated list of face names; the first one available is used
428 (default: unspecified).}
430 Charset of the font, unused in Unicode build), as string
431 (default: unspecified).}
433 Symbolic name of system standard font(one of wxSYS_*_FONT constants).}
434 @row3col{relativesize, float,
435 Float, font size relative to chosen system font's size; can only be
436 used when 'sysfont' is used and when 'size' is not used.}
439 All of them are optional, if they are missing, appropriate wxFont default is
440 used. If the @c sysfont property is used, then the defaults are taken from it
446 <!-- fixed font: Arial if available, fall back to Helvetica -->
447 <face>arial,helvetica</face>
452 <!-- enlarged, enboldened standard font: -->
453 <sysfont>wxSYS_DEFAULT_GUI_FONT</sysfont>
454 <weight>bold</weight>
455 <relativesize>1.5</relativesize>
460 @section overview_xrcformat_windows Controls and Windows
462 This section describes support wxWindow-derived classes in XRC format.
464 @subsection overview_xrcformat_std_props Standard Properties
466 The following properties are always (unless stated otherwise in
467 control-specific docs) available for @em windows objects. They are omitted
468 from properties lists below.
471 @hdr3col{property, type, description}
472 @row3col{pos, @ref overview_xrcformat_type_pos,
473 Initial position of the window (default: wxDefaultPosition).}
474 @row3col{size, @ref overview_xrcformat_type_size,
475 Initial size of the window (default: wxDefaultSize).}
476 @row3col{style, @ref overview_xrcformat_type_style,
477 Window style for this control. The allowed values depend on what
478 window is being created, consult respective class' constructor
479 documentation for details (default: window-dependent default, usually
480 wxFOO_DEFAULT_STYLE if defined for class wxFoo, 0 if not).}
481 @row3col{exstyle, @ref overview_xrcformat_type_style,
482 Extra style for the window, if any. See wxWindow::SetExtraStyle()
484 @row3col{fg, @ref overview_xrcformat_type_colour,
485 Foreground colour of the window (default: window's default).}
486 @row3col{ownfg, @ref overview_xrcformat_type_colour,
487 Non-inheritable foreground colour of the window, see
488 wxWindow::SetOwnForegroundColour() (default: none).}
489 @row3col{bg, @ref overview_xrcformat_type_colour,
490 Background colour of the window (default: window's default).}
491 @row3col{ownbg, @ref overview_xrcformat_type_colour,
492 Non-inheritable background colour of the window, see
493 wxWindow::SetOwnBackgroundColour() (default: none).}
494 @row3col{enabled, @ref overview_xrcformat_type_bool,
495 If set to 0, the control is disabled (default: 1).}
496 @row3col{hidden, @ref overview_xrcformat_type_bool,
497 If set to 1, the control is created hidden (default: 0).}
498 @row3col{tooltip, @ref overview_xrcformat_type_text,
499 Tooltip to use for the control (default: not set).}
500 @row3col{font, @ref overview_xrcformat_type_font,
501 Font to use for the control (default: window's default).}
502 @row3col{ownfont, @ref overview_xrcformat_type_font,
503 Non-inheritable font to use for the control, see
504 wxWindow::SetOwnFont() (default: none).}
505 @row3col{help, @ref overview_xrcformat_type_text,
506 Context-sensitive help for the control, used by wxHelpProvider
510 All of these properties are optional.
513 @subsection overview_xrcformat_controls Supported Controls
515 This section lists all controls supported by default. For each control, its
516 control-specific properties are listed. If the control can have child objects,
517 it is documented there too; unless said otherwise, XRC elements for these
518 controls cannot have children.
520 @subsubsection xrc_wxanimationctrl wxAnimationCtrl
523 @hdr3col{property, type, description}
524 @row3col{animation, @ref overview_xrcformat_type_url,
525 Animation file to load into the control (required).}
529 @subsubsection xrc_wxbannerwindow wxBannerWindow
532 @hdr3col{property, type, description}
533 @row3col{direction, @c wxLEFT|wxRIGHT|wxTOP|wxBOTTOM,
534 The side along which the banner will be positioned.}
535 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
536 Bitmap to use as the banner background.}
537 @row3col{title, @ref overview_xrcformat_type_text,
538 Banner title, should be single line.}
539 @row3col{message, @ref overview_xrcformat_type_text,
540 Possibly multi-line banner message.}
541 @row3col{gradient-start, @ref overview_xrcformat_type_colour,
542 Starting colour of the gradient used as banner background. Can't be used if
543 a valid bitmap is specified.}
544 @row3col{gradient-end, @ref overview_xrcformat_type_colour,
545 End colour of the gradient used as banner background. Can't be used if
546 a valid bitmap is specified.}
550 @subsubsection xrc_wxbitmapbutton wxBitmapButton
553 @hdr3col{property, type, description}
554 @row3col{default, @ref overview_xrcformat_type_bool,
555 Should this button be the default button in dialog (default: 0)?}
556 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
557 Bitmap to show on the button (required).}
558 @row3col{selected, @ref overview_xrcformat_type_bitmap,
559 Bitmap to show when the button is selected (default: none, same as @c bitmap).}
560 @row3col{focus, @ref overview_xrcformat_type_bitmap,
561 Bitmap to show when the button has focus (default: none, same as @c bitmap).}
562 @row3col{disabled, @ref overview_xrcformat_type_bitmap,
563 Bitmap to show when the button is disabled (default: none, same as @c bitmap).}
564 @row3col{hover, @ref overview_xrcformat_type_bitmap,
565 Bitmap to show when mouse cursor hovers above the bitmap (default: none, same as @c bitmap).}
569 @subsubsection xrc_wxbitmapcombobox wxBitmapComboBox
572 @hdr3col{property, type, description}
573 @row3col{selection, integer,
574 Index of the initially selected item or -1 for no selection (default: -1).}
575 @row3col{value, @ref overview_xrcformat_type_string,
576 Initial value in the control (doesn't have to be one of @ content values;
580 If both @c value and @c selection are specified and @c selection is not -1,
581 then @c selection takes precedence.
583 A wxBitmapComboBox can have one or more child objects of the @c ownerdrawnitem
584 pseudo-class. @c ownerdrawnitem objects have the following properties:
587 @hdr3col{property, type, description}
588 @row3col{text, @ref overview_xrcformat_type_text,
589 Item's label (required).}
590 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
591 Item's bitmap (default: no bitmap).}
596 <object class="wxBitmapComboBox">
597 <selection>1</selection>
598 <object class="ownerdrawnitem">
600 <bitmap>foo.png</bitmap>
602 <object class="ownerdrawnitem">
604 <bitmap>bar.png</bitmap>
610 @subsubsection xrc_wxbitmaptogglebutton wxBitmapToggleButton
613 @hdr3col{property, type, description}
614 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
615 Label to display on the button (required).}
616 @row3col{checked, @ref overview_xrcformat_type_bool,
617 Should the button be checked/pressed initially (default: 0)?}
621 @subsubsection xrc_wxbutton wxButton
624 @hdr3col{property, type, description}
625 @row3col{label, @ref overview_xrcformat_type_text,
626 Label to display on the button (may be empty if only bitmap is used).}
627 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
628 Bitmap to display in the button (optional).}
629 @row3col{bitmapposition, @c wxLEFT|wxRIGHT|wxTOP|wxBOTTOM,
630 Position of the bitmap in the button, see wxButton::SetBitmapPosition().}
631 @row3col{default, @ref overview_xrcformat_type_bool,
632 Should this button be the default button in dialog (default: 0)?}
636 @subsubsection xrc_wxcalendarctrl wxCalendarCtrl
638 No additional properties.
641 @subsubsection xrc_wxcheckbox wxCheckBox
644 @hdr3col{property, type, description}
645 @row3col{label, @ref overview_xrcformat_type_text,
646 Label to use for the checkbox (required).}
647 @row3col{checked, @ref overview_xrcformat_type_bool,
648 Should the checkbox be checked initially (default: 0)?}
652 @subsubsection xrc_wxchecklistbox wxCheckListBox
655 @hdr3col{property, type, description}
656 @row3col{content, items,
657 Content of the control; this property has any number of @c \<item\> XML
658 elements as its children, with the items text as their text values
662 The @c \<item\> elements have listbox items' labels as their text values. They
663 can also have optional @c checked XML attribute -- if set to "1", the value is
668 <object class="wxCheckListBox">
670 <item checked="1">Download library</item>
671 <item checked="1">Compile samples</item>
672 <item checked="1">Skim docs</item>
673 <item checked="1">Finish project</item>
674 <item>Wash car</item>
680 @subsubsection xrc_wxchoice wxChoice
683 @hdr3col{property, type, description}
684 @row3col{selection, integer,
685 Index of the initially selected item or -1 for no selection (default: -1).}
686 @row3col{content, items,
687 Content of the control; this property has any number of @c \<item\> XML
688 elements as its children, with the items text as their text values
694 <object class="wxChoice" name="controls_choice">
701 <item>The Sixth Sense!</item>
707 @subsubsection xrc_wxchoicebook wxChoicebook
709 A choicebook can have one or more child objects of the @c choicebookpage
710 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
711 @c notebookpage) and one child object of the @ref xrc_wximagelist class.
712 @c choicebookpage objects have the following properties:
715 @hdr3col{property, type, description}
716 @row3col{label, @ref overview_xrcformat_type_text,
717 Sheet page's title (required).}
718 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
719 Bitmap shown alongside the label (default: none).}
720 @row3col{image, integer,
721 The zero-based index of the image associated with the item
722 into the image list.}
723 @row3col{selected, @ref overview_xrcformat_type_bool,
724 Is the page selected initially (only one page can be selected; default: 0)?}
727 Each @c choicebookpage has exactly one non-toplevel window as its child.
730 @subsubsection xrc_wxcommandlinkbutton wxCommandLinkButton
732 The wxCommandLinkButton contains a main title-like @c label and an optional
733 @c note for longer description. The main @c label and the @c note can be
734 concatenated into a single string using a new line character between them
735 (notice that the @c note part can have more new lines in it).
738 @hdr3col{property, type, description}
739 @row3col{label, @ref overview_xrcformat_type_text,
740 First line of text on the button, typically the label of an action that
741 will be made when the button is pressed. }
742 @row3col{note, @ref overview_xrcformat_type_text,
743 Second line of text describing the action performed when the button is pressed. }
747 @subsubsection xrc_wxcollapsiblepane wxCollapsiblePane
750 @hdr3col{property, type, description}
751 @row3col{label, @ref overview_xrcformat_type_text,
752 Label to use for the collapsible section (required).}
753 @row3col{collapsed, @ref overview_xrcformat_type_bool,
754 Should the pane be collapsed initially (default: 0)?}
757 wxCollapsiblePane may contain single optional child object of the @c panewindow
758 pseudo-class type. @c panewindow itself must contain exactly one child that
759 is a @ref overview_xrcformat_sizers "sizer" or a non-toplevel window
763 @subsubsection xrc_wxcolourpickerctrl wxColourPickerCtrl
766 @hdr3col{property, type, description}
767 @row3col{value, @ref overview_xrcformat_type_colour,
768 Initial value of the control (default: wxBLACK).}
772 @subsubsection xrc_wxcombobox wxComboBox
775 @hdr3col{property, type, description}
776 @row3col{selection, integer,
777 Index of the initially selected item or -1 for no selection (default: not used).}
778 @row3col{content, items,
779 Content of the control; this property has any number of @c \<item\> XML
780 elements as its children, with the items text as their text values
782 @row3col{value, @ref overview_xrcformat_type_string,
783 Initial value in the control (doesn't have to be one of @ content values;
787 If both @c value and @c selection are specified and @c selection is not -1,
788 then @c selection takes precedence.
792 <object class="wxComboBox" name="controls_combobox">
793 <style>wxCB_DROPDOWN</style>
798 <item>notepad.exe</item>
804 @subsubsection xrc_wxdatepickerctrl wxDatePickerCtrl
806 No additional properties.
809 @subsubsection xrc_wxdialog wxDialog
812 @hdr3col{property, type, description}
813 @row3col{title, @ref overview_xrcformat_type_text,
814 Dialog's title (default: empty).}
815 @row3col{icon, @ref overview_xrcformat_type_bitmap,
816 Dialog's icon (default: not used).}
817 @row3col{centered, @ref overview_xrcformat_type_bool,
818 Whether the dialog should be centered on the screen (default: 0).}
821 wxDialog may have optional children: either exactly one
822 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
823 objects. If sizer child is used, it sets
824 @ref wxSizer::SetSizeHints() "size hints" too.
826 @subsubsection xrc_wxdirpickerctrl wxDirPickerCtrl
829 @hdr3col{property, type, description}
830 @row3col{value, @ref overview_xrcformat_type_string,
831 Initial value of the control (default: empty).}
832 @row3col{message, @ref overview_xrcformat_type_text,
833 Message shown to the user in wxDirDialog shown by the control (required).}
837 @subsubsection xrc_wxfilectrl wxFileCtrl
840 @hdr3col{property, type, description}
841 @row3col{defaultdirectory, @ref overview_xrcformat_type_string,
842 Sets the current directory displayed in the control. }
843 @row3col{defaultfilename, @ref overview_xrcformat_type_string,
844 Selects a certain file.}
845 @row3col{wildcard, @ref overview_xrcformat_type_string,
846 Sets the wildcard, which can contain multiple file types, for example:
847 "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".}
851 @subsubsection xrc_wxfilepickerctrl wxFilePickerCtrl
854 @hdr3col{property, type, description}
855 @row3col{value, @ref overview_xrcformat_type_string,
856 Initial value of the control (default: empty).}
857 @row3col{message, @ref overview_xrcformat_type_text,
858 Message shown to the user in wxDirDialog shown by the control (required).}
859 @row3col{wildcard, @ref overview_xrcformat_type_string,
860 Sets the wildcard, which can contain multiple file types, for example:
861 "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".}
865 @subsubsection xrc_wxfontpickerctrl wxFontPickerCtrl
868 @hdr3col{property, type, description}
869 @row3col{value, @ref overview_xrcformat_type_font,
870 Initial value of the control (default: wxNORMAL_FONT).}
873 @subsubsection xrc_wxfrane wxFrame
876 @hdr3col{property, type, description}
877 @row3col{title, @ref overview_xrcformat_type_text,
878 Frame's title (default: empty).}
879 @row3col{icon, @ref overview_xrcformat_type_bitmap,
880 Frame's icon (default: not used).}
881 @row3col{centered, @ref overview_xrcformat_type_bool,
882 Whether the frame should be centered on the screen (default: 0).}
885 wxFrame may have optional children: either exactly one
886 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
887 objects. If sizer child is used, it sets
888 @ref wxSizer::SetSizeHints() "size hints" too.
891 @subsubsection xrc_wxgauge wxGauge
894 @hdr3col{property, type, description}
895 @row3col{range, integer,
896 Maximum value of the gauge (default: 100).}
897 @row3col{value, integer,
898 Initial value of the control (default: 0).}
899 @row3col{shadow, @ref overview_xrcformat_type_dimension,
900 Rendered shadow size (default: none; ignored by most platforms).}
901 @row3col{bezel, @ref overview_xrcformat_type_dimension,
902 Rendered bezel size (default: none; ignored by most platforms).}
905 @subsubsection xrc_wxgenericdirctrl wxGenericDirCtrl
908 @hdr3col{property, type, description}
909 @row3col{defaultfolder, @ref overview_xrcformat_type_text,
910 Initial folder (default: empty).}
911 @row3col{filter, @ref overview_xrcformat_type_text,
912 Filter string, using the same syntax as used by wxFileDialog, e.g.
913 "All files (*.*)|*.*|JPEG files (*.jpg)|*.jpg" (default: empty).}
914 @row3col{defaultfilter, integer,
915 Zero-based index of default filter (default: 0).}
918 @subsubsection xrc_wxgrid wxGrid
920 No additional properties.
923 @subsubsection xrc_wxhtmlwindow wxHtmlWindow
926 @hdr3col{property, type, description}
927 @row3col{url, @ref overview_xrcformat_type_url,
928 Page to display in the window.}
929 @row3col{htmlcode, @ref overview_xrcformat_type_text,
930 HTML markup to display in the window.}
931 @row3col{borders, @ref overview_xrcformat_type_dimension,
932 Border around HTML content (default: 0).}
935 At most one of @c url and @c htmlcode properties may be specified, they are
936 mutually exclusive. If neither is set, the window is initialized to show empty
940 @subsubsection xrc_wxhyperlinkctrl wxHyperlinkCtrl
943 @hdr3col{property, type, description}
944 @row3col{label, @ref overview_xrcformat_type_text,
945 Label to display on the control (required).}
946 @row3col{url, @ref overview_xrcformat_type_url,
947 URL to open when the link is clicked (required).}
951 @subsubsection xrc_wximagelist wxImageList
953 The imagelist can be used as a child object for the following classes:
954 - @ref xrc_wxchoicebook
955 - @ref xrc_wxlistbook
956 - @ref xrc_wxlistctrl
957 - @ref xrc_wxnotebook
958 - @ref xrc_wxtreebook
959 - @ref xrc_wxtreectrl
961 The available properties are:
964 @hdr3col{property, type, description}
965 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
966 Adds a new image by keeping its optional mask bitmap (see below).}
967 @row3col{mask, @ref overview_xrcformat_type_bool,
968 If masks should be created for all images (default: true).}
969 @row3col{size, @ref overview_xrcformat_type_size,
970 The size of the images in the list (default: the size of the first bitmap).}
977 <bitmap stock_id="wxART_QUESTION"/>
978 <bitmap stock_id="wxART_INFORMATION"/>
982 In the specific case of the @ref xrc_wxlistctrl, the tag can take the name
983 @c \<imagelist-small\> to define the 'small' image list, related to the flag
984 @c wxIMAGE_LIST_SMALL (see wxListCtrl documentation).
987 @subsubsection xrc_wxlistbox wxListBox
990 @hdr3col{property, type, description}
991 @row3col{selection, integer,
992 Index of the initially selected item or -1 for no selection (default: -1).}
993 @row3col{content, items,
994 Content of the control; this property has any number of @c \<item\> XML
995 elements as its children, with the items text as their text values
1001 <object class="wxListBox" name="controls_listbox">
1002 <size>250,160</size>
1003 <style>wxLB_SINGLE</style>
1008 <item>Orange juice</item>
1009 <item>Paper towels</item>
1015 @subsubsection xrc_wxlistbook wxListbook
1017 A listbook can have one or more child objects of the @c listbookpage
1018 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
1019 @c notebookpage) and one child object of the @ref xrc_wximagelist class.
1020 @c listbookpage objects have the following properties:
1023 @hdr3col{property, type, description}
1024 @row3col{label, @ref overview_xrcformat_type_text,
1025 Sheet page's title (required).}
1026 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1027 Bitmap shown alongside the label (default: none).}
1028 @row3col{image, integer,
1029 The zero-based index of the image associated with the item
1030 into the image list.}
1031 @row3col{selected, @ref overview_xrcformat_type_bool,
1032 Is the page selected initially (only one page can be selected; default: 0)?}
1035 Each @c listbookpage has exactly one non-toplevel window as its child.
1038 @subsubsection xrc_wxlistctrl wxListCtrl
1040 A list control can have one or more child objects of the class @ref xrc_wxlistitem
1041 and one or more objects of the @ref xrc_wximagelist class. The latter is
1042 defined either using @c \<imagelist\> tag for the control with @c wxLC_ICON
1043 style or using @c \<imagelist-small\> tag for the control with @c
1044 wxLC_SMALL_ICON style.
1046 Report mode list controls (i.e. created with @c wxLC_REPORT style) can in
1047 addition have one or more @ref xrc_wxlistcol child elements.
1049 @paragraph xrc_wxlistcol listcol
1051 The @c listcol class can only be used for wxListCtrl children. It can have the
1052 following properties:
1054 @hdr3col{property, type, description}
1055 @row3col{align, wxListColumnFormat,
1056 The alignment for the item.
1057 Can be one of @c wxLIST_FORMAT_LEFT, @c wxLIST_FORMAT_RIGHT or
1058 @c wxLIST_FORMAT_CENTRE.}
1059 @row3col{text, @ref overview_xrcformat_type_string,
1060 The title of the column. }
1061 @row3col{width, integer,
1063 @row3col{image, integer,
1064 The zero-based index of the image associated with the item in the 'small' image list. }
1067 The columns are appended to the control in order of their appearance and may be
1068 referenced by 0-based index in the @c col attributes of subsequent @c listitem
1071 @paragraph xrc_wxlistitem listitem
1073 The @c listitem is a child object for the class @ref xrc_wxlistctrl.
1074 It can have the following properties:
1077 @hdr3col{property, type, description}
1078 @row3col{align, wxListColumnFormat,
1079 The alignment for the item.
1080 Can be one of @c wxLIST_FORMAT_LEFT, @c wxLIST_FORMAT_RIGHT or
1081 @c wxLIST_FORMAT_CENTRE.}
1082 @row3col{bg, @ref overview_xrcformat_type_colour,
1083 The background color for the item.}
1084 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1085 Add a bitmap to the (normal) @ref xrc_wximagelist associated with the
1086 @ref xrc_wxlistctrl parent and associate it with this item.
1087 If the imagelist is not defined it will be created implicitly.}
1088 @row3col{bitmap-small, @ref overview_xrcformat_type_bitmap,
1089 Add a bitmap in the 'small' @ref xrc_wximagelist associated with the
1090 @ref xrc_wxlistctrl parent and associate it with this item.
1091 If the 'small' imagelist is not defined it will be created implicitly.}
1092 @row3col{col, integer,
1093 The zero-based column index.}
1094 @row3col{image, integer,
1095 The zero-based index of the image associated with the item
1096 in the (normal) image list.}
1097 @row3col{image-small, integer,
1098 The zero-based index of the image associated with the item
1099 in the 'small' image list.}
1100 @row3col{data, integer,
1101 The client data for the item.}
1102 @row3col{font, @ref overview_xrcformat_type_font,
1103 The font for the item.}
1104 @row3col{image, integer,
1105 The zero-based index of the image associated with the item
1106 into the image list.}
1107 @row3col{state, @ref overview_xrcformat_type_style,
1108 The item state. Can be any combination of the following values:
1109 - @c wxLIST_STATE_FOCUSED: The item has the focus.
1110 - @c wxLIST_STATE_SELECTED: The item is selected.}
1111 @row3col{text, @ref overview_xrcformat_type_string,
1112 The text label for the item. }
1113 @row3col{textcolour, @ref overview_xrcformat_type_colour,
1114 The text colour for the item. }
1117 Notice that the item position can't be specified here, the items are appended
1118 to the list control in order of their appearance.
1121 @subsubsection xrc_wxmdiparentframe wxMDIParentFrame
1123 wxMDIParentFrame supports the same properties that @ref xrc_wxfrane does.
1125 wxMDIParentFrame may have optional children. When used, the child objects
1126 must be of wxMDIChildFrame type.
1129 @subsubsection xrc_wxmdichildframe wxMDIChildFrame
1131 wxMDIChildFrame supports the same properties that @ref xrc_wxfrane and
1132 @ref xrc_wxmdiparentframe do.
1134 wxMDIChildFrame can only be used as as immediate child of @ref
1135 xrc_wxmdiparentframe.
1137 wxMDIChildFrame may have optional children: either exactly one
1138 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
1139 objects. If sizer child is used, it sets
1140 @ref wxSizer::SetSizeHints() "size hints" too.
1143 @subsubsection xrc_wxmenu wxMenu
1146 @hdr3col{property, type, description}
1147 @row3col{label, @ref overview_xrcformat_type_text,
1148 Menu's label (default: empty, but required for menus other
1150 @row3col{help, @ref overview_xrcformat_type_text,
1151 Help shown in statusbar when the menu is selected (only for submenus
1152 of another wxMenu, default: none).}
1153 @row3col{enabled, @ref overview_xrcformat_type_bool,
1154 Is the submenu item enabled (only for submenus of another wxMenu,
1158 Note that unlike most controls, wxMenu does @em not have
1159 @ref overview_xrcformat_std_props.
1161 A menu object can have one or more child objects of the wxMenuItem or wxMenu
1162 classes or @c break or @c separator pseudo-classes.
1164 The @c separator pseudo-class is used to insert separators into the menu and
1165 has neither properties nor children. Likewise, @c break inserts a break (see
1168 wxMenuItem objects support the following properties:
1171 @hdr3col{property, type, description}
1172 @row3col{label, @ref overview_xrcformat_type_text,
1173 Item's label (required).}
1174 @row3col{accel, @ref overview_xrcformat_type_text_notrans,
1175 Item's accelerator (default: none).}
1176 @row3col{radio, @ref overview_xrcformat_type_bool,
1177 Item's kind is wxITEM_RADIO (default: 0)?}
1178 @row3col{checkable, @ref overview_xrcformat_type_bool,
1179 Item's kind is wxITEM_CHECK (default: 0)?}
1180 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1181 Bitmap to show with the item (default: none).}
1182 @row3col{bitmap2, @ref overview_xrcformat_type_bitmap,
1183 Bitmap for the checked state (wxMSW, if checkable; default: none).}
1184 @row3col{help, @ref overview_xrcformat_type_text,
1185 Help shown in statusbar when the item is selected (default: none).}
1186 @row3col{enabled, @ref overview_xrcformat_type_bool,
1187 Is the item enabled (default: 1)?}
1188 @row3col{checked, @ref overview_xrcformat_type_bool,
1189 Is the item checked initially (default: 0)?}
1194 <object class="wxMenu" name="menu_edit">
1195 <style>wxMENU_TEAROFF</style>
1196 <label>_Edit</label>
1197 <object class="wxMenuItem" name="wxID_FIND">
1198 <label>_Find...</label>
1199 <accel>Ctrl-F</accel>
1201 <object class="separator"/>
1202 <object class="wxMenuItem" name="menu_fuzzy">
1203 <label>Translation is _fuzzy</label>
1204 <checkable>1</checkable>
1206 <object class="wxMenu" name="submenu">
1207 <label>A submenu</label>
1208 <object class="wxMenuItem" name="foo">...</object>
1211 <object class="separator" platform="unix"/>
1212 <object class="wxMenuItem" name="wxID_PREFERENCES" platform="unix">
1213 <label>_Preferences</label>
1218 @subsubsection xrc_wxmenubar wxMenuBar
1220 No properties. Note that unlike most controls, wxMenuBar does @em not have
1221 @ref overview_xrcformat_std_props.
1223 A menubar can have one or more child objects of the @ref xrc_wxmenu "wxMenu"
1227 @subsubsection xrc_wxnotebook wxNotebook
1229 A notebook can have one or more child objects of the @c notebookpage
1230 pseudo-class and one child object of the @ref xrc_wximagelist class.
1231 @c notebookpage objects have the following properties:
1234 @hdr3col{property, type, description}
1235 @row3col{label, @ref overview_xrcformat_type_text,
1236 Page's title (required).}
1237 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1238 Bitmap shown alongside the label (default: none).}
1239 @row3col{image, integer,
1240 The zero-based index of the image associated with the item
1241 into the image list.}
1242 @row3col{selected, @ref overview_xrcformat_type_bool,
1243 Is the page selected initially (only one page can be selected; default: 0)?}
1246 Each @c notebookpage has exactly one non-toplevel window as its child.
1250 <object class="wxNotebook">
1251 <style>wxBK_BOTTOM</style>
1252 <object class="notebookpage">
1253 <label>Page 1</label>
1254 <object class="wxPanel" name="page_1">
1258 <object class="notebookpage">
1259 <label>Page 2</label>
1260 <object class="wxPanel" name="page_2">
1268 @subsubsection xrc_wxownerdrawncombobox wxOwnerDrawnComboBox
1270 wxOwnerDrawnComboBox has the same properties as
1271 @ref xrc_wxcombobox "wxComboBox", plus the following additional properties:
1274 @hdr3col{property, type, description}
1275 @row3col{buttonsize, @ref overview_xrcformat_type_size,
1276 Size of the dropdown button (default: default).}
1280 @subsubsection xrc_wxpanel wxPanel
1282 No additional properties.
1284 wxPanel may have optional children: either exactly one
1285 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
1289 @subsubsection xrc_wxpropertysheetdialog wxPropertySheetDialog
1292 @hdr3col{property, type, description}
1293 @row3col{title, @ref overview_xrcformat_type_text,
1294 Dialog's title (default: empty).}
1295 @row3col{icon, @ref overview_xrcformat_type_bitmap,
1296 Dialog's icon (default: not used).}
1297 @row3col{centered, @ref overview_xrcformat_type_bool,
1298 Whether the dialog should be centered on the screen (default: 0).}
1299 @row3col{buttons, @ref overview_xrcformat_type_style,
1300 Buttons to show, combination of flags accepted by
1301 wxPropertySheetDialog::CreateButtons() (default: 0).}
1304 A sheet dialog can have one or more child objects of the @c propertysheetpage
1305 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
1306 @c notebookpage). @c propertysheetpage objects have the following properties:
1309 @hdr3col{property, type, description}
1310 @row3col{label, @ref overview_xrcformat_type_text,
1311 Sheet page's title (required).}
1312 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1313 Bitmap shown alongside the label (default: none).}
1314 @row3col{selected, @ref overview_xrcformat_type_bool,
1315 Is the page selected initially (only one page can be selected; default: 0)?}
1318 Each @c propertysheetpage has exactly one non-toplevel window as its child.
1321 @subsubsection xrc_wxradiobutton wxRadioButton
1324 @hdr3col{property, type, description}
1325 @row3col{label, @ref overview_xrcformat_type_text,
1326 Label shown on the radio button (required).}
1327 @row3col{value, @ref overview_xrcformat_type_bool,
1328 Initial value of the control (default: 0).}
1332 @subsubsection xrc_wxradiobox wxRadioBox
1335 @hdr3col{property, type, description}
1336 @row3col{label, @ref overview_xrcformat_type_text,
1337 Label for the whole box (required).}
1338 @row3col{dimension, integer,
1339 Specifies the maximum number of rows (if style contains
1340 @c wxRA_SPECIFY_ROWS) or columns (if style contains @c wxRA_SPECIFY_COLS)
1341 for a two-dimensional radiobox (default: 1).}
1342 @row3col{selection, integer,
1343 Index of the initially selected item or -1 for no selection (default: -1).}
1344 @row3col{content, items,
1345 Content of the control; this property has any number of @c \<item\> XML
1346 elements as its children, with the items text as their text values
1347 (see below; default: empty).}
1350 The @c \<item\> elements have radio buttons' labels as their text values. They
1351 can also have some optional XML @em attributes (not properties!):
1354 @hdr3col{attribute, type, description}
1355 @row3col{tooltip, @ref overview_xrcformat_type_string,
1356 Tooltip to show over this ratio button (default: none).}
1357 @row3col{helptext, @ref overview_xrcformat_type_string,
1358 Contextual help for this radio button (default: none).}
1359 @row3col{enabled, @ref overview_xrcformat_type_bool,
1360 Is the button enabled (default: 1)?}
1361 @row3col{hidden, @ref overview_xrcformat_type_bool,
1362 Is the button hidden initially (default: 0)?}
1367 <object class="wxRadioBox" name="controls_radiobox">
1368 <style>wxRA_SPECIFY_COLS</style>
1369 <label>Radio stations</label>
1370 <dimension>1</dimension>
1371 <selection>0</selection>
1373 <item tooltip="Powerful radio station" helptext="This station is for amateurs of hard rock and heavy metal">Power 108</item>
1374 <item tooltip="Disabled radio station" enabled="0">Power 0</item>
1375 <item tooltip="">WMMS 100.7</item>
1376 <item tooltip="E=mc^2">Energy 98.3</item>
1377 <item helptext="Favourite chukcha's radio">CHUM FM</item>
1379 <item hidden="1">Very quit station</item>
1385 @subsubsection xrc_wxrichtextctrl wxRichTextCtrl
1388 @hdr3col{property, type, description}
1389 @row3col{value, @ref overview_xrcformat_type_text,
1390 Initial value of the control (default: empty).}
1391 @row3col{maxlength, integer,
1392 Maximum length of the text entered (default: unlimited).}
1396 @subsubsection xrc_wxscrollbar wxScrollBar
1399 @hdr3col{property, type, description}
1400 @row3col{value, integer,
1401 Initial position of the scrollbar (default: 0).}
1402 @row3col{range, integer,
1403 Maximum value of the gauge (default: 10).}
1404 @row3col{thumbsize, integer,
1405 Size of the thumb (default: 1).}
1406 @row3col{pagesize, integer,
1407 Page size (default: 1).}
1410 @subsubsection xrc_wxscrolledwindow wxScrolledWindow
1413 @hdr3col{property, type, description}
1414 @row3col{scrollrate, @ref overview_xrcformat_type_size,
1415 Scroll rate in @em x and @em y directions (default: not set;
1416 required if the window has a sizer child).}
1419 wxScrolledWindow may have optional children: either exactly one
1420 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
1421 objects. If sizer child is used, wxSizer::FitInside() is used (instead of
1422 wxSizer::Fit() as usual) and so the children don't determine scrolled window's
1423 minimal size, they only affect @em virtual size. Usually, both @c scrollrate
1424 and either @c size or @c minsize on containing sizer item should be used
1428 @subsubsection xrc_wxsimplehtmllistbox wxSimpleHtmlListBox
1430 wxSimpleHtmlListBox has same properties as @ref xrc_wxlistbox "wxListBox".
1431 The only difference is that the text contained in @c \<item\> elements is
1432 HTML markup. Note that the markup has to be escaped:
1435 <object class="wxSimpleHtmlListBox">
1437 <item><b>Bold</b> Milk</item>
1442 (X)HTML markup elements cannot be included directly:
1445 <object class="wxSimpleHtmlListBox">
1447 <!-- This is incorrect, doesn't work! -->
1448 <item><b>Bold</b> Milk</item>
1454 @subsubsection xrc_wxslider wxSlider
1457 @hdr3col{property, type, description}
1458 @row3col{value, integer,
1459 Initial value of the control (default: 0).}
1460 @row3col{min, integer,
1461 Minimum allowed value (default: 0).}
1462 @row3col{max, integer,
1463 Maximum allowed value (default: 100).}
1464 @row3col{pagesize, integer,
1465 Page size; number of steps the slider moves when the user moves
1466 pages up or down (default: unset).}
1467 @row3col{linesize, integer,
1468 Line size; number of steps the slider moves when the user moves it
1469 up or down a line (default: unset).}
1470 @row3col{tickfreq, integer,
1471 Tick marks frequency (Windows only; default: unset).}
1472 @row3col{tick, integer,
1473 Tick position (Windows only; default: unset).}
1474 @row3col{thumb, integer,
1475 Thumb length (Windows only; default: unset).}
1476 @row3col{selmin, integer,
1477 Selection start position (Windows only; default: unset).}
1478 @row3col{selmax, integer,
1479 Selection end position (Windows only; default: unset).}
1483 @subsubsection xrc_wxspinbutton wxSpinButton
1486 @hdr3col{property, type, description}
1487 @row3col{value, integer,
1488 Initial value of the control (default: 0).}
1489 @row3col{min, integer,
1490 Minimum allowed value (default: 0).}
1491 @row3col{max, integer,
1492 Maximum allowed value (default: 100).}
1496 @subsubsection xrc_wxspinctrl wxSpinCtrl
1498 wxSpinCtrl supports the same properties as @ref xrc_wxspinbutton and, since
1499 wxWidgets 2.9.5, another one:
1501 @row3col{base, integer,
1502 Numeric base, currently can be only 10 or 16 (default: 10).}
1506 @subsubsection xrc_wxsplitterwindow wxSplitterWindow
1509 @hdr3col{property, type, description}
1510 @row3col{orientation, @ref overview_xrcformat_type_string,
1511 Orientation of the splitter, either "vertical" or "horizontal" (default: horizontal).}
1512 @row3col{sashpos, integer,
1513 Initial position of the sash (default: 0).}
1514 @row3col{minsize, integer,
1515 Minimum child size (default: not set).}
1516 @row3col{gravity, @ref overview_xrcformat_type_float,
1517 Sash gravity, see wxSplitterWindow::SetSashGravity() (default: not set).}
1520 wxSplitterWindow must have one or two children that are non-toplevel window
1521 objects. If there's only one child, it is used as wxSplitterWindow's only
1522 visible child. If there are two children, the first one is used for left/top
1523 child and the second one for right/bottom child window.
1526 @subsubsection xrc_wxsearchctrl wxSearchCtrl
1529 @hdr3col{property, type, description}
1530 @row3col{value, @ref overview_xrcformat_type_text,
1531 Initial value of the control (default: empty).}
1535 @subsubsection xrc_wxstatusbar wxStatusBar
1538 @hdr3col{property, type, description}
1539 @row3col{fields, integer,
1540 Number of status bar fields (default: 1).}
1541 @row3col{widths, @ref overview_xrcformat_type_string,
1542 Comma-separated list of @em fields integers. Each value specifies width
1543 of one field; the values are interpreted using the same convention used
1544 by wxStatusBar::SetStatusWidths().}
1545 @row3col{styles, @ref overview_xrcformat_type_string,
1546 Comma-separated list of @em fields flags. Each value specifies status bar
1547 fieldd style and can be one of @c wxSB_NORMAL, @c wxSB_FLAT or
1548 @c wxSB_RAISED. See wxStatusBar::SetStatusStyles() for their description.}
1553 @subsubsection xrc_wxstaticbitmap wxStaticBitmap
1556 @hdr3col{property, type, description}
1557 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1558 Bitmap to display (required).}
1561 @subsubsection xrc_wxstaticbox wxStaticBox
1564 @hdr3col{property, type, description}
1565 @row3col{label, @ref overview_xrcformat_type_text,
1566 Static box's label (required).}
1570 @subsubsection xrc_wxstaticline wxStaticLine
1572 No additional properties.
1575 @subsubsection xrc_wxstatictext wxStaticText
1578 @hdr3col{property, type, description}
1579 @row3col{label, @ref overview_xrcformat_type_text,
1580 Label to display (required).}
1581 @row3col{wrap, integer,
1582 Wrap the text so that each line is at most the given number of pixels, see
1583 wxStaticText::Wrap() (default: no wrap).}
1586 @subsubsection xrc_wxtextctrl wxTextCtrl
1589 @hdr3col{property, type, description}
1590 @row3col{value, @ref overview_xrcformat_type_text,
1591 Initial value of the control (default: empty).}
1592 @row3col{maxlength, integer,
1593 Maximum length of the text which can be entered by user (default: unlimited).}
1597 @subsubsection xrc_wxtimepickerctrl wxTimePickerCtrl
1599 No additional properties.
1602 @subsubsection xrc_wxtogglebutton wxToggleButton
1605 @hdr3col{property, type, description}
1606 @row3col{label, @ref overview_xrcformat_type_text,
1607 Label to display on the button (required).}
1608 @row3col{checked, @ref overview_xrcformat_type_bool,
1609 Should the button be checked/pressed initially (default: 0)?}
1612 @subsubsection xrc_wxtoolbar wxToolBar
1615 @hdr3col{property, type, description}
1616 @row3col{bitmapsize, @ref overview_xrcformat_type_size,
1617 Size of toolbar bitmaps (default: not set).}
1618 @row3col{margins, @ref overview_xrcformat_type_size,
1619 Margins (default: platform default).}
1620 @row3col{packing, integer,
1621 Packing, see wxToolBar::SetToolPacking() (default: not set).}
1622 @row3col{separation, integer,
1623 Default separator size, see wxToolBar::SetToolSeparation() (default: not set).}
1624 @row3col{dontattachtoframe, @ref overview_xrcformat_type_bool,
1625 If set to 0 and the toolbar object is child of a wxFrame,
1626 wxFrame::SetToolBar() is called; otherwise, you have to add it to a frame
1627 manually. The toolbar is attached by default, you have to set this property
1628 to 1 to disable this behaviour (default: 0).}
1631 A toolbar can have one or more child objects of any wxControl-derived class or
1632 one of two pseudo-classes: @c separator or @c tool.
1634 The @c separator pseudo-class is used to insert separators into the toolbar and
1635 has neither properties nor children. Similarly, the @c space pseudo-class is
1636 used for stretchable spaces (see wxToolBar::AddStretchableSpace(), new since
1639 The @c tool pseudo-class objects specify toolbar buttons and have the following
1643 @hdr3col{property, type, description}
1644 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1645 Tool's bitmap (required).}
1646 @row3col{bitmap2, @ref overview_xrcformat_type_bitmap,
1647 Bitmap for disabled tool (default: derived from @c bitmap).}
1648 @row3col{label, @ref overview_xrcformat_type_text,
1649 Label to display on the tool (default: no label).}
1650 @row3col{radio, @ref overview_xrcformat_type_bool,
1651 Item's kind is wxITEM_RADIO (default: 0)?}
1652 @row3col{toggle, @ref overview_xrcformat_type_bool,
1653 Item's kind is wxITEM_CHECK (default: 0)?}
1654 @row3col{dropdown, see below,
1655 Item's kind is wxITEM_DROPDOWN (default: 0)? (only available since wxWidgets 2.9.0)}
1656 @row3col{tooltip, @ref overview_xrcformat_type_text,
1657 Tooltip to use for the tool (default: none).}
1658 @row3col{longhelp, @ref overview_xrcformat_type_text,
1659 Help text shown in statusbar when the mouse is on the tool (default: none).}
1660 @row3col{disabled, @ref overview_xrcformat_type_bool,
1661 Is the tool initially disabled (default: 0)?}
1662 @row3col{checked, @ref overview_xrcformat_type_bool,
1663 Is the tool initially checked (default: 0)? (only available since wxWidgets 2.9.3)}
1666 The presence of a @c dropdown property indicates that the tool is of type
1667 wxITEM_DROPDOWN. It must be either empty or contain exactly one @ref
1668 xrc_wxmenu child object defining the drop-down button associated menu.
1670 Notice that @c radio, @c toggle and @c dropdown are mutually exclusive.
1672 Children that are neither @c tool nor @c separator must be instances of classes
1673 derived from wxControl and are added to the toolbar using
1674 wxToolBar::AddControl().
1678 <object class="wxToolBar">
1679 <style>wxTB_FLAT|wxTB_NODIVIDER</style>
1680 <object class="tool" name="foo">
1681 <bitmap>foo.png</bitmap>
1684 <object class="tool" name="bar">
1685 <bitmap>bar.png</bitmap>
1688 <object class="separator"/>
1689 <object class="tool" name="view_auto">
1690 <bitmap>view.png</bitmap>
1693 <object class="wxMenu">
1694 <object class="wxMenuItem" name="view_as_text">
1695 <label>View as text</label>
1697 <object class="wxMenuItem" name="view_as_hex">
1698 <label>View as binary</label>
1703 <object class="space"/>
1704 <object class="wxComboBox">
1707 <item>a combobox</item>
1708 <item>in the toolbar</item>
1716 @subsubsection xrc_wxtoolbook wxToolbook
1718 A toolbook can have one or more child objects of the @c toolbookpage
1719 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
1720 @c notebookpage) and one child object of the @ref xrc_wximagelist class.
1721 @c toolbookpage objects have the following properties:
1724 @hdr3col{property, type, description}
1725 @row3col{label, @ref overview_xrcformat_type_text,
1726 Sheet page's title (required).}
1727 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1728 Bitmap shown alongside the label (default: none).}
1729 @row3col{image, integer,
1730 The zero-based index of the image associated with the item
1731 into the image list.}
1732 @row3col{selected, @ref overview_xrcformat_type_bool,
1733 Is the page selected initially (only one page can be selected; default: 0)?}
1736 Each @c toolbookpage has exactly one non-toplevel window as its child.
1739 @subsubsection xrc_wxtreectrl wxTreeCtrl
1741 A treectrl can have one child object of the @ref xrc_wximagelist class.
1743 No additional properties.
1746 @subsubsection xrc_wxtreebook wxTreebook
1748 A treebook can have one or more child objects of the @c treebookpage
1749 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
1750 @c notebookpage) and one child object of the @ref xrc_wximagelist class.
1751 @c treebookpage objects have the following properties:
1754 @hdr3col{property, type, description}
1755 @row3col{depth, integer,
1756 Page's depth in the labels tree (required; see below).}
1757 @row3col{label, @ref overview_xrcformat_type_text,
1758 Sheet page's title (required).}
1759 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1760 Bitmap shown alongside the label (default: none).}
1761 @row3col{image, integer,
1762 The zero-based index of the image associated with the item
1763 into the image list.}
1764 @row3col{selected, @ref overview_xrcformat_type_bool,
1765 Is the page selected initially (only one page can be selected; default: 0)?}
1766 @row3col{expanded, @ref overview_xrcformat_type_bool,
1767 If set to 1, the page is initially expanded. By default all pages are
1768 initially collapsed.}
1771 Each @c treebookpage has exactly one non-toplevel window as its child.
1773 The tree of labels is not described using nested @c treebookpage objects, but
1774 using the @em depth property. Toplevel pages have depth 0, their child pages
1775 have depth 1 and so on. A @c treebookpage's label is inserted as child of
1776 the latest preceding page with depth equal to @em depth-1. For example, this
1780 <object class="wxTreebook">
1782 <object class="treebookpage">
1784 <label>Page 1</label>
1785 <object class="wxPanel">...</object>
1787 <object class="treebookpage">
1789 <label>Subpage 1A</label>
1790 <object class="wxPanel">...</object>
1792 <object class="treebookpage">
1794 <label>Subsubpage 1</label>
1795 <object class="wxPanel">...</object>
1797 <object class="treebookpage">
1799 <label>Subpage 1B</label>
1800 <object class="wxPanel">...</object>
1802 <object class="treebookpage">
1804 <label>Subsubpage 2</label>
1805 <object class="wxPanel">...</object>
1807 <object class="treebookpage">
1809 <label>Page 2</label>
1810 <object class="wxPanel">...</object>
1815 corresponds to the following tree of labels:
1825 @subsubsection xrc_wxwizard wxWizard
1828 @hdr3col{property, type, description}
1829 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1830 Bitmap to display on the left side of the wizard (default: none).}
1833 A wizard object can have one or more child objects of the wxWizardPage or
1834 wxWizardPageSimple classes. They both support the following properties
1835 (in addition to @ref overview_xrcformat_std_props):
1838 @hdr3col{property, type, description}
1839 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1840 Page-specific bitmap (default: none).}
1843 wxWizardPageSimple pages are automatically chained together; wxWizardPage pages
1844 transitions must be handled programmatically.
1847 @section overview_xrcformat_sizers Sizers
1849 Sizers are handled slightly differently in XRC resources than they are in
1850 wxWindow hierarchy. wxWindow's sizers hierarchy is parallel to the wxWindow
1851 children hierarchy: child windows are children of their parent window and
1852 the sizer (or sizers) form separate hierarchy attached to the window with
1853 wxWindow::SetSizer().
1855 In XRC, the two hierarchies are merged together: sizers are children of other
1856 sizers or windows and they can contain child window objects.
1858 If a sizer is child of a window object in the resource, it must be the only
1859 child and it will be attached to the parent with wxWindow::SetSizer().
1860 Additionally, if the window doesn't have its size explicitly set,
1861 wxSizer::Fit() is used to resize the window. If the parent window is
1862 toplevel window, wxSizer::SetSizeHints() is called to set its hints.
1864 A sizer object can have one or more child objects of one of two pseudo-classes:
1865 @c sizeritem or @c spacer (see @ref overview_xrcformat_wxstddialogbuttonsizer for
1866 an exception). The former specifies an element (another sizer or a window)
1867 to include in the sizer, the latter adds empty space to the sizer.
1869 @c sizeritem objects have exactly one child object: either another sizer
1870 object, or a window object. @c spacer objects don't have any children, but
1871 they have one property:
1874 @hdr3col{property, type, description}
1875 @row3col{size, @ref overview_xrcformat_type_size, Size of the empty space (required).}
1878 Both @c sizeritem and @c spacer objects can have any of the following
1882 @hdr3col{property, type, description}
1883 @row3col{option, integer,
1884 The "option" value for sizers. Used by wxBoxSizer to set proportion of
1885 the item in the growable direction (default: 0).}
1886 @row3col{flag, @ref overview_xrcformat_type_style,
1887 wxSizerItem flags (default: 0).}
1888 @row3col{border, @ref overview_xrcformat_type_dimension,
1889 Size of the border around the item (directions are specified in flags)
1891 @row3col{minsize, @ref overview_xrcformat_type_size,
1892 Minimal size of this item (default: no min size).}
1893 @row3col{ratio, @ref overview_xrcformat_type_size,
1894 Item ratio, see wxSizer::SetRatio() (default: no ratio).}
1895 @row3col{cellpos, @ref overview_xrcformat_type_pos,
1896 (wxGridBagSizer only) Position, see wxGBSizerItem::SetPos() (required). }
1897 @row3col{cellspan, @ref overview_xrcformat_type_size,
1898 (wxGridBagSizer only) Span, see wxGBSizerItem::SetSpan() (required). }
1901 Example of sizers XRC code:
1903 <object class="wxDialog" name="derived_dialog">
1904 <title>Derived Dialog Example</title>
1905 <centered>1</centered>
1906 <!-- this sizer is set to be this dialog's sizer: -->
1907 <object class="wxFlexGridSizer">
1912 <growablecols>0</growablecols>
1913 <growablerows>0</growablerows>
1914 <object class="sizeritem">
1915 <flag>wxALIGN_CENTRE|wxALL</flag>
1917 <object class="wxButton" name="my_button">
1918 <label>My Button</label>
1921 <object class="sizeritem">
1922 <flag>wxALIGN_CENTRE|wxALL</flag>
1924 <object class="wxBoxSizer">
1925 <orient>wxHORIZONTAL</orient>
1926 <object class="sizeritem">
1927 <flag>wxALIGN_CENTRE|wxALL</flag>
1929 <object class="wxCheckBox" name="my_checkbox">
1930 <label>Enable this text control:</label>
1933 <object class="sizeritem">
1934 <flag>wxALIGN_CENTRE|wxALL</flag>
1936 <object class="wxTextCtrl" name="my_textctrl">
1948 The sizer classes that can be used are listed below, together with their
1949 class-specific properties. All classes support the following properties:
1952 @hdr3col{property, type, description}
1953 @row3col{minsize, @ref overview_xrcformat_type_size,
1954 Minimal size that this sizer will have, see wxSizer::SetMinSize()
1955 (default: no min size).}
1958 @subsection overview_xrcformat_wxboxsizer wxBoxSizer
1961 @hdr3col{property, type, description}
1962 @row3col{orient, @ref overview_xrcformat_type_style,
1963 Sizer orientation, "wxHORIZONTAL" or "wxVERTICAL" (default: wxHORIZONTAL).}
1966 @subsection overview_xrcformat_wxstaticsboxizer wxStaticBoxSizer
1969 @hdr3col{property, type, description}
1970 @row3col{orient, @ref overview_xrcformat_type_style,
1971 Sizer orientation, "wxHORIZONTAL" or "wxVERTICAL" (default: wxHORIZONTAL).}
1972 @row3col{label, @ref overview_xrcformat_type_text,
1973 Label to be used for the static box around the sizer (required).}
1976 @subsection overview_xrcformat_wxgridsizer wxGridSizer
1979 @hdr3col{property, type, description}
1980 @row3col{rows, integer, Number of rows in the grid (default: 0 - determine automatically).}
1981 @row3col{cols, integer, Number of columns in the grid (default: 0 - determine automatically).}
1982 @row3col{vgap, integer, Vertical gap between children (default: 0).}
1983 @row3col{hgap, integer, Horizontal gap between children (default: 0).}
1986 @subsection overview_xrcformat_wxflexgridsizer wxFlexGridSizer
1989 @hdr3col{property, type, description}
1990 @row3col{rows, integer, Number of rows in the grid (default: 0 - determine automatically).}
1991 @row3col{cols, integer, Number of columns in the grid (default: 0 - determine automatically).}
1992 @row3col{vgap, integer, Vertical gap between children (default: 0).}
1993 @row3col{hgap, integer, Horizontal gap between children (default: 0).}
1994 @row3col{growablerows, comma-separated integers list,
1995 Comma-separated list of indexes of rows that are growable
1997 @row3col{growablecols, comma-separated integers list,
1998 Comma-separated list of indexes of columns that are growable
2002 @subsection overview_xrcformat_wxgridbagsizer wxGridBagSizer
2005 @hdr3col{property, type, description}
2006 @row3col{vgap, integer, Vertical gap between children (default: 0).}
2007 @row3col{hgap, integer, Horizontal gap between children (default: 0).}
2008 @row3col{growablerows, comma-separated integers list,
2009 Comma-separated list of indexes of rows that are growable
2011 @row3col{growablecols, comma-separated integers list,
2012 Comma-separated list of indexes of columns that are growable
2016 @subsection overview_xrcformat_wxwrapsizer wxWrapSizer
2019 @hdr3col{property, type, description}
2020 @row3col{orient, @ref overview_xrcformat_type_style,
2021 Sizer orientation, "wxHORIZONTAL" or "wxVERTICAL" (required).}
2022 @row3col{flag, @ref overview_xrcformat_type_style, wxWrapSizer flags (default: 0).}
2025 @subsection overview_xrcformat_wxstddialogbuttonsizer wxStdDialogButtonSizer
2027 Unlike other sizers, wxStdDialogButtonSizer has neither @c sizeritem
2028 nor @c spacer children. Instead, it has one or more children of the
2029 @c button pseudo-class. @c button objects have no properties and they must
2030 always have exactly one child of the @c wxButton class or a class derived from
2035 <object class="wxStdDialogButtonSizer">
2036 <object class="button">
2037 <object class="wxButton" name="wxID_OK">
2041 <object class="button">
2042 <object class="wxButton" name="wxID_CANCEL">
2043 <label>Cancel</label>
2051 @section overview_xrcformat_other_objects Other Objects
2053 In addition to describing UI elements, XRC files can contain non-windows
2054 objects such as bitmaps or icons. This is a concession to Windows developers
2055 used to storing them in Win32 resources.
2057 Note that unlike Win32 resources, bitmaps included in XRC files are @em not
2058 embedded in the XRC file itself. XRC file only contains a reference to another
2059 file with bitmap data.
2061 @subsection overview_xrcformat_bitmap wxBitmap
2063 Bitmaps are stored in @c \<object\> element with class set to @c wxBitmap. Such
2064 bitmaps can then be loaded using wxXmlResource::LoadBitmap(). The content of
2065 the element is exactly same as in the case of
2066 @ref overview_xrcformat_type_bitmap "bitmap properties", except that toplevel
2067 @c \<object\> is used.
2069 For example, instead of:
2071 <bitmap>mybmp.png</bitmap>
2072 <bitmap stock_id="wxART_NEW"/>
2074 toplevel wxBitmap resources would look like:
2076 <object class="wxBitmap" name="my_bitmap">mybmp.png</object>
2077 <object class="wxBitmap" name="my_new_bitmap" stock_id="wxART_NEW"/>
2081 @subsection overview_xrcformat_icon wxIcon
2083 wxIcon resources are identical to @ref overview_xrcformat_bitmap "wxBitmap ones",
2084 except that the class is @c wxIcon.
2087 @section overview_xrcformat_platform Platform Specific Content
2089 It is possible to conditionally process parts of XRC files on some platforms
2090 only and ignore them on other platforms. @em Any element in XRC file, be it
2091 toplevel or arbitrarily nested one, can have the @c platform attribute. When
2092 used, @c platform contains |-separated list of platforms that this element
2093 should be processed on. It is filtered out and ignored on any other platforms.
2095 Possible elemental values are:
2097 @itemdef{ @c win, Windows }
2098 @itemdef{ @c mac, Mac OS X (or Mac Classic in wxWidgets version supporting it) }
2099 @itemdef{ @c unix, Any Unix platform @em except OS X }
2100 @itemdef{ @c os2, OS/2 }
2105 <label platform="win">Windows</label>
2106 <label platform="unix">Unix</label>
2107 <label platform="mac">Mac OS X</label>
2108 <help platform="mac|unix">Not a Windows machine</help>
2113 @section overview_xrcformat_idranges ID Ranges
2115 Usually you won't care what value the XRCID macro returns for the ID of an
2116 object. Sometimes though it is convenient to have a range of IDs that are
2117 guaranteed to be consecutive. An example of this would be connecting a group of
2118 similar controls to the same event handler.
2120 The following XRC fragment 'declares' an ID range called @em foo and another
2121 called @em bar; each with some items.
2124 <object class="wxButton" name="foo[start]">
2125 <object class="wxButton" name="foo[end]">
2126 <object class="wxButton" name="foo[2]">
2128 <object class="wxButton" name="bar[0]">
2129 <object class="wxButton" name="bar[2]">
2130 <object class="wxButton" name="bar[1]">
2132 <ids-range name="foo" />
2133 <ids-range name="bar" size="30" start="10000" />
2136 For the range foo, no @em size or @em start parameters were given, so the size
2137 will be calculated from the number of range items, and IDs allocated by
2138 wxWindow::NewControlId (so they'll be negative). Range bar asked for a size of
2139 30, so this will be its minimum size: should it have more items, the range will
2140 automatically expand to fit them. It specified a start ID of 10000, so
2141 XRCID("bar[0]") will be 10000, XRCID("bar[1]") 10001 etc. Note that if you
2142 choose to supply a start value it must be positive, and it's your
2143 responsibility to avoid clashes.
2145 For every ID range, the first item can be referenced either as
2146 <em>rangename</em>[0] or <em>rangename</em>[start]. Similarly
2147 <em>rangename</em>[end] is the last item. Using [start] and [end] is more
2148 descriptive in e.g. a Bind() event range or a @em for loop, and they don't have
2149 to be altered whenever the number of items changes.
2151 Whether a range has positive or negative IDs, [start] is always a smaller
2152 number than [end]; so code like this works as expected:
2155 for (int n=XRCID("foo[start]"); n <= XRCID("foo[end]"); ++n)
2159 ID ranges can be seen in action in the <em>objref</em> dialog section of the
2163 @li All the items in an ID range must be contained in the same XRC file.
2164 @li You can't use an ID range in a situation where static initialisation
2165 occurs; in particular, they won't work as expected in an event table. This is
2166 because the event table's IDs are set to their integer values before the XRC
2167 file is loaded, and aren't subsequently altered when the XRCID value changes.
2171 @section overview_xrcformat_extending Extending the XRC Format
2173 The XRC format is designed to be extensible and allows specifying and loading
2174 custom controls. The three available mechanisms are described in the rest of
2175 this section in the order of increasing complexity.
2177 @subsection overview_xrcformat_extending_subclass Subclassing
2179 The simplest way to add custom controls is to set the @c subclass attribute
2180 of @c \<object\> element:
2183 <object name="my_value" class="wxTextCtrl" subclass="MyTextCtrl">
2184 <style>wxTE_MULTILINE</style>
2185 ...etc., setup wxTextCtrl as usual...
2189 In that case, wxXmlResource will create an instance of the specified subclass
2190 (@c MyTextCtrl in the example above) instead of the class (@c wxTextCtrl above)
2191 when loading the resource. However, the rest of the object's loading (calling
2192 its Create() method, setting its properties, loading any children etc.)
2193 will proceed in @em exactly the same way as it would without @c subclass
2194 attribute. In other words, this approach is only sufficient when the custom
2195 class is just a small modification (e.g. overridden methods or customized
2196 events handling) of an already supported classes.
2198 The subclass must satisfy a number of requirements:
2200 -# It must be derived from the class specified in @c class attribute.
2201 -# It must be visible in wxWidget's pseudo-RTTI mechanism, i.e. there must be
2202 a DECLARE_DYNAMIC_CLASS() entry for it.
2203 -# It must support two-phase creation. In particular, this means that it has
2204 to have default constructor.
2205 -# It cannot provide custom Create() method and must be constructible using
2206 base @c class' Create() method (this is because XRC will call Create() of
2207 @c class, not @c subclass). In other words, @em creation of the control
2208 must not be customized.
2211 @subsection overview_xrcformat_extending_unknown Unknown Objects
2213 A more flexible solution is to put a @em placeholder in the XRC file and
2214 replace it with custom control after the resource is loaded. This is done by
2215 using the @c unknown pseudo-class:
2218 <object class="unknown" name="my_placeholder"/>
2221 The placeholder is inserted as dummy wxPanel that will hold custom control in
2222 it. At runtime, after the resource is loaded and a window created from it
2223 (using e.g. wxXmlResource::LoadDialog()), use code must call
2224 wxXmlResource::AttachUnknownControl() to insert the desired control into
2225 placeholder container.
2227 This method makes it possible to insert controls that are not known to XRC at
2228 all, but it's also impossible to configure the control in XRC description in
2229 any way. The only properties that can be specified are
2230 the @ref overview_xrcformat_std_props "standard window properties".
2232 @note @c unknown class cannot be combined with @c subclass attribute,
2233 they are mutually exclusive.
2236 @subsection overview_xrcformat_extending_custom Adding Custom Classes
2238 Finally, XRC allows adding completely new classes in addition to the ones
2239 listed in this document. A class for which wxXmlResourceHandler is implemented
2240 can be used as first-class object in XRC simply by passing class name as the
2241 value of @c class attribute:
2244 <object name="my_ctrl" class="MyWidget">
2245 <my_prop>foo</my_prop>
2246 ...etc., whatever MyWidget handler accepts...
2250 The only requirements on the class are that
2251 -# the class must derive from wxObject
2252 -# it must support wxWidget's pseudo-RTTI mechanism
2254 Child elements of @c \<object\> are handled by the custom handler and there are
2255 no limitations on them imposed by XRC format.
2257 This is the only mechanism that works for toplevel objects -- custom controls
2258 are accessible using the type-unsafe wxXmlResource::LoadObject() method.
2262 @section overview_xrcformat_packed Packed XRC Files
2264 In addition to plain XRC files, wxXmlResource supports (if wxFileSystem support
2265 is compiled in) compressed XRC resources. Compressed resources have either
2266 .zip or .xrs extension and are simply ZIP files that contain arbitrary
2267 number of XRC files and their dependencies (bitmaps, icons etc.).
2271 @section overview_xrcformat_oldversions Older Format Versions
2273 This section describes differences in older revisions of XRC format (i.e.
2274 files with older values of @c version attribute of @c \<resource\>).
2277 @subsection overview_xrcformat_pre_v2530 Versions Before 2.5.3.0
2279 Version 2.5.3.0 introduced C-like handling of "\\" in text. In older versions,
2280 "\n", "\t" and "\r" escape sequences were replaced with respective characters
2281 in the same matter it's done in C, but "\\" was left intact instead of being
2282 replaced with single "\", as one would expect. Starting with 2.5.3.0, all of
2283 them are handled in C-like manner.
2286 @subsection overview_xrcformat_pre_v2301 Versions Before 2.3.0.1
2288 Prior to version 2.3.0.1, "$" was used for accelerators instead of "_"
2289 or "&". For example,
2291 <label>$File</label>
2293 was used in place of current version's
2295 <label>_File</label>