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