]>
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_wxbitmapbutton wxBitmapButton
532 @hdr3col{property, type, description}
533 @row3col{default, @ref overview_xrcformat_type_bool,
534 Should this button be the default button in dialog (default: 0)?}
535 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
536 Bitmap to show on the button (required).}
537 @row3col{selected, @ref overview_xrcformat_type_bitmap,
538 Bitmap to show when the button is selected (default: none, same as @c bitmap).}
539 @row3col{focus, @ref overview_xrcformat_type_bitmap,
540 Bitmap to show when the button has focus (default: none, same as @c bitmap).}
541 @row3col{disabled, @ref overview_xrcformat_type_bitmap,
542 Bitmap to show when the button is disabled (default: none, same as @c bitmap).}
543 @row3col{hover, @ref overview_xrcformat_type_bitmap,
544 Bitmap to show when mouse cursor hovers above the bitmap (default: none, same as @c bitmap).}
548 @subsubsection xrc_wxbitmapcombobox wxBitmapComboBox
551 @hdr3col{property, type, description}
552 @row3col{selection, integer,
553 Index of the initially selected item or -1 for no selection (default: -1).}
554 @row3col{value, @ref overview_xrcformat_type_string,
555 Initial value in the control (doesn't have to be one of @ content values;
559 If both @c value and @c selection are specified and @c selection is not -1,
560 then @c selection takes precedence.
562 A wxBitmapComboBox can have one or more child objects of the @c ownerdrawnitem
563 pseudo-class. @c ownerdrawnitem objects have the following properties:
566 @hdr3col{property, type, description}
567 @row3col{text, @ref overview_xrcformat_type_text,
568 Item's label (required).}
569 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
570 Item's bitmap (default: no bitmap).}
575 <object class="wxBitmapComboBox">
576 <selection>1</selection>
577 <object class="ownerdrawnitem">
579 <bitmap>foo.png</bitmap>
581 <object class="ownerdrawnitem">
583 <bitmap>bar.png</bitmap>
589 @subsubsection xrc_wxtogglebuttton wxBitmapToggleButton
592 @hdr3col{property, type, description}
593 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
594 Label to display on the button (required).}
595 @row3col{checked, @ref overview_xrcformat_type_bool,
596 Should the button be checked/pressed initially (default: 0)?}
600 @subsubsection xrc_wxbutton wxButton
603 @hdr3col{property, type, description}
604 @row3col{label, @ref overview_xrcformat_type_text,
605 Label to display on the button (may be empty if only bitmap is used).}
606 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
607 Bitmap to display in the button (optional).}
608 @row3col{bitmapposition, @c wxLEFT|wxRIGHT|wxTOP|wxBOTTOM,
609 Position of the bitmap in the button, see wxButton::SetBitmapPosition().}
610 @row3col{default, @ref overview_xrcformat_type_bool,
611 Should this button be the default button in dialog (default: 0)?}
615 @subsubsection xrc_wxcalendarctrl wxCalendarCtrl
617 No additional properties.
620 @subsubsection xrc_wxcheckbox wxCheckBox
623 @hdr3col{property, type, description}
624 @row3col{label, @ref overview_xrcformat_type_text,
625 Label to use for the checkbox (required).}
626 @row3col{checked, @ref overview_xrcformat_type_bool,
627 Should the checkbox be checked initially (default: 0)?}
631 @subsubsection xrc_wxchecklistbox wxCheckListBox
634 @hdr3col{property, type, description}
635 @row3col{content, items,
636 Content of the control; this property has any number of @c \<item\> XML
637 elements as its children, with the items text as their text values
641 The @c \<item\> elements have listbox items' labels as their text values. They
642 can also have optional @c checked XML attribute -- if set to "1", the value is
647 <object class="wxCheckListBox">
649 <item checked="1">Download library</item>
650 <item checked="1">Compile samples</item>
651 <item checked="1">Skim docs</item>
652 <item checked="1">Finish project</item>
653 <item>Wash car</item>
659 @subsubsection xrc_wxchoice wxChoice
662 @hdr3col{property, type, description}
663 @row3col{selection, integer,
664 Index of the initially selected item or -1 for no selection (default: -1).}
665 @row3col{content, items,
666 Content of the control; this property has any number of @c \<item\> XML
667 elements as its children, with the items text as their text values
673 <object class="wxChoice" name="controls_choice">
680 <item>The Sixth Sense!</item>
686 @subsubsection xrc_wxchoicebook wxChoicebook
688 A choicebook can have one or more child objects of the @c choicebookpage
689 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
690 @c notebookpage) and one child object of the @ref xrc_wximagelist class.
691 @c choicebookpage objects have the following properties:
694 @hdr3col{property, type, description}
695 @row3col{label, @ref overview_xrcformat_type_text,
696 Sheet page's title (required).}
697 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
698 Bitmap shown alongside the label (default: none).}
699 @row3col{image, integer,
700 The zero-based index of the image associated with the item
701 into the image list.}
702 @row3col{selected, @ref overview_xrcformat_type_bool,
703 Is the page selected initially (only one page can be selected; default: 0)?}
706 Each @c choicebookpage has exactly one non-toplevel window as its child.
709 @subsubsection xrc_wxcommandlinkbutton wxCommandLinkButton
711 The wxCommandLinkButton contains a main title-like @c label and an optional
712 @c note for longer description. The main @c label and the @c note can be
713 concatenated into a single string using a new line character between them
714 (notice that the @c note part can have more new lines in it).
717 @hdr3col{property, type, description}
718 @row3col{label, @ref overview_xrcformat_type_text,
719 First line of text on the button, typically the label of an action that
720 will be made when the button is pressed. }
721 @row3col{note, @ref overview_xrcformat_type_text,
722 Second line of text describing the action performed when the button is pressed. }
726 @subsubsection xrc_wxcollapsiblepane wxCollapsiblePane
729 @hdr3col{property, type, description}
730 @row3col{label, @ref overview_xrcformat_type_text,
731 Label to use for the collapsible section (required).}
732 @row3col{collapsed, @ref overview_xrcformat_type_bool,
733 Should the pane be collapsed initially (default: 0)?}
736 wxCollapsiblePane may contain single optional child object of the @c panewindow
737 pseudo-class type. @c panewindow itself must contain exactly one child that
738 is a @ref overview_xrcformat_sizers "sizer" or a non-toplevel window
742 @subsubsection xrc_wxcolourpickerctrl wxColourPickerCtrl
745 @hdr3col{property, type, description}
746 @row3col{value, @ref overview_xrcformat_type_colour,
747 Initial value of the control (default: wxBLACK).}
751 @subsubsection xrc_wxcombobox wxComboBox
754 @hdr3col{property, type, description}
755 @row3col{selection, integer,
756 Index of the initially selected item or -1 for no selection (default: not used).}
757 @row3col{content, items,
758 Content of the control; this property has any number of @c \<item\> XML
759 elements as its children, with the items text as their text values
761 @row3col{value, @ref overview_xrcformat_type_string,
762 Initial value in the control (doesn't have to be one of @ content values;
766 If both @c value and @c selection are specified and @c selection is not -1,
767 then @c selection takes precedence.
771 <object class="wxComboBox" name="controls_combobox">
772 <style>wxCB_DROPDOWN</style>
777 <item>notepad.exe</item>
783 @subsubsection xrc_wxdatepickerctrl wxDatePickerCtrl
785 No additional properties.
788 @subsubsection xrc_wxdialog wxDialog
791 @hdr3col{property, type, description}
792 @row3col{title, @ref overview_xrcformat_type_text,
793 Dialog's title (default: empty).}
794 @row3col{icon, @ref overview_xrcformat_type_bitmap,
795 Dialog's icon (default: not used).}
796 @row3col{centered, @ref overview_xrcformat_type_bool,
797 Whether the dialog should be centered on the screen (default: 0).}
800 wxDialog may have optional children: either exactly one
801 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
802 objects. If sizer child is used, it sets
803 @ref wxSizer::SetSizeHints() "size hints" too.
805 @subsubsection xrc_wxdirpickerctrl wxDirPickerCtrl
808 @hdr3col{property, type, description}
809 @row3col{value, @ref overview_xrcformat_type_string,
810 Initial value of the control (default: empty).}
811 @row3col{message, @ref overview_xrcformat_type_text,
812 Message shown to the user in wxDirDialog shown by the control (required).}
816 @subsubsection xrc_wxfilectrl wxFileCtrl
819 @hdr3col{property, type, description}
820 @row3col{defaultdirectory, @ref overview_xrcformat_type_string,
821 Sets the current directory displayed in the control. }
822 @row3col{defaultfilename, @ref overview_xrcformat_type_string,
823 Selects a certain file.}
824 @row3col{wildcard, @ref overview_xrcformat_type_string,
825 Sets the wildcard, which can contain multiple file types, for example:
826 "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".}
830 @subsubsection xrc_wxfilepickerctrl wxFilePickerCtrl
833 @hdr3col{property, type, description}
834 @row3col{value, @ref overview_xrcformat_type_string,
835 Initial value of the control (default: empty).}
836 @row3col{message, @ref overview_xrcformat_type_text,
837 Message shown to the user in wxDirDialog shown by the control (required).}
838 @row3col{wildcard, @ref overview_xrcformat_type_string,
839 Sets the wildcard, which can contain multiple file types, for example:
840 "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".}
844 @subsubsection xrc_wxfontpickerctrl wxFontPickerCtrl
847 @hdr3col{property, type, description}
848 @row3col{value, @ref overview_xrcformat_type_font,
849 Initial value of the control (default: wxNORMAL_FONT).}
852 @subsubsection xrc_wxfrane wxFrame
855 @hdr3col{property, type, description}
856 @row3col{title, @ref overview_xrcformat_type_text,
857 Frame's title (default: empty).}
858 @row3col{icon, @ref overview_xrcformat_type_bitmap,
859 Frame's icon (default: not used).}
860 @row3col{centered, @ref overview_xrcformat_type_bool,
861 Whether the frame should be centered on the screen (default: 0).}
864 wxFrame may have optional children: either exactly one
865 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
866 objects. If sizer child is used, it sets
867 @ref wxSizer::SetSizeHints() "size hints" too.
870 @subsubsection xrc_wxgauge wxGauge
873 @hdr3col{property, type, description}
874 @row3col{range, integer,
875 Maximum value of the gauge (default: 100).}
876 @row3col{value, integer,
877 Initial value of the control (default: 0).}
878 @row3col{shadow, @ref overview_xrcformat_type_dimension,
879 Rendered shadow size (default: none; ignored by most platforms).}
880 @row3col{bezel, @ref overview_xrcformat_type_dimension,
881 Rendered bezel size (default: none; ignored by most platforms).}
884 @subsubsection xrc_wxgenericdirctrl wxGenericDirCtrl
887 @hdr3col{property, type, description}
888 @row3col{defaultfolder, @ref overview_xrcformat_type_text,
889 Initial folder (default: empty).}
890 @row3col{filter, @ref overview_xrcformat_type_text,
891 Filter string, using the same syntax as used by wxFileDialog, e.g.
892 "All files (*.*)|*.*|JPEG files (*.jpg)|*.jpg" (default: empty).}
893 @row3col{defaultfilter, integer,
894 Zero-based index of default filter (default: 0).}
897 @subsubsection xrc_wxgrid wxGrid
899 No additional properties.
902 @subsubsection xrc_wxhtmlwindow wxHtmlWindow
905 @hdr3col{property, type, description}
906 @row3col{url, @ref overview_xrcformat_type_url,
907 Page to display in the window.}
908 @row3col{htmlcode, @ref overview_xrcformat_type_text,
909 HTML markup to display in the window.}
910 @row3col{borders, @ref overview_xrcformat_type_dimension,
911 Border around HTML content (default: 0).}
914 At most one of @c url and @c htmlcode properties may be specified, they are
915 mutually exclusive. If neither is set, the window is initialized to show empty
919 @subsubsection xrc_wxhyperlinkctrl wxHyperlinkCtrl
922 @hdr3col{property, type, description}
923 @row3col{label, @ref overview_xrcformat_type_text,
924 Label to display on the control (required).}
925 @row3col{url, @ref overview_xrcformat_type_url,
926 URL to open when the link is clicked (required).}
930 @subsubsection xrc_wximagelist wxImageList
932 The imagelist can be used as a child object for the following classes:
933 - @ref xrc_wxchoicebook
934 - @ref xrc_wxlistbook
935 - @ref xrc_wxlistctrl
936 - @ref xrc_wxnotebook
937 - @ref xrc_wxtreebook
938 - @ref xrc_wxtreectrl
940 The available properties are:
943 @hdr3col{property, type, description}
944 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
945 Adds a new image by keeping its optional mask bitmap (see below).}
946 @row3col{mask, @ref overview_xrcformat_type_bool,
947 If masks should be created for all images (default: true).}
948 @row3col{size, @ref overview_xrcformat_type_size,
949 The size of the images in the list (default: the size of the first bitmap).}
956 <bitmap stock_id="wxART_QUESTION"/>
957 <bitmap stock_id="wxART_INFORMATION"/>
961 In the specific case of the @ref xrc_wxlistctrl, the tag can take the name
962 @c \<imagelist-small\> to define the 'small' image list, related to the flag
963 @c wxIMAGE_LIST_SMALL (see wxListCtrl documentation).
966 @subsubsection xrc_wxlistbox wxListBox
969 @hdr3col{property, type, description}
970 @row3col{selection, integer,
971 Index of the initially selected item or -1 for no selection (default: -1).}
972 @row3col{content, items,
973 Content of the control; this property has any number of @c \<item\> XML
974 elements as its children, with the items text as their text values
980 <object class="wxListBox" name="controls_listbox">
982 <style>wxLB_SINGLE</style>
987 <item>Orange juice</item>
988 <item>Paper towels</item>
994 @subsubsection xrc_wxlistbook wxListbook
996 A listbook can have one or more child objects of the @c listbookpage
997 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
998 @c notebookpage) and one child object of the @ref xrc_wximagelist class.
999 @c listbookpage objects have the following properties:
1002 @hdr3col{property, type, description}
1003 @row3col{label, @ref overview_xrcformat_type_text,
1004 Sheet page's title (required).}
1005 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1006 Bitmap shown alongside the label (default: none).}
1007 @row3col{image, integer,
1008 The zero-based index of the image associated with the item
1009 into the image list.}
1010 @row3col{selected, @ref overview_xrcformat_type_bool,
1011 Is the page selected initially (only one page can be selected; default: 0)?}
1014 Each @c listbookpage has exactly one non-toplevel window as its child.
1017 @subsubsection xrc_wxlistctrl wxListCtrl
1019 A list control can have one or more child objects of the class @ref xrc_wxlistitem
1020 and one or more objects of the @ref xrc_wximagelist class. The latter is
1021 defined either using @c \<imagelist\> tag for the control with @c wxLC_ICON
1022 style or using @c \<imagelist-small\> tag for the control with @c
1023 wxLC_SMALL_ICON style.
1025 Report mode list controls (i.e. created with @c wxLC_REPORT style) can in
1026 addition have one or more @ref xrc_wxlistcol child elements.
1028 @paragraph xrc_wxlistcol listcol
1030 The @c listcol class can only be used for wxListCtrl children. It can have the
1031 following properties:
1033 @hdr3col{property, type, description}
1034 @row3col{align, wxListColumnFormat,
1035 The alignment for the item.
1036 Can be one of @c wxLIST_FORMAT_LEFT, @c wxLIST_FORMAT_RIGHT or
1037 @c wxLIST_FORMAT_CENTRE.}
1038 @row3col{text, @ref overview_xrcformat_type_string,
1039 The title of the column. }
1040 @row3col{width, integer,
1042 @row3col{image, integer,
1043 The zero-based index of the image associated with the item in the 'small' image list. }
1046 The columns are appended to the control in order of their appearance and may be
1047 referenced by 0-based index in the @c col attributes of subsequent @c listitem
1050 @paragraph xrc_wxlistitem listitem
1052 The @c listitem is a child object for the class @ref xrc_wxlistctrl.
1053 It can have the following properties:
1056 @hdr3col{property, type, description}
1057 @row3col{align, wxListColumnFormat,
1058 The alignment for the item.
1059 Can be one of @c wxLIST_FORMAT_LEFT, @c wxLIST_FORMAT_RIGHT or
1060 @c wxLIST_FORMAT_CENTRE.}
1061 @row3col{bg, @ref overview_xrcformat_type_colour,
1062 The background color for the item.}
1063 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1064 Add a bitmap to the (normal) @ref xrc_wximagelist associated with the
1065 @ref xrc_wxlistctrl parent and associate it with this item.
1066 If the imagelist is not defined it will be created implicitly.}
1067 @row3col{bitmap-small, @ref overview_xrcformat_type_bitmap,
1068 Add a bitmap in the 'small' @ref xrc_wximagelist associated with the
1069 @ref xrc_wxlistctrl parent and associate it with this item.
1070 If the 'small' imagelist is not defined it will be created implicitly.}
1071 @row3col{col, integer,
1072 The zero-based column index.}
1073 @row3col{image, integer,
1074 The zero-based index of the image associated with the item
1075 in the (normal) image list.}
1076 @row3col{image-small, integer,
1077 The zero-based index of the image associated with the item
1078 in the 'small' image list.}
1079 @row3col{data, integer,
1080 The client data for the item.}
1081 @row3col{font, @ref overview_xrcformat_type_font,
1082 The font for the item.}
1083 @row3col{image, integer,
1084 The zero-based index of the image associated with the item
1085 into the image list.}
1086 @row3col{state, @ref overview_xrcformat_type_style,
1087 The item state. Can be any combination of the following values:
1088 - @c wxLIST_STATE_FOCUSED: The item has the focus.
1089 - @c wxLIST_STATE_SELECTED: The item is selected.}
1090 @row3col{text, @ref overview_xrcformat_type_string,
1091 The text label for the item. }
1092 @row3col{textcolour, @ref overview_xrcformat_type_colour,
1093 The text colour for the item. }
1096 Notice that the item position can't be specified here, the items are appended
1097 to the list control in order of their appearance.
1100 @subsubsection xrc_wxmdiparentframe wxMDIParentFrame
1102 wxMDIParentFrame supports the same properties that @ref xrc_wxfrane does.
1104 wxMDIParentFrame may have optional children. When used, the child objects
1105 must be of wxMDIChildFrame type.
1108 @subsubsection xrc_wxmdichildframe wxMDIChildFrame
1110 wxMDIChildFrame supports the same properties that @ref xrc_wxfrane and
1111 @ref xrc_wxmdiparentframe do.
1113 wxMDIChildFrame can only be used as as immediate child of @ref
1114 xrc_wxmdiparentframe.
1116 wxMDIChildFrame may have optional children: either exactly one
1117 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
1118 objects. If sizer child is used, it sets
1119 @ref wxSizer::SetSizeHints() "size hints" too.
1122 @subsubsection xrc_wxmenu wxMenu
1125 @hdr3col{property, type, description}
1126 @row3col{label, @ref overview_xrcformat_type_text,
1127 Menu's label (default: empty, but required for menus other
1129 @row3col{help, @ref overview_xrcformat_type_text,
1130 Help shown in statusbar when the menu is selected (only for submenus
1131 of another wxMenu, default: none).}
1132 @row3col{enabled, @ref overview_xrcformat_type_bool,
1133 Is the submenu item enabled (only for submenus of another wxMenu,
1137 Note that unlike most controls, wxMenu does @em not have
1138 @ref overview_xrcformat_std_props.
1140 A menu object can have one or more child objects of the wxMenuItem or wxMenu
1141 classes or @c break or @c separator pseudo-classes.
1143 The @c separator pseudo-class is used to insert separators into the menu and
1144 has neither properties nor children. Likewise, @c break inserts a break (see
1147 wxMenuItem objects support the following properties:
1150 @hdr3col{property, type, description}
1151 @row3col{label, @ref overview_xrcformat_type_text,
1152 Item's label (required).}
1153 @row3col{accel, @ref overview_xrcformat_type_text_notrans,
1154 Item's accelerator (default: none).}
1155 @row3col{radio, @ref overview_xrcformat_type_bool,
1156 Item's kind is wxITEM_RADIO (default: 0)?}
1157 @row3col{checkable, @ref overview_xrcformat_type_bool,
1158 Item's kind is wxITEM_CHECK (default: 0)?}
1159 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1160 Bitmap to show with the item (default: none).}
1161 @row3col{bitmap2, @ref overview_xrcformat_type_bitmap,
1162 Bitmap for the checked state (wxMSW, if checkable; default: none).}
1163 @row3col{help, @ref overview_xrcformat_type_text,
1164 Help shown in statusbar when the item is selected (default: none).}
1165 @row3col{enabled, @ref overview_xrcformat_type_bool,
1166 Is the item enabled (default: 1)?}
1167 @row3col{checked, @ref overview_xrcformat_type_bool,
1168 Is the item checked initially (default: 0)?}
1173 <object class="wxMenu" name="menu_edit">
1174 <style>wxMENU_TEAROFF</style>
1175 <label>_Edit</label>
1176 <object class="wxMenuItem" name="wxID_FIND">
1177 <label>_Find...</label>
1178 <accel>Ctrl-F</accel>
1180 <object class="separator"/>
1181 <object class="wxMenuItem" name="menu_fuzzy">
1182 <label>Translation is _fuzzy</label>
1183 <checkable>1</checkable>
1185 <object class="wxMenu" name="submenu">
1186 <label>A submenu</label>
1187 <object class="wxMenuItem" name="foo">...</object>
1190 <object class="separator" platform="unix"/>
1191 <object class="wxMenuItem" name="wxID_PREFERENCES" platform="unix">
1192 <label>_Preferences</label>
1197 @subsubsection xrc_wxmenubar wxMenuBar
1199 No properties. Note that unlike most controls, wxMenuBar does @em not have
1200 @ref overview_xrcformat_std_props.
1202 A menubar can have one or more child objects of the @ref xrc_wxmenu "wxMenu"
1206 @subsubsection xrc_wxnotebook wxNotebook
1208 A notebook can have one or more child objects of the @c notebookpage
1209 pseudo-class and one child object of the @ref xrc_wximagelist class.
1210 @c notebookpage objects have the following properties:
1213 @hdr3col{property, type, description}
1214 @row3col{label, @ref overview_xrcformat_type_text,
1215 Page's title (required).}
1216 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1217 Bitmap shown alongside the label (default: none).}
1218 @row3col{image, integer,
1219 The zero-based index of the image associated with the item
1220 into the image list.}
1221 @row3col{selected, @ref overview_xrcformat_type_bool,
1222 Is the page selected initially (only one page can be selected; default: 0)?}
1225 Each @c notebookpage has exactly one non-toplevel window as its child.
1229 <object class="wxNotebook">
1230 <style>wxBK_BOTTOM</style>
1231 <object class="notebookpage">
1232 <label>Page 1</label>
1233 <object class="wxPanel" name="page_1">
1237 <object class="notebookpage">
1238 <label>Page 2</label>
1239 <object class="wxPanel" name="page_2">
1247 @subsubsection xrc_wxownerdrawncombobox wxOwnerDrawnComboBox
1249 wxOwnerDrawnComboBox has the same properties as
1250 @ref xrc_wxcombobox "wxComboBox", plus the following additional properties:
1253 @hdr3col{property, type, description}
1254 @row3col{buttonsize, @ref overview_xrcformat_type_size,
1255 Size of the dropdown button (default: default).}
1259 @subsubsection xrc_wxpanel wxPanel
1261 No additional properties.
1263 wxPanel may have optional children: either exactly one
1264 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
1268 @subsubsection xrc_wxpropertysheetdialog wxPropertySheetDialog
1271 @hdr3col{property, type, description}
1272 @row3col{title, @ref overview_xrcformat_type_text,
1273 Dialog's title (default: empty).}
1274 @row3col{icon, @ref overview_xrcformat_type_bitmap,
1275 Dialog's icon (default: not used).}
1276 @row3col{centered, @ref overview_xrcformat_type_bool,
1277 Whether the dialog should be centered on the screen (default: 0).}
1278 @row3col{buttons, @ref overview_xrcformat_type_style,
1279 Buttons to show, combination of flags accepted by
1280 wxPropertySheetDialog::CreateButtons() (default: 0).}
1283 A sheet dialog can have one or more child objects of the @c propertysheetpage
1284 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
1285 @c notebookpage). @c propertysheetpage objects have the following properties:
1288 @hdr3col{property, type, description}
1289 @row3col{label, @ref overview_xrcformat_type_text,
1290 Sheet page's title (required).}
1291 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1292 Bitmap shown alongside the label (default: none).}
1293 @row3col{selected, @ref overview_xrcformat_type_bool,
1294 Is the page selected initially (only one page can be selected; default: 0)?}
1297 Each @c propertysheetpage has exactly one non-toplevel window as its child.
1300 @subsubsection xrc_wxradiobutton wxRadioButton
1303 @hdr3col{property, type, description}
1304 @row3col{label, @ref overview_xrcformat_type_text,
1305 Label shown on the radio button (required).}
1306 @row3col{value, @ref overview_xrcformat_type_bool,
1307 Initial value of the control (default: 0).}
1311 @subsubsection xrc_wxradiobox wxRadioBox
1314 @hdr3col{property, type, description}
1315 @row3col{label, @ref overview_xrcformat_type_text,
1316 Label for the whole box (required).}
1317 @row3col{dimension, integer,
1318 Specifies the maximum number of rows (if style contains
1319 @c wxRA_SPECIFY_ROWS) or columns (if style contains @c wxRA_SPECIFY_COLS)
1320 for a two-dimensional radiobox (default: 1).}
1321 @row3col{selection, integer,
1322 Index of the initially selected item or -1 for no selection (default: -1).}
1323 @row3col{content, items,
1324 Content of the control; this property has any number of @c \<item\> XML
1325 elements as its children, with the items text as their text values
1326 (see below; default: empty).}
1329 The @c \<item\> elements have radio buttons' labels as their text values. They
1330 can also have some optional XML @em attributes (not properties!):
1333 @hdr3col{attribute, type, description}
1334 @row3col{tooltip, @ref overview_xrcformat_type_string,
1335 Tooltip to show over this ratio button (default: none).}
1336 @row3col{helptext, @ref overview_xrcformat_type_string,
1337 Contextual help for this radio button (default: none).}
1338 @row3col{enabled, @ref overview_xrcformat_type_bool,
1339 Is the button enabled (default: 1)?}
1340 @row3col{hidden, @ref overview_xrcformat_type_bool,
1341 Is the button hidden initially (default: 0)?}
1346 <object class="wxRadioBox" name="controls_radiobox">
1347 <style>wxRA_SPECIFY_COLS</style>
1348 <label>Radio stations</label>
1349 <dimension>1</dimension>
1350 <selection>0</selection>
1352 <item tooltip="Powerful radio station" helptext="This station is for amateurs of hard rock and heavy metal">Power 108</item>
1353 <item tooltip="Disabled radio station" enabled="0">Power 0</item>
1354 <item tooltip="">WMMS 100.7</item>
1355 <item tooltip="E=mc^2">Energy 98.3</item>
1356 <item helptext="Favourite chukcha's radio">CHUM FM</item>
1358 <item hidden="1">Very quit station</item>
1364 @subsubsection xrc_wxrichtextctrl wxRichTextCtrl
1367 @hdr3col{property, type, description}
1368 @row3col{value, @ref overview_xrcformat_type_text,
1369 Initial value of the control (default: empty).}
1370 @row3col{maxlength, integer,
1371 Maximum length of the text entered (default: unlimited).}
1375 @subsubsection xrc_wxscrollbar wxScrollBar
1378 @hdr3col{property, type, description}
1379 @row3col{value, integer,
1380 Initial position of the scrollbar (default: 0).}
1381 @row3col{range, integer,
1382 Maximum value of the gauge (default: 10).}
1383 @row3col{thumbsize, integer,
1384 Size of the thumb (default: 1).}
1385 @row3col{pagesize, integer,
1386 Page size (default: 1).}
1389 @subsubsection xrc_wxscrolledwindow wxScrolledWindow
1392 @hdr3col{property, type, description}
1393 @row3col{scrollrate, @ref overview_xrcformat_type_size,
1394 Scroll rate in @em x and @em y directions (default: not set;
1395 required if the window has a sizer child).}
1398 wxScrolledWindow may have optional children: either exactly one
1399 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
1400 objects. If sizer child is used, wxSizer::FitInside() is used (instead of
1401 wxSizer::Fit() as usual) and so the children don't determine scrolled window's
1402 minimal size, they only affect @em virtual size. Usually, both @c scrollrate
1403 and either @c size or @c minsize on containing sizer item should be used
1407 @subsubsection xrc_wxsimplehtmllistbox wxSimpleHtmlListBox
1409 wxSimpleHtmlListBox has same properties as @ref xrc_wxlistbox "wxListBox".
1410 The only difference is that the text contained in @c \<item\> elements is
1411 HTML markup. Note that the markup has to be escaped:
1414 <object class="wxSimpleHtmlListBox">
1416 <item><b>Bold</b> Milk</item>
1421 (X)HTML markup elements cannot be included directly:
1424 <object class="wxSimpleHtmlListBox">
1426 <!-- This is incorrect, doesn't work! -->
1427 <item><b>Bold</b> Milk</item>
1433 @subsubsection xrc_wxslider wxSlider
1436 @hdr3col{property, type, description}
1437 @row3col{value, integer,
1438 Initial value of the control (default: 0).}
1439 @row3col{min, integer,
1440 Minimum allowed value (default: 0).}
1441 @row3col{max, integer,
1442 Maximum allowed value (default: 100).}
1443 @row3col{pagesize, integer,
1444 Line size; number of steps the slider moves when the user moves
1445 pages up or down (default: unset).}
1446 @row3col{linesize, integer,
1447 Line size; number of steps the slider moves when the user moves it
1448 up or down a line (default: unset).}
1449 @row3col{tickfreq, integer,
1450 Tick marks frequency (Windows only; default: unset).}
1451 @row3col{tick, integer,
1452 Tick position (Windows only; default: unset).}
1453 @row3col{thumb, integer,
1454 Thumb length (Windows only; default: unset).}
1455 @row3col{selmin, integer,
1456 Selection start position (Windows only; default: unset).}
1457 @row3col{selmax, integer,
1458 Selection end position (Windows only; default: unset).}
1462 @subsubsection xrc_wxspinbutton wxSpinButton
1465 @hdr3col{property, type, description}
1466 @row3col{value, integer,
1467 Initial value of the control (default: 0).}
1468 @row3col{min, integer,
1469 Minimum allowed value (default: 0).}
1470 @row3col{max, integer,
1471 Maximum allowed value (default: 100).}
1475 @subsubsection xrc_wxspinctrl wxSpinCtrl
1477 wxSpinCtrl supports the properties as @ref xrc_wxspinbutton.
1480 @subsubsection xrc_wxsplitterwindow wxSplitterWindow
1483 @hdr3col{property, type, description}
1484 @row3col{orientation, @ref overview_xrcformat_type_string,
1485 Orientation of the splitter, either "vertical" or "horizontal" (default: horizontal).}
1486 @row3col{sashpos, integer,
1487 Initial position of the sash (default: 0).}
1488 @row3col{minsize, integer,
1489 Minimum child size (default: not set).}
1490 @row3col{gravity, @ref overview_xrcformat_type_float,
1491 Sash gravity, see wxSplitterWindow::SetSashGravity() (default: not set).}
1494 wxSplitterWindow must have one or two children that are non-toplevel window
1495 objects. If there's only one child, it is used as wxSplitterWindow's only
1496 visible child. If there are two children, the first one is used for left/top
1497 child and the second one for right/bottom child window.
1500 @subsubsection xrc_wxsearchctrl wxSearchCtrl
1503 @hdr3col{property, type, description}
1504 @row3col{value, @ref overview_xrcformat_type_text,
1505 Initial value of the control (default: empty).}
1509 @subsubsection xrc_wxstatusbar wxStatusBar
1512 @hdr3col{property, type, description}
1513 @row3col{fields, integer,
1514 Number of status bar fields (default: 1).}
1515 @row3col{widths, @ref overview_xrcformat_type_string,
1516 Comma-separated list of @em fields integers. Each value specifies width
1517 of one field; the values are interpreted using the same convention used
1518 by wxStatusBar::SetStatusWidths().}
1519 @row3col{styles, @ref overview_xrcformat_type_string,
1520 Comma-separated list of @em fields flags. Each value specifies status bar
1521 fieldd style and can be one of @c wxSB_NORMAL, @c wxSB_FLAT or
1522 @c wxSB_RAISED. See wxStatusBar::SetStatusStyles() for their description.}
1527 @subsubsection xrc_wxstaticbitmap wxStaticBitmap
1530 @hdr3col{property, type, description}
1531 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1532 Bitmap to display (required).}
1535 @subsubsection xrc_wxstaticbox wxStaticBox
1538 @hdr3col{property, type, description}
1539 @row3col{label, @ref overview_xrcformat_type_text,
1540 Static box's label (required).}
1544 @subsubsection xrc_wxstaticline wxStaticLine
1546 No additional properties.
1549 @subsubsection xrc_wxstatictext wxStaticText
1552 @hdr3col{property, type, description}
1553 @row3col{label, @ref overview_xrcformat_type_text,
1554 Label to display (required).}
1555 @row3col{wrap, integer,
1556 Wrap the text so that each line is at most the given number of pixels, see
1557 wxStaticText::Wrap() (default: no wrap).}
1560 @subsubsection xrc_wxtextctrl wxTextCtrl
1563 @hdr3col{property, type, description}
1564 @row3col{value, @ref overview_xrcformat_type_text,
1565 Initial value of the control (default: empty).}
1566 @row3col{maxlength, integer,
1567 Maximum length of the text which can be entered by user (default: unlimited).}
1571 @subsubsection xrc_wxtogglebuttton wxToggleButton
1574 @hdr3col{property, type, description}
1575 @row3col{label, @ref overview_xrcformat_type_text,
1576 Label to display on the button (required).}
1577 @row3col{checked, @ref overview_xrcformat_type_bool,
1578 Should the button be checked/pressed initially (default: 0)?}
1581 @subsubsection xrc_wxtoolbar wxToolBar
1584 @hdr3col{property, type, description}
1585 @row3col{bitmapsize, @ref overview_xrcformat_type_size,
1586 Size of toolbar bitmaps (default: not set).}
1587 @row3col{margins, @ref overview_xrcformat_type_size,
1588 Margins (default: platform default).}
1589 @row3col{packing, integer,
1590 Packing, see wxToolBar::SetToolPacking() (default: not set).}
1591 @row3col{separation, integer,
1592 Default separator size, see wxToolBar::SetToolSeparation() (default: not set).}
1593 @row3col{dontattachtoframe, @ref overview_xrcformat_type_bool,
1594 If set to 0 and the toolbar object is child of a wxFrame,
1595 wxFrame::SetToolBar() is called; otherwise, you have to add it to a frame
1596 manually. The toolbar is attached by default, you have to set this property
1597 to 1 to disable this behaviour (default: 0).}
1600 A toolbar can have one or more child objects of any wxControl-derived class or
1601 one of two pseudo-classes: @c separator or @c tool.
1603 The @c separator pseudo-class is used to insert separators into the toolbar and
1604 has neither properties nor children. Similarly, the @c space pseudo-class is
1605 used for stretchable spaces (see wxToolBar::AddStretchableSpace(), new since
1608 The @c tool pseudo-class objects specify toolbar buttons and have the following
1612 @hdr3col{property, type, description}
1613 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1614 Tool's bitmap (required).}
1615 @row3col{bitmap2, @ref overview_xrcformat_type_bitmap,
1616 Bitmap for disabled tool (default: derived from @c bitmap).}
1617 @row3col{label, @ref overview_xrcformat_type_text,
1618 Label to display on the tool (default: no label).}
1619 @row3col{radio, @ref overview_xrcformat_type_bool,
1620 Item's kind is wxITEM_RADIO (default: 0)?}
1621 @row3col{toggle, @ref overview_xrcformat_type_bool,
1622 Item's kind is wxITEM_CHECK (default: 0)?}
1623 @row3col{dropdown, see below,
1624 Item's kind is wxITEM_DROPDOWN (default: 0)? (only available since wxWidgets 2.9.0)}
1625 @row3col{tooltip, @ref overview_xrcformat_type_text,
1626 Tooltip to use for the tool (default: none).}
1627 @row3col{longhelp, @ref overview_xrcformat_type_text,
1628 Help text shown in statusbar when the mouse is on the tool (default: none).}
1629 @row3col{disabled, @ref overview_xrcformat_type_bool,
1630 Is the tool initially disabled (default: 0)?}
1633 The presence of a @c dropdown property indicates that the tool is of type
1634 wxITEM_DROPDOWN. It must be either empty or contain exactly one @ref
1635 xrc_wxmenu child object defining the drop-down button associated menu.
1637 Notice that @c radio, @c toggle and @c dropdown are mutually exclusive.
1639 Children that are neither @c tool nor @c separator must be instances of classes
1640 derived from wxControl and are added to the toolbar using
1641 wxToolBar::AddControl().
1645 <object class="wxToolBar">
1646 <style>wxTB_FLAT|wxTB_NODIVIDER</style>
1647 <object class="tool" name="foo">
1648 <bitmap>foo.png</bitmap>
1651 <object class="tool" name="bar">
1652 <bitmap>bar.png</bitmap>
1655 <object class="separator"/>
1656 <object class="tool" name="view_auto">
1657 <bitmap>view.png</bitmap>
1660 <object class="wxMenu">
1661 <object class="wxMenuItem" name="view_as_text">
1662 <label>View as text</label>
1664 <object class="wxMenuItem" name="view_as_hex">
1665 <label>View as binary</label>
1670 <object class="space"/>
1671 <object class="wxComboBox">
1674 <item>a combobox</item>
1675 <item>in the toolbar</item>
1683 @subsubsection xrc_wxtoolbook wxToolbook
1685 A toolbook can have one or more child objects of the @c toolbookpage
1686 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
1687 @c notebookpage) and one child object of the @ref xrc_wximagelist class.
1688 @c toolbookpage objects have the following properties:
1691 @hdr3col{property, type, description}
1692 @row3col{label, @ref overview_xrcformat_type_text,
1693 Sheet page's title (required).}
1694 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1695 Bitmap shown alongside the label (default: none).}
1696 @row3col{image, integer,
1697 The zero-based index of the image associated with the item
1698 into the image list.}
1699 @row3col{selected, @ref overview_xrcformat_type_bool,
1700 Is the page selected initially (only one page can be selected; default: 0)?}
1703 Each @c toolbookpage has exactly one non-toplevel window as its child.
1706 @subsubsection xrc_wxtreectrl wxTreeCtrl
1708 A treectrl can have one child object of the @ref xrc_wximagelist class.
1710 No additional properties.
1713 @subsubsection xrc_wxtreebook wxTreebook
1715 A treebook can have one or more child objects of the @c treebookpage
1716 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
1717 @c notebookpage) and one child object of the @ref xrc_wximagelist class.
1718 @c treebookpage objects have the following properties:
1721 @hdr3col{property, type, description}
1722 @row3col{depth, integer,
1723 Page's depth in the labels tree (required; see below).}
1724 @row3col{label, @ref overview_xrcformat_type_text,
1725 Sheet page's title (required).}
1726 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1727 Bitmap shown alongside the label (default: none).}
1728 @row3col{image, integer,
1729 The zero-based index of the image associated with the item
1730 into the image list.}
1731 @row3col{selected, @ref overview_xrcformat_type_bool,
1732 Is the page selected initially (only one page can be selected; default: 0)?}
1733 @row3col{expanded, @ref overview_xrcformat_type_bool,
1734 If set to 1, the page is initially expanded. By default all pages are
1735 initially collapsed.}
1738 Each @c treebookpage has exactly one non-toplevel window as its child.
1740 The tree of labels is not described using nested @c treebookpage objects, but
1741 using the @em depth property. Toplevel pages have depth 0, their child pages
1742 have depth 1 and so on. A @c treebookpage's label is inserted as child of
1743 the latest preceding page with depth equal to @em depth-1. For example, this
1747 <object class="wxTreebook">
1749 <object class="treebookpage">
1751 <label>Page 1</label>
1752 <object class="wxPanel">...</object>
1754 <object class="treebookpage">
1756 <label>Subpage 1A</label>
1757 <object class="wxPanel">...</object>
1759 <object class="treebookpage">
1761 <label>Subsubpage 1</label>
1762 <object class="wxPanel">...</object>
1764 <object class="treebookpage">
1766 <label>Subpage 1B</label>
1767 <object class="wxPanel">...</object>
1769 <object class="treebookpage">
1771 <label>Subsubpage 2</label>
1772 <object class="wxPanel">...</object>
1774 <object class="treebookpage">
1776 <label>Page 2</label>
1777 <object class="wxPanel">...</object>
1782 corresponds to the following tree of labels:
1792 @subsubsection xrc_wxwizard wxWizard
1795 @hdr3col{property, type, description}
1796 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1797 Bitmap to display on the left side of the wizard (default: none).}
1800 A wizard object can have one or more child objects of the wxWizardPage or
1801 wxWizardPageSimple classes. They both support the following properties
1802 (in addition to @ref overview_xrcformat_std_props):
1805 @hdr3col{property, type, description}
1806 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1807 Page-specific bitmap (default: none).}
1810 wxWizardPageSimple pages are automatically chained together; wxWizardPage pages
1811 transitions must be handled programmatically.
1814 @section overview_xrcformat_sizers Sizers
1816 Sizers are handled slightly differently in XRC resources than they are in
1817 wxWindow hierarchy. wxWindow's sizers hierarchy is parallel to the wxWindow
1818 children hierarchy: child windows are children of their parent window and
1819 the sizer (or sizers) form separate hierarchy attached to the window with
1820 wxWindow::SetSizer().
1822 In XRC, the two hierarchies are merged together: sizers are children of other
1823 sizers or windows and they can contain child window objects.
1825 If a sizer is child of a window object in the resource, it must be the only
1826 child and it will be attached to the parent with wxWindow::SetSizer().
1827 Additionally, if the window doesn't have its size explicitly set,
1828 wxSizer::Fit() is used to resize the window. If the parent window is
1829 toplevel window, wxSizer::SetSizeHints() is called to set its hints.
1831 A sizer object can have one or more child objects of one of two pseudo-classes:
1832 @c sizeritem or @c spacer (see @ref overview_xrcformat_wxstddialogbuttonsizer for
1833 an exception). The former specifies an element (another sizer or a window)
1834 to include in the sizer, the latter adds empty space to the sizer.
1836 @c sizeritem objects have exactly one child object: either another sizer
1837 object, or a window object. @c spacer objects don't have any children, but
1838 they have one property:
1841 @hdr3col{property, type, description}
1842 @row3col{size, @ref overview_xrcformat_type_size, Size of the empty space (required).}
1845 Both @c sizeritem and @c spacer objects can have any of the following
1849 @hdr3col{property, type, description}
1850 @row3col{option, integer,
1851 The "option" value for sizers. Used by wxBoxSizer to set proportion of
1852 the item in the growable direction (default: 0).}
1853 @row3col{flag, @ref overview_xrcformat_type_style,
1854 wxSizerItem flags (default: 0).}
1855 @row3col{border, @ref overview_xrcformat_type_dimension,
1856 Size of the border around the item (directions are specified in flags)
1858 @row3col{minsize, @ref overview_xrcformat_type_size,
1859 Minimal size of this item (default: no min size).}
1860 @row3col{ratio, @ref overview_xrcformat_type_size,
1861 Item ratio, see wxSizer::SetRatio() (default: no ratio).}
1862 @row3col{cellpos, @ref overview_xrcformat_type_pos,
1863 (wxGridBagSizer only) Position, see wxGBSizerItem::SetPos() (required). }
1864 @row3col{cellspan, @ref overview_xrcformat_type_size,
1865 (wxGridBagSizer only) Span, see wxGBSizerItem::SetSpan() (required). }
1868 Example of sizers XRC code:
1870 <object class="wxDialog" name="derived_dialog">
1871 <title>Derived Dialog Example</title>
1872 <centered>1</centered>
1873 <!-- this sizer is set to be this dialog's sizer: -->
1874 <object class="wxFlexGridSizer">
1879 <growablecols>0</growablecols>
1880 <growablerows>0</growablerows>
1881 <object class="sizeritem">
1882 <flag>wxALIGN_CENTRE|wxALL</flag>
1884 <object class="wxButton" name="my_button">
1885 <label>My Button</label>
1888 <object class="sizeritem">
1889 <flag>wxALIGN_CENTRE|wxALL</flag>
1891 <object class="wxBoxSizer">
1892 <orient>wxHORIZONTAL</orient>
1893 <object class="sizeritem">
1894 <flag>wxALIGN_CENTRE|wxALL</flag>
1896 <object class="wxCheckBox" name="my_checkbox">
1897 <label>Enable this text control:</label>
1900 <object class="sizeritem">
1901 <flag>wxALIGN_CENTRE|wxALL</flag>
1903 <object class="wxTextCtrl" name="my_textctrl">
1915 The sizer classes that can be used are listed below, together with their
1916 class-specific properties. All classes support the following properties:
1919 @hdr3col{property, type, description}
1920 @row3col{minsize, @ref overview_xrcformat_type_size,
1921 Minimal size that this sizer will have, see wxSizer::SetMinSize()
1922 (default: no min size).}
1925 @subsection overview_xrcformat_wxboxsizer wxBoxSizer
1928 @hdr3col{property, type, description}
1929 @row3col{orient, @ref overview_xrcformat_type_style,
1930 Sizer orientation, "wxHORIZONTAL" or "wxVERTICAL" (default: wxHORIZONTAL).}
1933 @subsection overview_xrcformat_wxstaticsboxizer wxStaticBoxSizer
1936 @hdr3col{property, type, description}
1937 @row3col{orient, @ref overview_xrcformat_type_style,
1938 Sizer orientation, "wxHORIZONTAL" or "wxVERTICAL" (default: wxHORIZONTAL).}
1939 @row3col{label, @ref overview_xrcformat_type_text,
1940 Label to be used for the static box around the sizer (required).}
1943 @subsection overview_xrcformat_wxgridsizer wxGridSizer
1946 @hdr3col{property, type, description}
1947 @row3col{rows, integer, Number of rows in the grid (default: 0 - determine automatically).}
1948 @row3col{cols, integer, Number of columns in the grid (default: 0 - determine automatically).}
1949 @row3col{vgap, integer, Vertical gap between children (default: 0).}
1950 @row3col{hgap, integer, Horizontal gap between children (default: 0).}
1953 @subsection overview_xrcformat_wxflexgridsizer wxFlexGridSizer
1956 @hdr3col{property, type, description}
1957 @row3col{rows, integer, Number of rows in the grid (default: 0 - determine automatically).}
1958 @row3col{cols, integer, Number of columns in the grid (default: 0 - determine automatically).}
1959 @row3col{vgap, integer, Vertical gap between children (default: 0).}
1960 @row3col{hgap, integer, Horizontal gap between children (default: 0).}
1961 @row3col{growablerows, comma-separated integers list,
1962 Comma-separated list of indexes of rows that are growable
1964 @row3col{growablecols, comma-separated integers list,
1965 Comma-separated list of indexes of columns that are growable
1969 @subsection overview_xrcformat_wxgridbagsizer wxGridBagSizer
1972 @hdr3col{property, type, description}
1973 @row3col{vgap, integer, Vertical gap between children (default: 0).}
1974 @row3col{hgap, integer, Horizontal gap between children (default: 0).}
1975 @row3col{growablerows, comma-separated integers list,
1976 Comma-separated list of indexes of rows that are growable
1978 @row3col{growablecols, comma-separated integers list,
1979 Comma-separated list of indexes of columns that are growable
1983 @subsection overview_xrcformat_wxwrapsizer wxWrapSizer
1986 @hdr3col{property, type, description}
1987 @row3col{orient, @ref overview_xrcformat_type_style,
1988 Sizer orientation, "wxHORIZONTAL" or "wxVERTICAL" (required).}
1989 @row3col{flag, @ref overview_xrcformat_type_style, wxWrapSizer flags (default: 0).}
1992 @subsection overview_xrcformat_wxstddialogbuttonsizer wxStdDialogButtonSizer
1994 Unlike other sizers, wxStdDialogButtonSizer has neither @c sizeritem
1995 nor @c spacer children. Instead, it has one or more children of the
1996 @c button pseudo-class. @c button objects have no properties and they must
1997 always have exactly one child of the @c wxButton class or a class derived from
2002 <object class="wxStdDialogButtonSizer">
2003 <object class="button">
2004 <object class="wxButton" name="wxID_OK">
2008 <object class="button">
2009 <object class="wxButton" name="wxID_CANCEL">
2010 <label>Cancel</label>
2018 @section overview_xrcformat_other_objects Other Objects
2020 In addition to describing UI elements, XRC files can contain non-windows
2021 objects such as bitmaps or icons. This is a concession to Windows developers
2022 used to storing them in Win32 resources.
2024 Note that unlike Win32 resources, bitmaps included in XRC files are @em not
2025 embedded in the XRC file itself. XRC file only contains a reference to another
2026 file with bitmap data.
2028 @subsection overview_xrcformat_bitmap wxBitmap
2030 Bitmaps are stored in @c \<object\> element with class set to @c wxBitmap. Such
2031 bitmaps can then be loaded using wxXmlResource::LoadBitmap(). The content of
2032 the element is exactly same as in the case of
2033 @ref overview_xrcformat_type_bitmap "bitmap properties", except that toplevel
2034 @c \<object\> is used.
2036 For example, instead of:
2038 <bitmap>mybmp.png</bitmap>
2039 <bitmap stock_id="wxART_NEW"/>
2041 toplevel wxBitmap resources would look like:
2043 <object class="wxBitmap" name="my_bitmap">mybmp.png</object>
2044 <object class="wxBitmap" name="my_new_bitmap" stock_id="wxART_NEW"/>
2048 @subsection overview_xrcformat_icon wxIcon
2050 wxIcon resources are identical to @ref overview_xrcformat_bitmap "wxBitmap ones",
2051 except that the class is @c wxIcon.
2054 @section overview_xrcformat_platform Platform Specific Content
2056 It is possible to conditionally process parts of XRC files on some platforms
2057 only and ignore them on other platforms. @em Any element in XRC file, be it
2058 toplevel or arbitrarily nested one, can have the @c platform attribute. When
2059 used, @c platform contains |-separated list of platforms that this element
2060 should be processed on. It is filtered out and ignored on any other platforms.
2062 Possible elemental values are:
2064 @itemdef{ @c win, Windows }
2065 @itemdef{ @c mac, Mac OS X (or Mac Classic in wxWidgets version supporting it) }
2066 @itemdef{ @c unix, Any Unix platform @em except OS X }
2067 @itemdef{ @c os2, OS/2 }
2072 <label platform="win">Windows</label>
2073 <label platform="unix">Unix</label>
2074 <label platform="mac">Mac OS X</label>
2075 <help platform="mac|unix">Not a Windows machine</help>
2080 @section overview_xrcformat_idranges ID Ranges
2082 Usually you won't care what value the XRCID macro returns for the ID of an
2083 object. Sometimes though it is convenient to have a range of IDs that are
2084 guaranteed to be consecutive. An example of this would be connecting a group of
2085 similar controls to the same event handler.
2087 The following XRC fragment 'declares' an ID range called @em foo and another
2088 called @em bar; each with some items.
2091 <object class="wxButton" name="foo[start]">
2092 <object class="wxButton" name="foo[end]">
2093 <object class="wxButton" name="foo[2]">
2095 <object class="wxButton" name="bar[0]">
2096 <object class="wxButton" name="bar[2]">
2097 <object class="wxButton" name="bar[1]">
2099 <ids-range name="foo" />
2100 <ids-range name="bar" size="30" start="10000" />
2103 For the range foo, no @em size or @em start parameters were given, so the size
2104 will be calculated from the number of range items, and IDs allocated by
2105 wxWindow::NewControlId (so they'll be negative). Range bar asked for a size of
2106 30, so this will be its minimum size: should it have more items, the range will
2107 automatically expand to fit them. It specified a start ID of 10000, so
2108 XRCID("bar[0]") will be 10000, XRCID("bar[1]") 10001 etc. Note that if you
2109 choose to supply a start value it must be positive, and it's your
2110 responsibility to avoid clashes.
2112 For every ID range, the first item can be referenced either as
2113 <em>rangename</em>[0] or <em>rangename</em>[start]. Similarly
2114 <em>rangename</em>[end] is the last item. Using [start] and [end] is more
2115 descriptive in e.g. a Bind() event range or a @em for loop, and they don't have
2116 to be altered whenever the number of items changes.
2118 Whether a range has positive or negative IDs, [start] is always a smaller
2119 number than [end]; so code like this works as expected:
2122 for (int n=XRCID("foo[start]"); n < XRCID("foo[end]"); ++n)
2126 ID ranges can be seen in action in the <em>objref</em> dialog section of the
2130 @li All the items in an ID range must be contained in the same XRC file.
2131 @li You can't use an ID range in a situation where static initialisation
2132 occurs; in particular, they won't work as expected in an event table. This is
2133 because the event table's IDs are set to their integer values before the XRC
2134 file is loaded, and aren't subsequently altered when the XRCID value changes.
2138 @section overview_xrcformat_extending Extending the XRC Format
2140 The XRC format is designed to be extensible and allows specifying and loading
2141 custom controls. The three available mechanisms are described in the rest of
2142 this section in the order of increasing complexity.
2144 @subsection overview_xrcformat_extending_subclass Subclassing
2146 The simplest way to add custom controls is to set the @c subclass attribute
2147 of @c \<object\> element:
2150 <object name="my_value" class="wxTextCtrl" subclass="MyTextCtrl">
2151 <style>wxTE_MULTILINE</style>
2152 ...etc., setup wxTextCtrl as usual...
2156 In that case, wxXmlResource will create an instance of the specified subclass
2157 (@c MyTextCtrl in the example above) instead of the class (@c wxTextCtrl above)
2158 when loading the resource. However, the rest of the object's loading (calling
2159 its Create() method, setting its properties, loading any children etc.)
2160 will proceed in @em exactly the same way as it would without @c subclass
2161 attribute. In other words, this approach is only sufficient when the custom
2162 class is just a small modification (e.g. overridden methods or customized
2163 events handling) of an already supported classes.
2165 The subclass must satisfy a number of requirements:
2167 -# It must be derived from the class specified in @c class attribute.
2168 -# It must be visible in wxWidget's pseudo-RTTI mechanism, i.e. there must be
2169 a DECLARE_DYNAMIC_CLASS() entry for it.
2170 -# It must support two-phase creation. In particular, this means that it has
2171 to have default constructor.
2172 -# It cannot provide custom Create() method and must be constructible using
2173 base @c class' Create() method (this is because XRC will call Create() of
2174 @c class, not @c subclass). In other words, @em creation of the control
2175 must not be customized.
2178 @subsection overview_xrcformat_extending_unknown Unknown Objects
2180 A more flexible solution is to put a @em placeholder in the XRC file and
2181 replace it with custom control after the resource is loaded. This is done by
2182 using the @c unknown pseudo-class:
2185 <object class="unknown" name="my_placeholder"/>
2188 The placeholder is inserted as dummy wxPanel that will hold custom control in
2189 it. At runtime, after the resource is loaded and a window created from it
2190 (using e.g. wxXmlResource::LoadDialog()), use code must call
2191 wxXmlResource::AttachUnknownControl() to insert the desired control into
2192 placeholder container.
2194 This method makes it possible to insert controls that are not known to XRC at
2195 all, but it's also impossible to configure the control in XRC description in
2196 any way. The only properties that can be specified are
2197 the @ref overview_xrcformat_std_props "standard window properties".
2199 @note @c unknown class cannot be combined with @c subclass attribute,
2200 they are mutually exclusive.
2203 @subsection overview_xrcformat_extending_custom Adding Custom Classes
2205 Finally, XRC allows adding completely new classes in addition to the ones
2206 listed in this document. A class for which wxXmlResourceHandler is implemented
2207 can be used as first-class object in XRC simply by passing class name as the
2208 value of @c class attribute:
2211 <object name="my_ctrl" class="MyWidget">
2212 <my_prop>foo</my_prop>
2213 ...etc., whatever MyWidget handler accepts...
2217 The only requirements on the class are that
2218 -# the class must derive from wxObject
2219 -# it must support wxWidget's pseudo-RTTI mechanism
2221 Child elements of @c \<object\> are handled by the custom handler and there are
2222 no limitations on them imposed by XRC format.
2224 This is the only mechanism that works for toplevel objects -- custom controls
2225 are accessible using the type-unsafe wxXmlResource::LoadObject() method.
2229 @section overview_xrcformat_packed Packed XRC Files
2231 In addition to plain XRC files, wxXmlResource supports (if wxFileSystem support
2232 is compiled in) compressed XRC resources. Compressed resources have either
2233 .zip or .xrs extension and are simply ZIP files that contain arbitrary
2234 number of XRC files and their dependencies (bitmaps, icons etc.).
2238 @section overview_xrcformat_oldversions Older Format Versions
2240 This section describes differences in older revisions of XRC format (i.e.
2241 files with older values of @c version attribute of @c \<resource\>).
2244 @subsection overview_xrcformat_pre_v2530 Versions Before 2.5.3.0
2246 Version 2.5.3.0 introduced C-like handling of "\\" in text. In older versions,
2247 "\n", "\t" and "\r" escape sequences were replaced with respective characters
2248 in the same matter it's done in C, but "\\" was left intact instead of being
2249 replaced with single "\", as one would expect. Starting with 2.5.3.0, all of
2250 them are handled in C-like manner.
2253 @subsection overview_xrcformat_pre_v2301 Versions Before 2.3.0.1
2255 Prior to version 2.3.0.1, "$" was used for accelerators instead of "_"
2256 or "&". For example,
2258 <label>$File</label>
2260 was used in place of current version's
2262 <label>_File</label>