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