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