Add XRC handler for wxCommandLinkButton.
[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 licence
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 (may be empty if only bitmap is used).}
594 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
595 Bitmap to display in the button (optional).}
596 @row3col{bitmapposition, @c wxLEFT|wxRIGHT|wxTOP|wxBOTTOM,
597 Position of the bitmap in the button, see wxButton::SetBitmapPosition().}
598 @row3col{default, @ref overview_xrcformat_type_bool,
599 Should this button be the default button in dialog (default: 0)?}
600 @endTable
601
602
603 @subsubsection xrc_wxcalendarctrl wxCalendarCtrl
604
605 No additional properties.
606
607
608 @subsubsection xrc_wxcheckbox wxCheckBox
609
610 @beginTable
611 @hdr3col{property, type, description}
612 @row3col{label, @ref overview_xrcformat_type_text,
613 Label to use for the checkbox (required).}
614 @row3col{checked, @ref overview_xrcformat_type_bool,
615 Should the checkbox be checked initially (default: 0)?}
616 @endTable
617
618
619 @subsubsection xrc_wxchecklistbox wxCheckListBox
620
621 @beginTable
622 @hdr3col{property, type, description}
623 @row3col{content, items,
624 Content of the control; this property has any number of @c \<item\> XML
625 elements as its children, with the items text as their text values
626 (default: empty).}
627 @endTable
628
629 The @c \<item\> elements have listbox items' labels as their text values. They
630 can also have optional @c checked XML attribute -- if set to "1", the value is
631 initially checked.
632
633 Example:
634 @code
635 <object class="wxCheckListBox">
636 <content>
637 <item checked="1">Download library</item>
638 <item checked="1">Compile samples</item>
639 <item checked="1">Skim docs</item>
640 <item checked="1">Finish project</item>
641 <item>Wash car</item>
642 </content>
643 </object>
644 @endcode
645
646
647 @subsubsection xrc_wxchoice wxChoice
648
649 @beginTable
650 @hdr3col{property, type, description}
651 @row3col{selection, integer,
652 Index of the initially selected item or -1 for no selection (default: -1).}
653 @row3col{content, items,
654 Content of the control; this property has any number of @c \<item\> XML
655 elements as its children, with the items text as their text values
656 (default: empty).}
657 @endTable
658
659 Example:
660 @code
661 <object class="wxChoice" name="controls_choice">
662 <content>
663 <item>See</item>
664 <item>Hear</item>
665 <item>Feel</item>
666 <item>Smell</item>
667 <item>Taste</item>
668 <item>The Sixth Sense!</item>
669 </content>
670 </object>
671 @endcode
672
673
674 @subsubsection xrc_wxchoicebook wxChoicebook
675
676 A choicebook can have one or more child objects of the @c choicebookpage
677 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
678 @c notebookpage) and one child object of the @ref xrc_wximagelist class.
679 @c choicebookpage objects have the following properties:
680
681 @beginTable
682 @hdr3col{property, type, description}
683 @row3col{label, @ref overview_xrcformat_type_text,
684 Sheet page's title (required).}
685 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
686 Bitmap shown alongside the label (default: none).}
687 @row3col{image, integer,
688 The zero-based index of the image associated with the item
689 into the image list.}
690 @row3col{selected, @ref overview_xrcformat_type_bool,
691 Is the page selected initially (only one page can be selected; default: 0)?}
692 @endTable
693
694 Each @c choicebookpage has exactly one non-toplevel window as its child.
695
696
697 @subsubsection xrc_wxcommandlinkbutton wxCommandLinkButton
698
699 The wxCommandLinkButton contains a main title-like @c label and an optional
700 @c note for longer description. The main @c label and the @c note can be
701 concatenated into a single string using a new line character between them
702 (notice that the @c note part can have more new lines in it).
703
704 @beginTable
705 @hdr3col{property, type, description}
706 @row3col{label, @ref overview_xrcformat_type_text,
707 First line of text on the button, typically the label of an action that
708 will be made when the button is pressed. }
709 @row3col{note, @ref overview_xrcformat_type_text,
710 Second line of text describing the action performed when the button is pressed. }
711 @endTable
712
713
714 @subsubsection xrc_wxcollapsiblepane wxCollapsiblePane
715
716 @beginTable
717 @hdr3col{property, type, description}
718 @row3col{label, @ref overview_xrcformat_type_text,
719 Label to use for the collapsible section (required).}
720 @row3col{collapsed, @ref overview_xrcformat_type_bool,
721 Should the pane be collapsed initially (default: 0)?}
722 @endTable
723
724 wxCollapsiblePane may contain single optional child object of the @c panewindow
725 pseudo-class type. @c panewindow itself must contain exactly one child that
726 is a @ref overview_xrcformat_sizers "sizer" or a non-toplevel window
727 object.
728
729
730 @subsubsection xrc_wxcolourpickerctrl wxColourPickerCtrl
731
732 @beginTable
733 @hdr3col{property, type, description}
734 @row3col{value, @ref overview_xrcformat_type_colour,
735 Initial value of the control (default: wxBLACK).}
736 @endTable
737
738
739 @subsubsection xrc_wxcombobox wxComboBox
740
741 @beginTable
742 @hdr3col{property, type, description}
743 @row3col{selection, integer,
744 Index of the initially selected item or -1 for no selection (default: not used).}
745 @row3col{content, items,
746 Content of the control; this property has any number of @c \<item\> XML
747 elements as its children, with the items text as their text values
748 (default: empty).}
749 @row3col{value, @ref overview_xrcformat_type_string,
750 Initial value in the control (doesn't have to be one of @ content values;
751 default: empty).}
752 @endTable
753
754 If both @c value and @c selection are specified and @c selection is not -1,
755 then @c selection takes precedence.
756
757 Example:
758 @code
759 <object class="wxComboBox" name="controls_combobox">
760 <style>wxCB_DROPDOWN</style>
761 <value>nedit</value>
762 <content>
763 <item>vim</item>
764 <item>emacs</item>
765 <item>notepad.exe</item>
766 <item>bbedit</item>
767 </content>
768 </object>
769 @endcode
770
771 @subsubsection xrc_wxdatepickerctrl wxDatePickerCtrl
772
773 No additional properties.
774
775
776 @subsubsection xrc_wxdialog wxDialog
777
778 @beginTable
779 @hdr3col{property, type, description}
780 @row3col{title, @ref overview_xrcformat_type_text,
781 Dialog's title (default: empty).}
782 @row3col{icon, @ref overview_xrcformat_type_bitmap,
783 Dialog's icon (default: not used).}
784 @row3col{centered, @ref overview_xrcformat_type_bool,
785 Whether the dialog should be centered on the screen (default: 0).}
786 @endTable
787
788 wxDialog may have optional children: either exactly one
789 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
790 objects. If sizer child is used, it sets
791 @ref wxSizer::SetSizeHints() "size hints" too.
792
793 @subsubsection xrc_wxdirpickerctrl wxDirPickerCtrl
794
795 @beginTable
796 @hdr3col{property, type, description}
797 @row3col{value, @ref overview_xrcformat_type_string,
798 Initial value of the control (default: empty).}
799 @row3col{message, @ref overview_xrcformat_type_text,
800 Message shown to the user in wxDirDialog shown by the control (required).}
801 @endTable
802
803
804 @subsubsection xrc_wxfilectrl wxFileCtrl
805
806 @beginTable
807 @hdr3col{property, type, description}
808 @row3col{defaultdirectory, @ref overview_xrcformat_type_string,
809 Sets the current directory displayed in the control. }
810 @row3col{defaultfilename, @ref overview_xrcformat_type_string,
811 Selects a certain file.}
812 @row3col{wildcard, @ref overview_xrcformat_type_string,
813 Sets the wildcard, which can contain multiple file types, for example:
814 "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".}
815 @endTable
816
817
818 @subsubsection xrc_wxfilepickerctrl wxFilePickerCtrl
819
820 @beginTable
821 @hdr3col{property, type, description}
822 @row3col{value, @ref overview_xrcformat_type_string,
823 Initial value of the control (default: empty).}
824 @row3col{message, @ref overview_xrcformat_type_text,
825 Message shown to the user in wxDirDialog shown by the control (required).}
826 @row3col{wildcard, @ref overview_xrcformat_type_string,
827 Sets the wildcard, which can contain multiple file types, for example:
828 "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".}
829 @endTable
830
831
832 @subsubsection xrc_wxfontpickerctrl wxFontPickerCtrl
833
834 @beginTable
835 @hdr3col{property, type, description}
836 @row3col{value, @ref overview_xrcformat_type_font,
837 Initial value of the control (default: wxNORMAL_FONT).}
838 @endTable
839
840 @subsubsection xrc_wxfrane wxFrame
841
842 @beginTable
843 @hdr3col{property, type, description}
844 @row3col{title, @ref overview_xrcformat_type_text,
845 Frame's title (default: empty).}
846 @row3col{icon, @ref overview_xrcformat_type_bitmap,
847 Frame's icon (default: not used).}
848 @row3col{centered, @ref overview_xrcformat_type_bool,
849 Whether the frame should be centered on the screen (default: 0).}
850 @endTable
851
852 wxFrame may have optional children: either exactly one
853 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
854 objects. If sizer child is used, it sets
855 @ref wxSizer::SetSizeHints() "size hints" too.
856
857
858 @subsubsection xrc_wxgauge wxGauge
859
860 @beginTable
861 @hdr3col{property, type, description}
862 @row3col{range, integer,
863 Maximum value of the gauge (default: 100).}
864 @row3col{value, integer,
865 Initial value of the control (default: 0).}
866 @row3col{shadow, @ref overview_xrcformat_type_dimension,
867 Rendered shadow size (default: none; ignored by most platforms).}
868 @row3col{bezel, @ref overview_xrcformat_type_dimension,
869 Rendered bezel size (default: none; ignored by most platforms).}
870 @endTable
871
872 @subsubsection xrc_wxgenericdirctrl wxGenericDirCtrl
873
874 @beginTable
875 @hdr3col{property, type, description}
876 @row3col{defaultfolder, @ref overview_xrcformat_type_text,
877 Initial folder (default: empty).}
878 @row3col{filter, @ref overview_xrcformat_type_text,
879 Filter string, using the same syntax as used by wxFileDialog, e.g.
880 "All files (*.*)|*.*|JPEG files (*.jpg)|*.jpg" (default: empty).}
881 @row3col{defaultfilter, integer,
882 Zero-based index of default filter (default: 0).}
883 @endTable
884
885 @subsubsection xrc_wxgrid wxGrid
886
887 No additional properties.
888
889
890 @subsubsection xrc_wxhtmlwindow wxHtmlWindow
891
892 @beginTable
893 @hdr3col{property, type, description}
894 @row3col{url, @ref overview_xrcformat_type_url,
895 Page to display in the window.}
896 @row3col{htmlcode, @ref overview_xrcformat_type_text,
897 HTML markup to display in the window.}
898 @row3col{borders, @ref overview_xrcformat_type_dimension,
899 Border around HTML content (default: 0).}
900 @endTable
901
902 At most one of @c url and @c htmlcode properties may be specified, they are
903 mutually exclusive. If neither is set, the window is initialized to show empty
904 page.
905
906
907 @subsubsection xrc_wxhyperlinkctrl wxHyperlinkCtrl
908
909 @beginTable
910 @hdr3col{property, type, description}
911 @row3col{label, @ref overview_xrcformat_type_text,
912 Label to display on the control (required).}
913 @row3col{url, @ref overview_xrcformat_type_url,
914 URL to open when the link is clicked (required).}
915 @endTable
916
917
918 @subsubsection xrc_wximagelist wxImageList
919
920 The imagelist can be used as a child object for the following classes:
921 - @ref xrc_wxchoicebook
922 - @ref xrc_wxlistbook
923 - @ref xrc_wxlistctrl
924 - @ref xrc_wxnotebook
925 - @ref xrc_wxtreebook
926 - @ref xrc_wxtreectrl
927
928 The available properties are:
929
930 @beginTable
931 @hdr3col{property, type, description}
932 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
933 Adds a new image by keeping its optional mask bitmap (see below).}
934 @row3col{mask, @ref overview_xrcformat_type_bool,
935 If masks should be created for all images (default: true).}
936 @row3col{size, @ref overview_xrcformat_type_size,
937 The size of the images in the list (default: system default icon size)).}
938 @endTable
939
940 Example:
941 @code
942 <imagelist>
943 <size>32,32</size>
944 <bitmap stock_id="wxART_QUESTION"/>
945 <bitmap stock_id="wxART_INFORMATION"/>
946 </imagelist>
947 @endcode
948
949 In the specific case of the @ref xrc_wxlistctrl, the tag can take the name
950 @c \<imagelist-small\> to define the 'small' image list, related to the flag
951 @c wxIMAGE_LIST_SMALL (see wxListCtrl documentation).
952
953
954 @subsubsection xrc_wxlistbox wxListBox
955
956 @beginTable
957 @hdr3col{property, type, description}
958 @row3col{selection, integer,
959 Index of the initially selected item or -1 for no selection (default: -1).}
960 @row3col{content, items,
961 Content of the control; this property has any number of @c \<item\> XML
962 elements as its children, with the items text as their text values
963 (default: empty).}
964 @endTable
965
966 Example:
967 @code
968 <object class="wxListBox" name="controls_listbox">
969 <size>250,160</size>
970 <style>wxLB_SINGLE</style>
971 <content>
972 <item>Milk</item>
973 <item>Pizza</item>
974 <item>Bread</item>
975 <item>Orange juice</item>
976 <item>Paper towels</item>
977 </content>
978 </object>
979 @endcode
980
981
982 @subsubsection xrc_wxlistbook wxListbook
983
984 A listbook can have one or more child objects of the @c listbookpage
985 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
986 @c notebookpage) and one child object of the @ref xrc_wximagelist class.
987 @c listbookpage objects have the following properties:
988
989 @beginTable
990 @hdr3col{property, type, description}
991 @row3col{label, @ref overview_xrcformat_type_text,
992 Sheet page's title (required).}
993 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
994 Bitmap shown alongside the label (default: none).}
995 @row3col{image, integer,
996 The zero-based index of the image associated with the item
997 into the image list.}
998 @row3col{selected, @ref overview_xrcformat_type_bool,
999 Is the page selected initially (only one page can be selected; default: 0)?}
1000 @endTable
1001
1002 Each @c listbookpage has exactly one non-toplevel window as its child.
1003
1004
1005 @subsubsection xrc_wxlistctrl wxListCtrl
1006
1007 A list control can have one or more child objects of the class @ref xrc_wxlistitem
1008 and one or more objects of the @ref xrc_wximagelist class. The latter is
1009 defined either using @c \<imagelist\> tag for the control with @c wxLC_ICON
1010 style or using @c \<imagelist-small\> tag for the control with @c
1011 wxLC_SMALL_ICON style.
1012
1013 Report mode list controls (i.e. created with @c wxLC_REPORT style) can in
1014 addition have one or more @ref xrc_wxlistcol child elements.
1015
1016 @paragraph xrc_wxlistcol listcol
1017
1018 The @c listcol class can only be used for wxListCtrl children. It can have the
1019 following properties:
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{text, @ref overview_xrcformat_type_string,
1027 The title of the column. }
1028 @row3col{width, integer,
1029 The column width. }
1030 @endTable
1031
1032 The columns are appended to the control in order of their appearance and may be
1033 referenced by 0-based index in the @c col attributes of subsequent @c listitem
1034 objects.
1035
1036 @paragraph xrc_wxlistitem listitem
1037
1038 The @c listitem is a child object for the class @ref xrc_wxlistctrl.
1039 It can have the following properties:
1040
1041 @beginTable
1042 @hdr3col{property, type, description}
1043 @row3col{align, wxListColumnFormat,
1044 The alignment for the item.
1045 Can be one of @c wxLIST_FORMAT_LEFT, @c wxLIST_FORMAT_RIGHT or
1046 @c wxLIST_FORMAT_CENTRE.}
1047 @row3col{bg, @ref overview_xrcformat_type_colour,
1048 The background color for the item.}
1049 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1050 Add a bitmap to the (normal) @ref xrc_wximagelist associated with the
1051 @ref xrc_wxlistctrl parent and associate it with this item.
1052 If the imagelist is not defined it will be created implicitly.}
1053 @row3col{bitmap-small, @ref overview_xrcformat_type_bitmap,
1054 Add a bitmap in the 'small' @ref xrc_wximagelist associated with the
1055 @ref xrc_wxlistctrl parent and associate it with this item.
1056 If the 'small' imagelist is not defined it will be created implicitly.}
1057 @row3col{col, integer,
1058 The zero-based column index.}
1059 @row3col{image, integer,
1060 The zero-based index of the image associated with the item
1061 in the (normal) image list.}
1062 @row3col{image-small, integer,
1063 The zero-based index of the image associated with the item
1064 in the 'small' image list.}
1065 @row3col{data, integer,
1066 The client data for the item.}
1067 @row3col{font, @ref overview_xrcformat_type_font,
1068 The font for the item.}
1069 @row3col{image, integer,
1070 The zero-based index of the image associated with the item
1071 into the image list.}
1072 @row3col{state, @ref overview_xrcformat_type_style,
1073 The item state. Can be any combination of the following values:
1074 - @c wxLIST_STATE_FOCUSED: The item has the focus.
1075 - @c wxLIST_STATE_SELECTED: The item is selected.}
1076 @row3col{text, @ref overview_xrcformat_type_string,
1077 The text label for the item. }
1078 @row3col{textcolour, @ref overview_xrcformat_type_colour,
1079 The text colour for the item. }
1080 @endTable
1081
1082 Notice that the item position can't be specified here, the items are appended
1083 to the list control in order of their appearance.
1084
1085
1086 @subsubsection xrc_wxmdiparentframe wxMDIParentFrame
1087
1088 wxMDIParentFrame supports the same properties that @ref xrc_wxfrane does.
1089
1090 wxMDIParentFrame may have optional children. When used, the child objects
1091 must be of wxMDIChildFrame type.
1092
1093
1094 @subsubsection xrc_wxmdichildframe wxMDIChildFrame
1095
1096 wxMDIChildFrame supports the same properties that @ref xrc_wxfrane and
1097 @ref xrc_wxmdiparentframe do.
1098
1099 wxMDIChildFrame can only be used as as immediate child of @ref
1100 xrc_wxmdiparentframe.
1101
1102 wxMDIChildFrame may have optional children: either exactly one
1103 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
1104 objects. If sizer child is used, it sets
1105 @ref wxSizer::SetSizeHints() "size hints" too.
1106
1107
1108 @subsubsection xrc_wxmenu wxMenu
1109
1110 @beginTable
1111 @hdr3col{property, type, description}
1112 @row3col{label, @ref overview_xrcformat_type_text,
1113 Menu's label (default: empty, but required for menus other
1114 than popup menus).}
1115 @row3col{help, @ref overview_xrcformat_type_text,
1116 Help shown in statusbar when the menu is selected (only for submenus
1117 of another wxMenu, default: none).}
1118 @row3col{enabled, @ref overview_xrcformat_type_bool,
1119 Is the submenu item enabled (only for submenus of another wxMenu,
1120 default: 1)?}
1121 @endTable
1122
1123 Note that unlike most controls, wxMenu does @em not have
1124 @ref overview_xrcformat_std_props.
1125
1126 A menu object can have one or more child objects of the wxMenuItem or wxMenu
1127 classes or @c break or @c separator pseudo-classes.
1128
1129 The @c separator pseudo-class is used to insert separators into the menu and
1130 has neither properties nor children. Likewise, @c break inserts a break (see
1131 wxMenu::Break()).
1132
1133 wxMenuItem objects support the following properties:
1134
1135 @beginTable
1136 @hdr3col{property, type, description}
1137 @row3col{label, @ref overview_xrcformat_type_text,
1138 Item's label (required).}
1139 @row3col{accel, @ref overview_xrcformat_type_text_notrans,
1140 Item's accelerator (default: none).}
1141 @row3col{radio, @ref overview_xrcformat_type_bool,
1142 Item's kind is wxITEM_RADIO (default: 0)?}
1143 @row3col{checkable, @ref overview_xrcformat_type_bool,
1144 Item's kind is wxITEM_CHECK (default: 0)?}
1145 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1146 Bitmap to show with the item (default: none).}
1147 @row3col{bitmap2, @ref overview_xrcformat_type_bitmap,
1148 Bitmap for the checked state (wxMSW, if checkable; default: none).}
1149 @row3col{help, @ref overview_xrcformat_type_text,
1150 Help shown in statusbar when the item is selected (default: none).}
1151 @row3col{enabled, @ref overview_xrcformat_type_bool,
1152 Is the item enabled (default: 1)?}
1153 @row3col{checked, @ref overview_xrcformat_type_bool,
1154 Is the item checked initially (default: 0)?}
1155 @endTable
1156
1157 Example:
1158 @code
1159 <object class="wxMenu" name="menu_edit">
1160 <style>wxMENU_TEAROFF</style>
1161 <label>_Edit</label>
1162 <object class="wxMenuItem" name="wxID_FIND">
1163 <label>_Find...</label>
1164 <accel>Ctrl-F</accel>
1165 </object>
1166 <object class="separator"/>
1167 <object class="wxMenuItem" name="menu_fuzzy">
1168 <label>Translation is _fuzzy</label>
1169 <checkable>1</checkable>
1170 </object>
1171 <object class="wxMenu" name="submenu">
1172 <label>A submenu</label>
1173 <object class="wxMenuItem" name="foo">...</object>
1174 ...
1175 </object>
1176 <object class="separator" platform="unix"/>
1177 <object class="wxMenuItem" name="wxID_PREFERENCES" platform="unix">
1178 <label>_Preferences</label>
1179 </object>
1180 </object>
1181 @endcode
1182
1183 @subsubsection xrc_wxmenubar wxMenuBar
1184
1185 No properties. Note that unlike most controls, wxMenuBar does @em not have
1186 @ref overview_xrcformat_std_props.
1187
1188 A menubar can have one or more child objects of the @ref xrc_wxmenu "wxMenu"
1189 class.
1190
1191
1192 @subsubsection xrc_wxnotebook wxNotebook
1193
1194 A notebook can have one or more child objects of the @c notebookpage
1195 pseudo-class and one child object of the @ref xrc_wximagelist class.
1196 @c notebookpage objects have the following properties:
1197
1198 @beginTable
1199 @hdr3col{property, type, description}
1200 @row3col{label, @ref overview_xrcformat_type_text,
1201 Page's title (required).}
1202 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1203 Bitmap shown alongside the label (default: none).}
1204 @row3col{image, integer,
1205 The zero-based index of the image associated with the item
1206 into the image list.}
1207 @row3col{selected, @ref overview_xrcformat_type_bool,
1208 Is the page selected initially (only one page can be selected; default: 0)?}
1209 @endTable
1210
1211 Each @c notebookpage has exactly one non-toplevel window as its child.
1212
1213 Example:
1214 @code
1215 <object class="wxNotebook">
1216 <style>wxBK_BOTTOM</style>
1217 <object class="notebookpage">
1218 <label>Page 1</label>
1219 <object class="wxPanel" name="page_1">
1220 ...
1221 </object>
1222 </object>
1223 <object class="notebookpage">
1224 <label>Page 2</label>
1225 <object class="wxPanel" name="page_2">
1226 ...
1227 </object>
1228 </object>
1229 </object>
1230 @endcode
1231
1232
1233 @subsubsection xrc_wxownerdrawncombobox wxOwnerDrawnComboBox
1234
1235 wxOwnerDrawnComboBox has the same properties as
1236 @ref xrc_wxcombobox "wxComboBox", plus the following additional properties:
1237
1238 @beginTable
1239 @hdr3col{property, type, description}
1240 @row3col{buttonsize, @ref overview_xrcformat_type_size,
1241 Size of the dropdown button (default: default).}
1242 @endTable
1243
1244
1245 @subsubsection xrc_wxpanel wxPanel
1246
1247 No additional properties.
1248
1249 wxPanel may have optional children: either exactly one
1250 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
1251 objects.
1252
1253
1254 @subsubsection xrc_wxpropertysheetdialog wxPropertySheetDialog
1255
1256 @beginTable
1257 @hdr3col{property, type, description}
1258 @row3col{title, @ref overview_xrcformat_type_text,
1259 Dialog's title (default: empty).}
1260 @row3col{icon, @ref overview_xrcformat_type_bitmap,
1261 Dialog's icon (default: not used).}
1262 @row3col{centered, @ref overview_xrcformat_type_bool,
1263 Whether the dialog should be centered on the screen (default: 0).}
1264 @row3col{buttons, @ref overview_xrcformat_type_style,
1265 Buttons to show, combination of flags accepted by
1266 wxPropertySheetDialog::CreateButtons() (default: 0).}
1267 @endTable
1268
1269 A sheet dialog can have one or more child objects of the @c propertysheetpage
1270 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
1271 @c notebookpage). @c propertysheetpage objects have the following properties:
1272
1273 @beginTable
1274 @hdr3col{property, type, description}
1275 @row3col{label, @ref overview_xrcformat_type_text,
1276 Sheet page's title (required).}
1277 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1278 Bitmap shown alongside the label (default: none).}
1279 @row3col{selected, @ref overview_xrcformat_type_bool,
1280 Is the page selected initially (only one page can be selected; default: 0)?}
1281 @endTable
1282
1283 Each @c propertysheetpage has exactly one non-toplevel window as its child.
1284
1285
1286 @subsubsection xrc_wxradiobutton wxRadioButton
1287
1288 @beginTable
1289 @hdr3col{property, type, description}
1290 @row3col{label, @ref overview_xrcformat_type_text,
1291 Label shown on the radio button (required).}
1292 @row3col{value, @ref overview_xrcformat_type_bool,
1293 Initial value of the control (default: 0).}
1294 @endTable
1295
1296
1297 @subsubsection xrc_wxradiobox wxRadioBox
1298
1299 @beginTable
1300 @hdr3col{property, type, description}
1301 @row3col{label, @ref overview_xrcformat_type_text,
1302 Label for the whole box (required).}
1303 @row3col{dimension, integer,
1304 Specifies the maximum number of rows (if style contains
1305 @c wxRA_SPECIFY_ROWS) or columns (if style contains @c wxRA_SPECIFY_COLS)
1306 for a two-dimensional radiobox (default: 1).}
1307 @row3col{selection, integer,
1308 Index of the initially selected item or -1 for no selection (default: -1).}
1309 @row3col{content, items,
1310 Content of the control; this property has any number of @c \<item\> XML
1311 elements as its children, with the items text as their text values
1312 (see below; default: empty).}
1313 @endTable
1314
1315 The @c \<item\> elements have radio buttons' labels as their text values. They
1316 can also have some optional XML @em attributes (not properties!):
1317
1318 @beginTable
1319 @hdr3col{attribute, type, description}
1320 @row3col{tooltip, @ref overview_xrcformat_type_string,
1321 Tooltip to show over this ratio button (default: none).}
1322 @row3col{helptext, @ref overview_xrcformat_type_string,
1323 Contextual help for this radio button (default: none).}
1324 @row3col{enabled, @ref overview_xrcformat_type_bool,
1325 Is the button enabled (default: 1)?}
1326 @row3col{hidden, @ref overview_xrcformat_type_bool,
1327 Is the button hidden initially (default: 0)?}
1328 @endTable
1329
1330 Example:
1331 @code
1332 <object class="wxRadioBox" name="controls_radiobox">
1333 <style>wxRA_SPECIFY_COLS</style>
1334 <label>Radio stations</label>
1335 <dimension>1</dimension>
1336 <selection>0</selection>
1337 <content>
1338 <item tooltip="Powerful radio station" helptext="This station is for amateurs of hard rock and heavy metal">Power 108</item>
1339 <item tooltip="Disabled radio station" enabled="0">Power 0</item>
1340 <item tooltip="">WMMS 100.7</item>
1341 <item tooltip="E=mc^2">Energy 98.3</item>
1342 <item helptext="Favourite chukcha's radio">CHUM FM</item>
1343 <item>92FM</item>
1344 <item hidden="1">Very quit station</item>
1345 </content>
1346 </object>
1347 @endcode
1348
1349
1350 @subsubsection xrc_wxrichtextctrl wxRichTextCtrl
1351
1352 @beginTable
1353 @hdr3col{property, type, description}
1354 @row3col{value, @ref overview_xrcformat_type_text,
1355 Initial value of the control (default: empty).}
1356 @row3col{maxlength, integer,
1357 Maximum length of the text entered (default: unlimited).}
1358 @endTable
1359
1360
1361 @subsubsection xrc_wxscrollbar wxScrollBar
1362
1363 @beginTable
1364 @hdr3col{property, type, description}
1365 @row3col{value, integer,
1366 Initial position of the scrollbar (default: 0).}
1367 @row3col{range, integer,
1368 Maximum value of the gauge (default: 10).}
1369 @row3col{thumbsize, integer,
1370 Size of the thumb (default: 1).}
1371 @row3col{pagesize, integer,
1372 Page size (default: 1).}
1373 @endTable
1374
1375 @subsubsection xrc_wxscrolledwindow wxScrolledWindow
1376
1377 @beginTable
1378 @hdr3col{property, type, description}
1379 @row3col{scrollrate, @ref overview_xrcformat_type_size,
1380 Scroll rate in @em x and @em y directions (default: not set;
1381 required if the window has a sizer child).}
1382 @endTable
1383
1384 wxScrolledWindow may have optional children: either exactly one
1385 @ref overview_xrcformat_sizers "sizer" child or any number of non-toplevel window
1386 objects. If sizer child is used, wxSizer::FitInside() is used (instead of
1387 wxSizer::Fit() as usual) and so the children don't determine scrolled window's
1388 minimal size, they only affect @em virtual size. Usually, both @c scrollrate
1389 and either @c size or @c minsize on containing sizer item should be used
1390 in this case.
1391
1392
1393 @subsubsection xrc_wxsimplehtmllistbox wxSimpleHtmlListBox
1394
1395 wxSimpleHtmlListBox has same properties as @ref xrc_wxlistbox "wxListBox".
1396 The only difference is that the text contained in @c \<item\> elements is
1397 HTML markup. Note that the markup has to be escaped:
1398
1399 @code
1400 <object class="wxSimpleHtmlListBox">
1401 <content>
1402 <item>&lt;b&gt;Bold&lt;/b&gt; Milk</item>
1403 </content>
1404 </object>
1405 @endcode
1406
1407 (X)HTML markup elements cannot be included directly:
1408
1409 @code
1410 <object class="wxSimpleHtmlListBox">
1411 <content>
1412 <!-- This is incorrect, doesn't work! -->
1413 <item><b>Bold</b> Milk</item>
1414 </content>
1415 </object>
1416 @endcode
1417
1418
1419 @subsubsection xrc_wxslider wxSlider
1420
1421 @beginTable
1422 @hdr3col{property, type, description}
1423 @row3col{value, integer,
1424 Initial value of the control (default: 0).}
1425 @row3col{min, integer,
1426 Minimum allowed value (default: 0).}
1427 @row3col{max, integer,
1428 Maximum allowed value (default: 100).}
1429 @row3col{pagesize, integer,
1430 Line size; number of steps the slider moves when the user moves
1431 pages up or down (default: unset).}
1432 @row3col{linesize, integer,
1433 Line size; number of steps the slider moves when the user moves it
1434 up or down a line (default: unset).}
1435 @row3col{tickfreq, integer,
1436 Tick marks frequency (Windows only; default: unset).}
1437 @row3col{tick, integer,
1438 Tick position (Windows only; default: unset).}
1439 @row3col{thumb, integer,
1440 Thumb length (Windows only; default: unset).}
1441 @row3col{selmin, integer,
1442 Selection start position (Windows only; default: unset).}
1443 @row3col{selmax, integer,
1444 Selection end position (Windows only; default: unset).}
1445 @endTable
1446
1447
1448 @subsubsection xrc_wxspinbutton wxSpinButton
1449
1450 @beginTable
1451 @hdr3col{property, type, description}
1452 @row3col{value, integer,
1453 Initial value of the control (default: 0).}
1454 @row3col{min, integer,
1455 Minimum allowed value (default: 0).}
1456 @row3col{max, integer,
1457 Maximum allowed value (default: 100).}
1458 @endTable
1459
1460
1461 @subsubsection xrc_wxspinctrl wxSpinCtrl
1462
1463 wxSpinCtrl supports the properties as @ref xrc_wxspinbutton.
1464
1465
1466 @subsubsection xrc_wxsplitterwindow wxSplitterWindow
1467
1468 @beginTable
1469 @hdr3col{property, type, description}
1470 @row3col{orientation, @ref overview_xrcformat_type_string,
1471 Orientation of the splitter, either "vertical" or "horizontal" (default: horizontal).}
1472 @row3col{sashpos, integer,
1473 Initial position of the sash (default: 0).}
1474 @row3col{minsize, integer,
1475 Minimum child size (default: not set).}
1476 @row3col{gravity, @ref overview_xrcformat_type_float,
1477 Sash gravity, see wxSplitterWindow::SetSashGravity() (default: not set).}
1478 @endTable
1479
1480 wxSplitterWindow must have one or two children that are non-toplevel window
1481 objects. If there's only one child, it is used as wxSplitterWindow's only
1482 visible child. If there are two children, the first one is used for left/top
1483 child and the second one for right/bottom child window.
1484
1485
1486 @subsubsection xrc_wxsearchctrl wxSearchCtrl
1487
1488 @beginTable
1489 @hdr3col{property, type, description}
1490 @row3col{value, @ref overview_xrcformat_type_text,
1491 Initial value of the control (default: empty).}
1492 @endTable
1493
1494
1495 @subsubsection xrc_wxstatusbar wxStatusBar
1496
1497 @beginTable
1498 @hdr3col{property, type, description}
1499 @row3col{fields, integer,
1500 Number of status bar fields (default: 1).}
1501 @row3col{widths, @ref overview_xrcformat_type_string,
1502 Comma-separated list of @em fields integers. Each value specifies width
1503 of one field; the values are interpreted using the same convention used
1504 by wxStatusBar::SetStatusWidths().}
1505 @row3col{styles, @ref overview_xrcformat_type_string,
1506 Comma-separated list of @em fields flags. Each value specifies status bar
1507 fieldd style and can be one of @c wxSB_NORMAL, @c wxSB_FLAT or
1508 @c wxSB_RAISED. See wxStatusBar::SetStatusStyles() for their description.}
1509 @endTable
1510
1511
1512
1513 @subsubsection xrc_wxstaticbitmap wxStaticBitmap
1514
1515 @beginTable
1516 @hdr3col{property, type, description}
1517 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1518 Bitmap to display (required).}
1519 @endTable
1520
1521 @subsubsection xrc_wxstaticbox wxStaticBox
1522
1523 @beginTable
1524 @hdr3col{property, type, description}
1525 @row3col{label, @ref overview_xrcformat_type_text,
1526 Static box's label (required).}
1527 @endTable
1528
1529
1530 @subsubsection xrc_wxstaticline wxStaticLine
1531
1532 No additional properties.
1533
1534
1535 @subsubsection xrc_wxstatictext wxStaticText
1536
1537 @beginTable
1538 @hdr3col{property, type, description}
1539 @row3col{label, @ref overview_xrcformat_type_text,
1540 Label to display (required).}
1541 @row3col{wrap, integer,
1542 Wrap the text so that each line is at most the given number of pixels, see
1543 wxStaticText::Wrap() (default: no wrap).}
1544 @endTable
1545
1546 @subsubsection xrc_wxtextctrl wxTextCtrl
1547
1548 @beginTable
1549 @hdr3col{property, type, description}
1550 @row3col{value, @ref overview_xrcformat_type_text,
1551 Initial value of the control (default: empty).}
1552 @row3col{maxlength, integer,
1553 Maximum length of the text which can be entered by user (default: unlimited).}
1554 @endTable
1555
1556
1557 @subsubsection xrc_wxtogglebuttton wxToggleButton
1558
1559 @beginTable
1560 @hdr3col{property, type, description}
1561 @row3col{label, @ref overview_xrcformat_type_text,
1562 Label to display on the button (required).}
1563 @row3col{checked, @ref overview_xrcformat_type_bool,
1564 Should the button be checked/pressed initially (default: 0)?}
1565 @endTable
1566
1567 @subsubsection xrc_wxtoolbar wxToolBar
1568
1569 @beginTable
1570 @hdr3col{property, type, description}
1571 @row3col{bitmapsize, @ref overview_xrcformat_type_size,
1572 Size of toolbar bitmaps (default: not set).}
1573 @row3col{margins, @ref overview_xrcformat_type_size,
1574 Margins (default: platform default).}
1575 @row3col{packing, integer,
1576 Packing, see wxToolBar::SetToolPacking() (default: not set).}
1577 @row3col{separation, integer,
1578 Default separator size, see wxToolBar::SetToolSeparation() (default: not set).}
1579 @row3col{dontattachtoframe, @ref overview_xrcformat_type_bool,
1580 If set to 0 and the toolbar object is child of a wxFrame,
1581 wxFrame::SetToolBar() is called; otherwise, you have to add it to a frame
1582 manually. The toolbar is attached by default, you have to set this property
1583 to 1 to disable this behaviour (default: 0).}
1584 @endTable
1585
1586 A toolbar can have one or more child objects of any wxControl-derived class or
1587 one of two pseudo-classes: @c separator or @c tool.
1588
1589 The @c separator pseudo-class is used to insert separators into the toolbar and
1590 has neither properties nor children. Similarly, the @c space pseudo-class is
1591 used for stretchable spaces (see wxToolBar::AddStretchableSpace(), new since
1592 wxWidgets 2.9.1).
1593
1594 The @c tool pseudo-class objects specify toolbar buttons and have the following
1595 properties:
1596
1597 @beginTable
1598 @hdr3col{property, type, description}
1599 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1600 Tool's bitmap (required).}
1601 @row3col{bitmap2, @ref overview_xrcformat_type_bitmap,
1602 Bitmap for disabled tool (default: derived from @c bitmap).}
1603 @row3col{label, @ref overview_xrcformat_type_text,
1604 Label to display on the tool (default: no label).}
1605 @row3col{radio, @ref overview_xrcformat_type_bool,
1606 Item's kind is wxITEM_RADIO (default: 0)?}
1607 @row3col{toggle, @ref overview_xrcformat_type_bool,
1608 Item's kind is wxITEM_CHECK (default: 0)?}
1609 @row3col{dropdown, see below,
1610 Item's kind is wxITEM_DROPDOWN (default: 0)? (only available since wxWidgets 2.9.0)}
1611 @row3col{tooltip, @ref overview_xrcformat_type_text,
1612 Tooltip to use for the tool (default: none).}
1613 @row3col{longhelp, @ref overview_xrcformat_type_text,
1614 Help text shown in statusbar when the mouse is on the tool (default: none).}
1615 @row3col{disabled, @ref overview_xrcformat_type_bool,
1616 Is the tool initially disabled (default: 0)?}
1617 @endTable
1618
1619 The presence of a @c dropdown property indicates that the tool is of type
1620 wxITEM_DROPDOWN. It must be either empty or contain exactly one @ref
1621 xrc_wxmenu child object defining the drop-down button associated menu.
1622
1623 Notice that @c radio, @c toggle and @c dropdown are mutually exclusive.
1624
1625 Children that are neither @c tool nor @c separator must be instances of classes
1626 derived from wxControl and are added to the toolbar using
1627 wxToolBar::AddControl().
1628
1629 Example:
1630 @code
1631 <object class="wxToolBar">
1632 <style>wxTB_FLAT|wxTB_NODIVIDER</style>
1633 <object class="tool" name="foo">
1634 <bitmap>foo.png</bitmap>
1635 <label>Foo</label>
1636 </object>
1637 <object class="tool" name="bar">
1638 <bitmap>bar.png</bitmap>
1639 <label>Bar</label>
1640 </object>
1641 <object class="separator"/>
1642 <object class="tool" name="view_auto">
1643 <bitmap>view.png</bitmap>
1644 <label>View</label>
1645 <dropdown>
1646 <object class="wxMenu">
1647 <object class="wxMenuItem" name="view_as_text">
1648 <label>View as text</label>
1649 </object>
1650 <object class="wxMenuItem" name="view_as_hex">
1651 <label>View as binary</label>
1652 </object>
1653 </object>
1654 </dropdown>
1655 </object>
1656 <object class="space"/>
1657 <object class="wxComboBox">
1658 <content>
1659 <item>Just</item>
1660 <item>a combobox</item>
1661 <item>in the toolbar</item>
1662 </content>
1663 </object>
1664 </object>
1665
1666 @endcode
1667
1668
1669 @subsubsection xrc_wxtreectrl wxTreeCtrl
1670
1671 A treectrl can have one child object of the @ref xrc_wximagelist class.
1672
1673 No additional properties.
1674
1675
1676 @subsubsection xrc_wxtreebook wxTreebook
1677
1678 A treebook can have one or more child objects of the @c treebookpage
1679 pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its
1680 @c notebookpage) and one child object of the @ref xrc_wximagelist class.
1681 @c treebookpage objects have the following properties:
1682
1683 @beginTable
1684 @hdr3col{property, type, description}
1685 @row3col{depth, integer,
1686 Page's depth in the labels tree (required; see below).}
1687 @row3col{label, @ref overview_xrcformat_type_text,
1688 Sheet page's title (required).}
1689 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1690 Bitmap shown alongside the label (default: none).}
1691 @row3col{image, integer,
1692 The zero-based index of the image associated with the item
1693 into the image list.}
1694 @row3col{selected, @ref overview_xrcformat_type_bool,
1695 Is the page selected initially (only one page can be selected; default: 0)?}
1696 @endTable
1697
1698 Each @c treebookpage has exactly one non-toplevel window as its child.
1699
1700 The tree of labels is not described using nested @c treebookpage objects, but
1701 using the @em depth property. Toplevel pages have depth 0, their child pages
1702 have depth 1 and so on. A @c treebookpage's label is inserted as child of
1703 the latest preceding page with depth equal to @em depth-1. For example, this
1704 XRC markup:
1705
1706 @code
1707 <object class="wxTreebook">
1708 ...
1709 <object class="treebookpage">
1710 <depth>0</depth>
1711 <label>Page 1</label>
1712 <object class="wxPanel">...</object>
1713 </object>
1714 <object class="treebookpage">
1715 <depth>1</depth>
1716 <label>Subpage 1A</label>
1717 <object class="wxPanel">...</object>
1718 </object>
1719 <object class="treebookpage">
1720 <depth>2</depth>
1721 <label>Subsubpage 1</label>
1722 <object class="wxPanel">...</object>
1723 </object>
1724 <object class="treebookpage">
1725 <depth>1</depth>
1726 <label>Subpage 1B</label>
1727 <object class="wxPanel">...</object>
1728 </object>
1729 <object class="treebookpage">
1730 <depth>2</depth>
1731 <label>Subsubpage 2</label>
1732 <object class="wxPanel">...</object>
1733 </object>
1734 <object class="treebookpage">
1735 <depth>0</depth>
1736 <label>Page 2</label>
1737 <object class="wxPanel">...</object>
1738 </object>
1739 </object>
1740 @endcode
1741
1742 corresponds to the following tree of labels:
1743
1744 - Page 1
1745 - Subpage 1A
1746 - Subsubpage 1
1747 - Subpage 1B
1748 - Subsubpage 2
1749 - Page 2
1750
1751
1752 @subsubsection xrc_wxwizard wxWizard
1753
1754 @beginTable
1755 @hdr3col{property, type, description}
1756 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1757 Bitmap to display on the left side of the wizard (default: none).}
1758 @endTable
1759
1760 A wizard object can have one or more child objects of the wxWizardPage or
1761 wxWizardPageSimple classes. They both support the following properties
1762 (in addition to @ref overview_xrcformat_std_props):
1763
1764 @beginTable
1765 @hdr3col{property, type, description}
1766 @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
1767 Page-specific bitmap (default: none).}
1768 @endTable
1769
1770 wxWizardPageSimple pages are automatically chained together; wxWizardPage pages
1771 transitions must be handled programatically.
1772
1773
1774 @section overview_xrcformat_sizers Sizers
1775
1776 Sizers are handled slightly differently in XRC resources than they are in
1777 wxWindow hierarchy. wxWindow's sizers hierarchy is parallel to the wxWindow
1778 children hieararchy: child windows are children of their parent window and
1779 the sizer (or sizers) form separate hierarchy attached to the window with
1780 wxWindow::SetSizer().
1781
1782 In XRC, the two hierarchies are merged together: sizers are children of other
1783 sizers or windows and they can contain child window objects.
1784
1785 If a sizer is child of a window object in the resource, it must be the only
1786 child and it will be attached to the parent with wxWindow::SetSizer().
1787 Additionally, if the window doesn't have its size explicitly set,
1788 wxSizer::Fit() is used to resize the window. If the parent window is
1789 toplevel window, wxSizer::SetSizeHints() is called to set its hints.
1790
1791 A sizer object can have one or more child objects of one of two pseudo-classes:
1792 @c sizeritem or @c spacer (see @ref overview_xrcformat_wxstddialogbuttonsizer for
1793 an exception). The former specifies an element (another sizer or a window)
1794 to include in the sizer, the latter adds empty space to the sizer.
1795
1796 @c sizeritem objects have exactly one child object: either another sizer
1797 object, or a window object. @c spacer objects don't have any children, but
1798 they have one property:
1799
1800 @beginTable
1801 @hdr3col{property, type, description}
1802 @row3col{size, @ref overview_xrcformat_type_size, Size of the empty space (required).}
1803 @endTable
1804
1805 Both @c sizeritem and @c spacer objects can have any of the following
1806 properties:
1807
1808 @beginTable
1809 @hdr3col{property, type, description}
1810 @row3col{option, integer,
1811 The "option" value for sizers. Used by wxBoxSizer to set proportion of
1812 the item in the growable direction (default: 0).}
1813 @row3col{flag, @ref overview_xrcformat_type_style,
1814 wxSizerItem flags (default: 0).}
1815 @row3col{border, @ref overview_xrcformat_type_dimension,
1816 Size of the border around the item (directions are specified in flags)
1817 (default: 0).}
1818 @row3col{minsize, @ref overview_xrcformat_type_size,
1819 Minimal size of this item (default: no min size).}
1820 @row3col{ratio, @ref overview_xrcformat_type_size,
1821 Item ratio, see wxSizer::SetRatio() (default: no ratio).}
1822 @row3col{cellpos, @ref overview_xrcformat_type_pos,
1823 (wxGridBagSizer only) Position, see wxGBSizerItem::SetPos() (required). }
1824 @row3col{cellspan, @ref overview_xrcformat_type_size,
1825 (wxGridBagSizer only) Span, see wxGBSizerItem::SetSpan() (required). }
1826 @endTable
1827
1828 Example of sizers XRC code:
1829 @code
1830 <object class="wxDialog" name="derived_dialog">
1831 <title>Derived Dialog Example</title>
1832 <centered>1</centered>
1833 <!-- this sizer is set to be this dialog's sizer: -->
1834 <object class="wxFlexGridSizer">
1835 <cols>1</cols>
1836 <rows>0</rows>
1837 <vgap>0</vgap>
1838 <hgap>0</hgap>
1839 <growablecols>0</growablecols>
1840 <growablerows>0</growablerows>
1841 <object class="sizeritem">
1842 <flag>wxALIGN_CENTRE|wxALL</flag>
1843 <border>5</border>
1844 <object class="wxButton" name="my_button">
1845 <label>My Button</label>
1846 </object>
1847 </object>
1848 <object class="sizeritem">
1849 <flag>wxALIGN_CENTRE|wxALL</flag>
1850 <border>5</border>
1851 <object class="wxBoxSizer">
1852 <orient>wxHORIZONTAL</orient>
1853 <object class="sizeritem">
1854 <flag>wxALIGN_CENTRE|wxALL</flag>
1855 <border>5</border>
1856 <object class="wxCheckBox" name="my_checkbox">
1857 <label>Enable this text control:</label>
1858 </object>
1859 </object>
1860 <object class="sizeritem">
1861 <flag>wxALIGN_CENTRE|wxALL</flag>
1862 <border>5</border>
1863 <object class="wxTextCtrl" name="my_textctrl">
1864 <size>80,-1</size>
1865 <value></value>
1866 </object>
1867 </object>
1868 </object>
1869 </object>
1870 ...
1871 </object>
1872 </object>
1873 @endcode
1874
1875 The sizer classes that can be used are listed below, together with their
1876 class-specific properties. All classes support the following properties:
1877
1878 @beginTable
1879 @hdr3col{property, type, description}
1880 @row3col{minsize, @ref overview_xrcformat_type_size,
1881 Minimal size that this sizer will have, see wxSizer::SetMinSize()
1882 (default: no min size).}
1883 @endTable
1884
1885 @subsection overview_xrcformat_wxboxsizer wxBoxSizer
1886
1887 @beginTable
1888 @hdr3col{property, type, description}
1889 @row3col{orient, @ref overview_xrcformat_type_style,
1890 Sizer orientation, "wxHORIZONTAL" or "wxVERTICAL" (default: wxHORIZONTAL).}
1891 @endTable
1892
1893 @subsection overview_xrcformat_wxstaticsboxizer wxStaticBoxSizer
1894
1895 @beginTable
1896 @hdr3col{property, type, description}
1897 @row3col{orient, @ref overview_xrcformat_type_style,
1898 Sizer orientation, "wxHORIZONTAL" or "wxVERTICAL" (default: wxHORIZONTAL).}
1899 @row3col{label, @ref overview_xrcformat_type_text,
1900 Label to be used for the static box around the sizer (required).}
1901 @endTable
1902
1903 @subsection overview_xrcformat_wxgridsizer wxGridSizer
1904
1905 @beginTable
1906 @hdr3col{property, type, description}
1907 @row3col{rows, integer, Number of rows in the grid (default: 0 - determine automatically).}
1908 @row3col{cols, integer, Number of columns in the grid (default: 0 - determine automatically).}
1909 @row3col{vgap, integer, Vertical gap between children (default: 0).}
1910 @row3col{hgap, integer, Horizontal gap between children (default: 0).}
1911 @endTable
1912
1913 @subsection overview_xrcformat_wxflexgridsizer wxFlexGridSizer
1914
1915 @beginTable
1916 @hdr3col{property, type, description}
1917 @row3col{rows, integer, Number of rows in the grid (default: 0 - determine automatically).}
1918 @row3col{cols, integer, Number of columns in the grid (default: 0 - determine automatically).}
1919 @row3col{vgap, integer, Vertical gap between children (default: 0).}
1920 @row3col{hgap, integer, Horizontal gap between children (default: 0).}
1921 @row3col{growablerows, comma-separated integers list,
1922 Comma-separated list of indexes of rows that are growable
1923 (default: none).}
1924 @row3col{growablecols, comma-separated integers list,
1925 Comma-separated list of indexes of columns that are growable
1926 (default: none).}
1927 @endTable
1928
1929 @subsection overview_xrcformat_wxgridbagsizer wxGridBagSizer
1930
1931 @beginTable
1932 @hdr3col{property, type, description}
1933 @row3col{vgap, integer, Vertical gap between children (default: 0).}
1934 @row3col{hgap, integer, Horizontal gap between children (default: 0).}
1935 @row3col{growablerows, comma-separated integers list,
1936 Comma-separated list of indexes of rows that are growable
1937 (default: none).}
1938 @row3col{growablecols, comma-separated integers list,
1939 Comma-separated list of indexes of columns that are growable
1940 (default: none).}
1941 @endTable
1942
1943 @subsection overview_xrcformat_wxwrapsizer wxWrapSizer
1944
1945 @beginTable
1946 @hdr3col{property, type, description}
1947 @row3col{orient, @ref overview_xrcformat_type_style,
1948 Sizer orientation, "wxHORIZONTAL" or "wxVERTICAL" (required).}
1949 @row3col{flag, @ref overview_xrcformat_type_style, wxWrapSizer flags (default: 0).}
1950 @endTable
1951
1952 @subsection overview_xrcformat_wxstddialogbuttonsizer wxStdDialogButtonSizer
1953
1954 Unlike other sizers, wxStdDialogButtonSizer doesn't have neither @c sizeritem
1955 nor @c spacer children. Instead, it has one or more children of the
1956 @c button pseudo-class. @c button objects have no properties and they must
1957 always have exactly one child of the @c wxButton class or a class derived from
1958 wxButton.
1959
1960 Example:
1961 @code
1962 <object class="wxStdDialogButtonSizer">
1963 <object class="button">
1964 <object class="wxButton" name="wxID_OK">
1965 <label>OK</label>
1966 </object>
1967 </object>
1968 <object class="button">
1969 <object class="wxButton" name="wxID_CANCEL">
1970 <label>Cancel</label>
1971 </object>
1972 </object>
1973 </object>
1974 @endcode
1975
1976
1977
1978 @section overview_xrcformat_other_objects Other Objects
1979
1980 In addition to describing UI elements, XRC files can contain non-windows
1981 objects such as bitmaps or icons. This is a concession to Windows developers
1982 used to storing them in Win32 resources.
1983
1984 Note that unlike Win32 resources, bitmaps included in XRC files are @em not
1985 embedded in the XRC file itself. XRC file only contains a reference to another
1986 file with bitmap data.
1987
1988 @subsection overview_xrcformat_bitmap wxBitmap
1989
1990 Bitmaps are stored in @c \<object\> element with class set to @c wxBitmap. Such
1991 bitmaps can then be loaded using wxXmlResource::LoadBitmap(). The content of
1992 the element is exactly same as in the case of
1993 @ref overview_xrcformat_type_bitmap "bitmap properties", except that toplevel
1994 @c \<object\> is used.
1995
1996 For example, instead of:
1997 @code
1998 <bitmap>mybmp.png</bitmap>
1999 <bitmap stock_id="wxART_NEW"/>
2000 @endcode
2001 toplevel wxBitmap resources would look like:
2002 @code
2003 <object class="wxBitmap" name="my_bitmap">mybmp.png</object>
2004 <object class="wxBitmap" name="my_new_bitmap" stock_id="wxART_NEW"/>
2005 @endcode
2006
2007
2008 @subsection overview_xrcformat_icon wxIcon
2009
2010 wxIcon resources are identical to @ref overview_xrcformat_bitmap "wxBitmap ones",
2011 except that the class is @c wxIcon.
2012
2013
2014 @section overview_xrcformat_platform Platform Specific Content
2015
2016 It is possible to conditionally process parts of XRC files on some platforms
2017 only and ignore them on other platforms. @em Any element in XRC file, be it
2018 toplevel or arbitrarily nested one, can have the @c platform attribute. When
2019 used, @c platform contains |-separated list of platforms that this element
2020 should be processed on. It is filtered out and ignored on any other platforms.
2021
2022 Possible elemental values are:
2023 @beginDefList
2024 @itemdef{ @c win, Windows }
2025 @itemdef{ @c mac, Mac OS X (or Mac Classic in wxWidgets version supporting it }
2026 @itemdef{ @c unix, Any Unix platform @em except OS X }
2027 @itemdef{ @c os2, OS/2 }
2028 @endDefList
2029
2030 Examples:
2031 @code
2032 <label platform="win">Windows</label>
2033 <label platform="unix">Unix</label>
2034 <label platform="mac">Mac OS X</label>
2035 <help platform="mac|unix">Not a Windows machine</help>
2036 @endcode
2037
2038
2039
2040 @section overview_xrcformat_extending Extending the XRC Format
2041
2042 The XRC format is designed to be extensible and allows specifying and loading
2043 custom controls. The three available mechanisms are described in the rest of
2044 this section in the order of increasing complexity.
2045
2046 @subsection overview_xrcformat_extending_subclass Subclassing
2047
2048 The simplest way to add custom controls is to set the @c subclass attribute
2049 of @c \<object\> element:
2050
2051 @code
2052 <object name="my_value" class="wxTextCtrl" subclass="MyTextCtrl">
2053 <style>wxTE_MULTILINE</style>
2054 ...etc., setup wxTextCtrl as usual...
2055 </object>
2056 @endcode
2057
2058 In that case, wxXmlResource will create an instance of the specified subclass
2059 (@c MyTextCtrl in the example above) instead of the class (@c wxTextCtrl above)
2060 when loading the resource. However, the rest of the object's loading (calling
2061 its Create() method, setting its properties, loading any children etc.)
2062 will proceed in @em exactly the same way as it would without @c subclass
2063 attribute. In other words, this approach is only sufficient when the custom
2064 class is just a small modification (e.g. overridden methods or customized
2065 events handling) of an already supported classes.
2066
2067 The subclass must satisfy a number of requirements:
2068
2069 -# It must be derived from the class specified in @c class attribute.
2070 -# It must be visible in wxWidget's pseudo-RTTI mechanism, i.e. there must be
2071 a DECLARE_DYNAMIC_CLASS() entry for it.
2072 -# It must support two-phase creation. In particular, this means that it has
2073 to have default constructor.
2074 -# It cannot provide custom Create() method and must be constructible using
2075 base @c class' Create() method (this is because XRC will call Create() of
2076 @c class, not @c subclass). In other words, @em creation of the control
2077 must not be customized.
2078
2079
2080 @subsection overview_xrcformat_extending_unknown Unknown Objects
2081
2082 A more flexible solution is to put a @em placeholder in the XRC file and
2083 replace it with custom control after the resource is loaded. This is done by
2084 using the @c unknown pseudo-class:
2085
2086 @code
2087 <object class="unknown" name="my_placeholder"/>
2088 @endcode
2089
2090 The placeholder is inserted as dummy wxPanel that will hold custom control in
2091 it. At runtime, after the resource is loaded and a window created from it
2092 (using e.g. wxXmlResource::LoadDialog()), use code must call
2093 wxXmlResource::AttachUnknownControl() to insert the desired control into
2094 placeholder container.
2095
2096 This method makes it possible to insert controls that are not known to XRC at
2097 all, but it's also impossible to configure the control in XRC description in
2098 any way. The only properties that can be specified are
2099 the @ref overview_xrcformat_std_props "standard window properties".
2100
2101 @note @c unknown class cannot be combined with @c subclass attribute,
2102 they are mutually exclusive.
2103
2104
2105 @subsection overview_xrcformat_extending_custom Adding Custom Classes
2106
2107 Finally, XRC allows adding completely new classes in addition to the ones
2108 listed in this document. A class for which wxXmlResourceHandler is implemented
2109 can be used as first-class object in XRC simply by passing class name as the
2110 value of @c class attribute:
2111
2112 @code
2113 <object name="my_ctrl" class="MyWidget">
2114 <my_prop>foo</my_prop>
2115 ...etc., whatever MyWidget handler accepts...
2116 </object>
2117 @endcode
2118
2119 The only requirements on the class are that
2120 -# the class must derive from wxObject
2121 -# it must support wxWidget's pseudo-RTTI mechanism
2122
2123 Child elements of @c \<object\> are handled by the custom handler and there are
2124 no limitations on them imposed by XRC format.
2125
2126 This is the only mechanism that works for toplevel objects -- custom controls
2127 are accessible using type-unsafe wxXmlResource::LoadObject() method.
2128
2129
2130
2131 @section overview_xrcformat_packed Packed XRC Files
2132
2133 In addition to plain XRC files, wxXmlResource supports (if wxFileSystem support
2134 is compiled in) compressed XRC resources. Compressed resources have either
2135 .zip or .xrs extension and are simply ZIP files that contain arbitrary
2136 number of XRC files and their dependencies (bitmaps, icons etc.).
2137
2138
2139
2140 @section overview_xrcformat_oldversions Older Format Versions
2141
2142 This section describes differences in older revisions of XRC format (i.e.
2143 files with older values of @c version attribute of @c \<resource\>).
2144
2145
2146 @subsection overview_xrcformat_pre_v2530 Versions Before 2.5.3.0
2147
2148 Version 2.5.3.0 introduced C-like handling of "\\" in text. In older versions,
2149 "\n", "\t" and "\r" escape sequences were replaced with respective characters
2150 in the same matter it's done in C, but "\\" was left intact instead of being
2151 replaced with single "\", as one would expect. Starting with 2.5.3.0, all of
2152 them are handled in C-like manner.
2153
2154
2155 @subsection overview_xrcformat_pre_v2301 Versions Before 2.3.0.1
2156
2157 Prior to version 2.3.0.1, "$" was used for accelerators instead of "_"
2158 or "&amp;". For example,
2159 @code
2160 <label>$File</label>
2161 @endcode
2162 was used in place of current version's
2163 @code
2164 <label>_File</label>
2165 @endcode
2166 (or "&amp;File").
2167
2168 */