1#
2# RELAX NG schema for XRC files.
3#
4# See http://docs.wxwidgets.org/trunk/overview_xrcformat.html for freeform
5# description of the format.
6#
7#
8#  Extending the grammar
9# -----------------------
10#
11# The grammar defined below validates all builtin <object> classes. Because the
12# XRC format is extensible, it allows any content in <object> nodes that have
13# non-builtin class.
14#
15# This can be customized by overriding the 'customClasses' rule in the grammar
16# when including it from another custom grammar file.
17#
18# For example, if you wish to validate that only wx's builtin classes are used,
19# you can disallow any custom <object>s (see xrc_schema_builtin_only.rnc):
20#
21#     include "xrc_schema.rnc" {
22#         customClasses = notAllowed
23#     }
24#
25# You can also add validation for custom classes:
26#
27#     include "xrc_schema.rnc" {
28#         customClasses = myExtensionClasses
29#     }
30#
31#     myExtensionClasses = (MyFoo | MyBar | ...)
32#     MyFoo =
33#         element object {
34#             attribute class { "MyFoo" },
35#             stdObjectNodeAttributes,
36#             ...
37#         }
38#     ...
39#
40
41default namespace = "http://www.wxwidgets.org/wxxrc"
42namespace xrc = "http://www.wxwidgets.org/wxxrc"
43
44start =
45    element resource {
46        # Versions 2.3.0.1 and 2.5.3.0 differ only in how is '\\' interpreted
47        # in textual content. That's not even validated here, so we accept
48        # both.  Additionally, even though the attribute is optional in the
49        # spec, we require it here; in other words, the schema cannot be used
50        # to validate XRC files from previous millennium.
51        attribute version { "2.3.0.1" | "2.5.3.0" },
52
53        toplevelObjectNode*
54    }
55
56
57# IMPLEMENTATION NOTES:
58#
59# The guiding principle for writing this schema is to validate as much as we
60# possible can, but without introducing false negatives; it is not acceptable
61# to fail validation of a valid (per the human-readable XRC spec) XRC file.
62#
63# Unfortunately, there are some noteworthy complications when describing the
64# XRC format with a formal schema. Working around them results in uglier and
65# overly permissive schema:
66#
67#
68# (1) The biggest issue is with the 'platform' attribute, which may be used on
69# _any_ node in an XRC document. There's no way to specify "universal"
70# attributes that can be placed anywhere in RELAX NG, so we must add the
71# attribute everywhere. The 'platform' grammar rule is used for this and it has
72# an alias, '_', for reduced verbosity. Typical use:
73#
74#       element size   {_, t_size }? &
75#
76#
77# (2) The other 'platform'-related issue is that it messes up cardinality of
78# properties elements. Properties can only be specified once, so the two forms
79# for describing properties would be
80#
81#       1. element size {_, t_size }?   # optional property
82#       2. element size {_, t_size }    # required property
83#
84# (Fortunately, all XRC properties are optional, se the second case is a
85# non-issue and can be safely ignored. It is nevertheless briefly mentioned
86# below for explanatory purposes.)
87#
88# But this is problematic with 'platform', because it's reasonable (and,
89# indeed, done in the wild) to set properties differently for different
90# platforms:
91#
92#       <object class="wxMenuItem" name="menu_new_from_pot">
93#           <label platform="win">New catalog from POT file...</label>
94#           <label platform="unix|mac">New Catalog from POT File...</label>
95#       </object>
96#
97# But we now have the 'label' property _twice_ and validation fails. The
98# simplest fix is to change the cardinality of properties to allow this [A]:
99#
100#       1. element size {_, t_size }*    # optional property (0 or more times)
101#       2. element size {_, t_size }+    # required property (at least once)
102#
103# Of course, this is too lax and allows invalid (but gracefully handled by
104# wxXmlResource) markup like this:
105#
106#       <object class="wxMenuItem" name="menu_new_from_pot">
107#           <label>Something</label>
108#           <label>Else</label>
109#       </object>
110#
111# We could make this better by splitting the property declaration into two, one
112# for the case with 'platform' and one for without [B]:
113#
114#       (element size { t_size } | element size { attribute platform{string}, t_size }+)
115#
116# But this is verbose and unreadable with the amount of properties present in
117# the schema. Instead, we use the more-forbidding version and annotate
118# properties with 'p' annotation (for "property") to mark these uses of * as
119# special and enable post-processing of the schema.
120#
121# The value of the annotation is normally just "o" (for "optional" -- remember
122# that there are no required properties) to indicate optional properties.
123#
124# Since we have the annotation anyway, we take advantage of it to indicate
125# properties that are strictly speaking optional, but should almost always be
126# specified, even though they don't _have_ to be. A typical example would be
127# wxStaticText's label: it very rarely makes sense to omit it, but usually
128# doesn't. Such properties are indicated with the "important" value of the
129# annotation:
130#
131#       [xrc:p="o"] element checked { t_bool }*        # optional
132#       [xrc:p="important"] element label { t_text }*  # should be provided
133#
134# This makes it possible to implement tools that translate this schema into a
135# variant that uses [B].
136#
137
138toplevelObjectNode = (objectRef | builtinToplevelClasses | customClasses)
139windowNode =         (objectRef | builtinWindowClasses | customClasses)
140sizerNode  =         (objectRef | builtinSizerClasses | customClasses)
141
142# The following three lists must be updated when a new class is added
143# to this file.
144
145builtinToplevelClasses =
146    ( builtinWindowClasses
147    | idsRange
148    | wxBitmap_or_wxIcon
149    | wxMenuBar
150    | wxMenu
151    )
152
153builtinWindowClasses =
154    ( unknown
155    | wxAnimationCtrl
156    | wxAuiNotebook
157    | wxBannerWindow
158    | wxBitmapButton
159    | wxBitmapComboBox
160    | wxBitmapToggleButton
161    | wxButton
162    | wxCalendarCtrl
163    | wxCheckBox
164    | wxCheckListBox
165    | wxChoice
166    | wxChoicebook
167    | wxCommandLinkButton
168    | wxCollapsiblePane
169    | wxColourPickerCtrl
170    | wxComboBox
171    | wxComboCtrl
172    | wxDatePickerCtrl
173    | wxDialog
174    | wxDirPickerCtrl
175    | wxEditableListBox
176    | wxFileCtrl
177    | wxFilePickerCtrl
178    | wxFontPickerCtrl
179    | wxFrame
180    | wxGauge
181    | wxGenericDirCtrl
182    | wxGrid
183    | wxHtmlWindow
184    | wxHyperlinkCtrl
185    | wxListBox
186    | wxListbook
187    | wxListCtrl
188    | wxMDIParentFrame
189    | wxNotebook
190    | wxOwnerDrawnComboBox
191    | wxPanel
192    | wxPropertySheetDialog
193    | wxRadioButton
194    | wxRadioBox
195    | wxRibbonBar
196    | wxRibbonButtonBar
197    | wxRibbonControl
198    | wxRibbonGallery
199    | wxRibbonPage
200    | wxRibbonPanel
201    | wxRichTextCtrl
202    | wxScrollBar
203    | wxScrolledWindow
204    | wxSimpleHtmlListBox
205    | wxSimplebook
206    | wxSlider
207    | wxSpinButton
208    | wxSpinCtrl
209    | wxSplitterWindow
210    | wxSearchCtrl
211    | wxStatusBar
212    | wxStaticBitmap
213    | wxStaticBox
214    | wxStaticLine
215    | wxStaticText
216    | wxTextCtrl
217    | wxTimePickerCtrl
218    | wxToggleButton
219    | wxToolBar
220    | wxToolbook
221    | wxTreeCtrl
222    | wxTreebook
223    | wxWizard
224    )
225
226builtinSizerClasses =
227    ( wxBoxSizer
228    | wxStaticBoxSizer
229    | wxGridSizer
230    | wxFlexGridSizer
231    | wxGridBagSizer
232    | wxWrapSizer
233    | wxStdDialogButtonSizer
234    )
235
236builtinClassesNames =
237    ( "wxBitmap"
238    | "wxIcon"
239    | "wxMenuBar"
240    | "wxMenu"
241
242    | "unknown"
243
244    | "wxAnimationCtrl"
245    | "wxAuiNotebook"
246    | "wxBannerWindow"
247    | "wxBitmapButton"
248    | "wxBitmapComboBox"
249    | "wxBitmapToggleButton"
250    | "wxButton"
251    | "wxCalendarCtrl"
252    | "wxCheckBox"
253    | "wxCheckListBox"
254    | "wxChoice"
255    | "wxChoicebook"
256    | "wxCommandLinkButton"
257    | "wxCollapsiblePane"
258    | "wxColourPickerCtrl"
259    | "wxComboBox"
260    | "wxComboCtrl"
261    | "wxDatePickerCtrl"
262    | "wxDialog"
263    | "wxDirPickerCtrl"
264    | "wxEditableListBox"
265    | "wxFileCtrl"
266    | "wxFilePickerCtrl"
267    | "wxFontPickerCtrl"
268    | "wxFrame"
269    | "wxGauge"
270    | "wxGenericDirCtrl"
271    | "wxGrid"
272    | "wxHtmlWindow"
273    | "wxHyperlinkCtrl"
274    | "wxListBox"
275    | "wxListbook"
276    | "wxListCtrl"
277    | "wxMDIParentFrame"
278    | "wxNotebook"
279    | "wxOwnerDrawnComboBox"
280    | "wxPanel"
281    | "wxPropertySheetDialog"
282    | "wxRadioButton"
283    | "wxRadioBox"
284    | "wxRibbonBar"
285    | "wxRibbonButtonBar"
286    | "wxRibbonControl"
287    | "wxRibbonGallery"
288    | "wxRibbonPage"
289    | "wxRibbonPanel"
290    | "wxRichTextCtrl"
291    | "wxScrollBar"
292    | "wxScrolledWindow"
293    | "wxSimpleHtmlListBox"
294    | "wxSimplebook"
295    | "wxSlider"
296    | "wxSpinButton"
297    | "wxSpinCtrl"
298    | "wxSplitterWindow"
299    | "wxSearchCtrl"
300    | "wxStatusBar"
301    | "wxStaticBitmap"
302    | "wxStaticBox"
303    | "wxStaticLine"
304    | "wxStaticText"
305    | "wxTextCtrl"
306    | "wxTimePickerCtrl"
307    | "wxToggleButton"
308    | "wxToolBar"
309    | "wxToolbook"
310    | "wxTreeCtrl"
311    | "wxTreebook"
312    | "wxWizard"
313
314    | "wxBoxSizer"
315    | "wxStaticBoxSizer"
316    | "wxGridSizer"
317    | "wxFlexGridSizer"
318    | "wxGridBagSizer"
319    | "wxWrapSizer"
320    | "wxStdDialogButtonSizer"
321    )
322
323# class names not used at toplevel, only within something else
324builtinNestedClassesNames =
325    ( "wxMenuItem"
326    | "separator"
327    | "break"
328    | "space"
329    | "tool"
330    | "panewindow"
331    | "notebookpage"
332    | "choicebookpage"
333    | "listbookpage"
334    | "simplebookpage"
335    | "treebookpage"
336    | "propertysheetpage"
337    | "ownerdrawnitem"
338    | "listcol"
339    | "listitem"
340    | "wxMDIChildFrame"
341    | "page" | "panel" | "button" | "item"  # wxRibbon classes
342    | "wxWizardPage"
343    | "wxWizardPageSimple"
344    )
345
346allPossibleBuiltinClassNames = (builtinClassesNames | builtinNestedClassesNames)
347
348
349# This grammar rule can be used to plug in any extensions used in an
350# application. By default, it allows any content under custom <object>
351# nodes.
352customClasses =
353    element object {
354        attribute class { string - allPossibleBuiltinClassNames } &
355        stdObjectNodeAttributes &
356        anyXMLContent*
357    }
358
359# Helper for specifying arbitrary content.
360anyXMLContent =
361  element * {
362    (attribute * { text }
363     | text
364     | anyXMLContent)*
365  }
366
367
368# Annotations used to mark special kinds of content:
369#
370# [xrc:p] marks properties, with two possible values:
371#
372#     [xrc:p="o"]           for normal/optional properties
373#     [xrc:p="important"]   for important properties that
374#                           should almost always be set
375#
376
377
378# All <object> nodes (except the pseudo-classes) have these attributes.
379stdObjectNodeAttributes =
380        attribute subclass { t_identifier }? &
381        attribute name     { t_identifier }? &
382        platform
383
384# All (almost) wxWindow-derived objects have these properties.
385stdWindowProperties =
386        [xrc:p="o"] element pos     {_, t_position }* &
387        [xrc:p="o"] element size    {_, t_size }* &
388        [xrc:p="o"] element style   {_, t_style }* &
389        [xrc:p="o"] element exstyle {_, t_style }* &
390        [xrc:p="o"] element fg      {_, t_colour }* &
391        [xrc:p="o"] element ownfg   {_, t_colour }* &
392        [xrc:p="o"] element bg      {_, t_colour }* &
393        [xrc:p="o"] element ownbg   {_, t_colour }* &
394        [xrc:p="o"] element enabled {_, t_bool }* &
395        [xrc:p="o"] element focused {_, t_bool }* &
396        [xrc:p="o"] element hidden  {_, t_bool }* &
397        [xrc:p="o"] element tooltip {_, t_text }* &
398        [xrc:p="o"] element variant {_, t_variant }* &
399        [xrc:p="o"] element font    {_, t_font }* &
400        [xrc:p="o"] element ownfont {_, t_font }* &
401        [xrc:p="o"] element help    {_, t_text }*
402
403platform =
404        attribute platform {
405            xsd:string { pattern = "(win|mac|unix|os2)( *\| *(win|mac|unix|os2))*" }
406        }?
407# shorthand alias for 'platform' for use in properties definitions and
408# elsewhere where 'platform' would be too verbose
409_ = platform
410
411
412# Basic data types.
413
414t_identifier = string
415t_text       = string
416t_string     = string
417t_bool       = "1" | "0"
418t_integer    = xsd:integer
419t_unsigned   = xsd:nonNegativeInteger
420t_float      = xsd:float
421t_direction  = "wxLEFT" | "wxRIGHT" | "wxTOP" | "wxBOTTOM"
422t_style      = xsd:string { pattern = "(wx[A-Z0-9_]+)( *\| *(wx[A-Z0-9_]+))*" }
423
424t_url        = string
425t_colour     = xsd:string { pattern = "#[0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z]" } |
426               xsd:string { pattern = "[^#].*" }
427t_position   = t_size
428t_size       = xsd:string { pattern = "(-?\d+),(-?\d+)d?" }
429t_dimension  = xsd:string { pattern = "(-?\d+)d?" }
430
431t_bitmap     = t_url?,
432               (
433                   attribute stock_id { t_identifier},
434                   attribute stock_client { t_identifier}?
435               )?
436
437t_font       = (
438                   [xrc:p="o"] element size         {_, t_integer }* &
439                   [xrc:p="o"] element style        {_, ("normal" | "italic" | "slant") }* &
440                   [xrc:p="o"] element weight       {_, ("normal" | "bold" | "light") }* &
441                   [xrc:p="o"] element family       {_, ("roman" | "script" | "decorative" | "swiss" |
442                                                         "modern" | "teletype") }* &
443                   [xrc:p="o"] element underlined   {_, t_bool }* &
444                   [xrc:p="o"] element face         {_, t_text }* &
445                   [xrc:p="o"] element encoding     {_, t_text }* &
446                   [xrc:p="o"] element sysfont      {_, ("wxSYS_OEM_FIXED_FONT" | "wxSYS_ANSI_FIXED_FONT" |
447                                                         "wxSYS_ANSI_VAR_FONT" | "wxSYS_SYSTEM_FONT" |
448                                                         "wxSYS_DEVICE_DEFAULT_FONT" | "wxSYS_SYSTEM_FIXED_FONT" |
449                                                         "wxSYS_DEFAULT_GUI_FONT") }* &
450                   [xrc:p="o"] element inherit      {_, t_bool }* &
451                   [xrc:p="o"] element relativesize {_, t_float }*
452               )
453
454t_variant    = "normal" | "small" | "mini" | "large"
455
456t_imagelist  = (
457                   [xrc:p="o"] element mask {_, t_bool }* &
458                   [xrc:p="o"] element size {_, t_size }* &
459                   element bitmap {_, t_bitmap }+
460               )
461
462t_list_of_numbers = xsd:string { pattern = "\d+(,\d+)*" }
463
464t_list_of_numbers_with_weights = xsd:string { pattern = "\d+(:\d+)?(,\d+(:\d+)?)*" }
465
466
467#
468# Handlers for non-<object> content:
469#
470
471idsRange =
472    element ids-range {
473        attribute name  { t_identifier },
474        attribute size  { t_integer }?,
475        attribute start { t_integer }?
476    }
477
478
479objectRef =
480    element object_ref {
481        stdObjectNodeAttributes &
482        attribute ref { t_identifier } &
483        anyXMLContent*
484    }
485
486
487#
488# Handlers for specific <object> classes follow:
489#
490
491unknown =
492    element object {
493        attribute class { "unknown" } &
494        attribute name  { t_identifier } &
495        platform &
496        stdWindowProperties
497    }
498
499
500wxBitmap_or_wxIcon =
501    element object {
502        attribute class { "wxBitmap" | "wxIcon" } &
503        stdObjectNodeAttributes &
504        t_bitmap
505    }
506
507
508wxAnimationCtrl =
509    element object {
510        attribute class { "wxAnimationCtrl" } &
511        stdObjectNodeAttributes &
512        stdWindowProperties &
513        [xrc:p="o"] element animation       {_, t_url }* &
514        [xrc:p="o"] element inactive-bitmap {_, t_bitmap }*
515    }
516
517
518wxAuiNotebook =
519    element object {
520        attribute class { "wxAuiNotebook" } &
521        stdObjectNodeAttributes &
522        stdWindowProperties &
523        (wxAuiNotebook_notebookpage | objectRef)*
524    }
525
526wxAuiNotebook_notebookpage =
527    element object {
528        attribute class  { "notebookpage" } &
529        [xrc:p="important"] element label {_, t_text }* &
530        [xrc:p="o"] element bitmap   {_, t_bitmap }* &
531        [xrc:p="o"] element selected {_, t_bool }* &
532        windowNode
533    }
534
535
536wxBannerWindow =
537    element object {
538        attribute class { "wxBannerWindow" } &
539        stdObjectNodeAttributes &
540        stdWindowProperties &
541        [xrc:p="o"] element direction {_, t_direction }* &
542        [xrc:p="o"](
543           element bitmap {_, t_bitmap } |
544           (
545               element gradient-start {_, t_colour} &
546               element gradient-end {_, t_colour }
547           )
548        )* &
549        [xrc:p="o"] element title     {_, t_text }* &
550        [xrc:p="o"] element message   {_, t_text }*
551    }
552
553
554wxBitmapButton =
555    element object {
556        attribute class { "wxBitmapButton" } &
557        stdObjectNodeAttributes &
558        stdWindowProperties &
559        [xrc:p="o"] element default  {_, t_bool }* &
560        [xrc:p="important"] element bitmap {_, t_bitmap }* &
561        [xrc:p="o"] element selected {_, t_bitmap }* &
562        [xrc:p="o"] element focus    {_, t_bitmap }* &
563        [xrc:p="o"] element disabled {_, t_bitmap }* &
564        [xrc:p="o"] element hover    {_, t_bitmap }*
565    }
566
567
568wxBitmapComboBox =
569    element object {
570        attribute class { "wxBitmapComboBox" } &
571        stdObjectNodeAttributes &
572        stdWindowProperties &
573        [xrc:p="o"] element selection {_, t_integer }* &
574        [xrc:p="o"] element value     {_, t_text }* &
575        (wxBitmapComboBox_ownerdrawnitem | objectRef)*
576    }
577
578wxBitmapComboBox_ownerdrawnitem =
579    element object {
580        attribute class  { "ownerdrawnitem" } &
581        platform &
582        [xrc:p="important"] element text {_, t_text }* &
583        [xrc:p="o"] element bitmap   {_, t_bitmap }*
584    }
585
586
587wxBitmapToggleButton =
588    element object {
589        attribute class { "wxBitmapToggleButton" } &
590        stdObjectNodeAttributes &
591        stdWindowProperties &
592        [xrc:p="important"] element bitmap {_, t_bitmap }* &
593        [xrc:p="o"] element checked {_, t_bool }*
594    }
595
596
597wxButton =
598    element object {
599        attribute class { "wxButton" } &
600        stdObjectNodeAttributes &
601        stdWindowProperties &
602        [xrc:p="o"] element label          {_, t_text }* &
603        [xrc:p="o"] element bitmap         {_, t_bitmap }* &
604        [xrc:p="o"] element bitmapposition {_, t_direction }* &
605        [xrc:p="o"] element default        {_, t_bool }*
606    }
607
608
609wxCalendarCtrl =
610    element object {
611        attribute class { "wxCalendarCtrl" } &
612        stdObjectNodeAttributes &
613        stdWindowProperties
614    }
615
616
617wxCheckBox =
618    element object {
619        attribute class { "wxCheckBox" } &
620        stdObjectNodeAttributes &
621        stdWindowProperties &
622        [xrc:p="important"] element label {_, t_text }* &
623        [xrc:p="o"] element checked {_, t_bool }*
624    }
625
626
627wxCheckListBox =
628    element object {
629        attribute class { "wxCheckListBox" } &
630        stdObjectNodeAttributes &
631        stdWindowProperties &
632        element content {
633            platform,
634            element item {
635                attribute checked { t_bool }?,
636                t_text
637            }*
638        }?
639    }
640
641
642wxChoice =
643    element object {
644        attribute class { "wxChoice" } &
645        stdObjectNodeAttributes &
646        stdWindowProperties &
647        [xrc:p="o"] element selection {_, t_integer }* &
648        element content {
649            platform,
650            element item {_, t_text }*
651        }?
652    }
653
654
655wxChoicebook =
656    element object {
657        attribute class { "wxChoicebook" } &
658        stdObjectNodeAttributes &
659        stdWindowProperties &
660        [xrc:p="o"] element imagelist {_, t_imagelist }* &
661        (wxChoicebook_choicebookpage | objectRef)*
662    }
663
664wxChoicebook_choicebookpage =
665    element object {
666        attribute class { "choicebookpage" } &
667        platform &
668        [xrc:p="important"] element label {_, t_text }* &
669        [xrc:p="o"](
670            element bitmap {_, t_bitmap } |
671            element image  {_, t_integer }
672        )* &
673        [xrc:p="o"] element selected {_, t_bool }* &
674        windowNode
675    }
676
677
678wxCommandLinkButton =
679    element object {
680        attribute class { "wxCommandLinkButton" } &
681        stdObjectNodeAttributes &
682        stdWindowProperties &
683        [xrc:p="important"] element label {_, t_text }* &
684        [xrc:p="o"] element note  {_, t_text }*
685    }
686
687
688wxCollapsiblePane =
689    element object {
690        attribute class { "wxCollapsiblePane" } &
691        stdObjectNodeAttributes &
692        stdWindowProperties &
693        [xrc:p="important"] element label {_, t_text }* &
694        [xrc:p="o"] element collapsed {_, t_bool }* &
695        (wxCollapsiblePane_panewindow | objectRef)?
696    }
697
698wxCollapsiblePane_panewindow =
699    element object {
700        attribute class { "panewindow" } &
701        platform &
702        (sizerNode | windowNode)
703    }
704
705
706wxColourPickerCtrl =
707    element object {
708        attribute class { "wxColourPickerCtrl" } &
709        stdObjectNodeAttributes &
710        stdWindowProperties &
711        [xrc:p="o"] element value {_, t_colour }*
712    }
713
714
715wxComboBox =
716    element object {
717        attribute class { "wxComboBox" } &
718        stdObjectNodeAttributes &
719        stdWindowProperties &
720        [xrc:p="o"] element selection {_, t_integer }* &
721        [xrc:p="o"] element value     {_, t_string }* &
722        element content {
723            platform,
724            element item {_, t_text }*
725        }?
726    }
727
728
729wxComboCtrl =
730    element object {
731        attribute class { "wxComboCtrl" } &
732        stdObjectNodeAttributes &
733        stdWindowProperties &
734        [xrc:p="o"] element value {_, t_string }*
735    }
736
737
738wxDatePickerCtrl =
739    element object {
740        attribute class { "wxDatePickerCtrl" } &
741        stdObjectNodeAttributes &
742        stdWindowProperties
743    }
744
745
746wxDialog =
747    element object {
748        attribute class { "wxDialog" } &
749        stdObjectNodeAttributes &
750        stdWindowProperties &
751        [xrc:p="o"] element title    {_, t_text }* &
752        [xrc:p="o"] element icon     {_, t_bitmap }* &
753        [xrc:p="o"] element centered {_, t_bool }* &
754        (sizerNode | windowNode* )?
755    }
756
757
758wxDirPickerCtrl =
759    element object {
760        attribute class { "wxDirPickerCtrl" } &
761        stdObjectNodeAttributes &
762        stdWindowProperties &
763        [xrc:p="o"] element value   {_, t_string }* &
764        [xrc:p="important"] element message {_, t_text}*
765    }
766
767
768wxEditableListBox =
769    element object {
770        attribute class { "wxEditableListBox" } &
771        stdObjectNodeAttributes &
772        stdWindowProperties &
773        [xrc:p="o"] element label {_, t_text}* &
774        element content {
775            platform,
776            element item {_, t_text }*
777        }?
778    }
779
780
781wxFileCtrl =
782    element object {
783        attribute class { "wxFileCtrl" } &
784        stdObjectNodeAttributes &
785        stdWindowProperties &
786        [xrc:p="o"] element defaultdirectory {_, t_string }* &
787        [xrc:p="o"] element defaultfilename  {_, t_string }* &
788        [xrc:p="o"] element wildcard         {_, t_string }*
789    }
790
791
792wxFilePickerCtrl =
793    element object {
794        attribute class { "wxFilePickerCtrl" } &
795        stdObjectNodeAttributes &
796        stdWindowProperties &
797        [xrc:p="o"] element value    {_, t_string }* &
798        [xrc:p="important"] element message  {_, t_text }* &
799        [xrc:p="o"] element wildcard {_, t_string }*
800    }
801
802
803wxFontPickerCtrl =
804    element object {
805        attribute class { "wxFontPickerCtrl" } &
806        stdObjectNodeAttributes &
807        stdWindowProperties &
808        [xrc:p="o"] element value {_, t_font }*
809    }
810
811
812wxFrame =
813    element object {
814        attribute class { "wxFrame" } &
815        stdObjectNodeAttributes &
816        stdWindowProperties &
817        [xrc:p="o"] element title    {_, t_text }* &
818        [xrc:p="o"] element icon     {_, t_bitmap }* &
819        [xrc:p="o"] element centered {_, t_bool }* &
820        (sizerNode | windowNode* )?
821    }
822
823
824wxGauge =
825    element object {
826        attribute class { "wxGauge" } &
827        stdObjectNodeAttributes &
828        stdWindowProperties &
829        [xrc:p="o"] element range  {_, t_integer }* &
830        [xrc:p="o"] element value  {_, t_integer }* &
831        [xrc:p="o"] element shadow {_, t_dimension }* &
832        [xrc:p="o"] element bezel  {_, t_dimension }*
833    }
834
835
836wxGenericDirCtrl =
837    element object {
838        attribute class { "wxGenericDirCtrl" } &
839        stdObjectNodeAttributes &
840        stdWindowProperties &
841        [xrc:p="o"] element defaultfolder {_, t_string }* &
842        [xrc:p="o"] element filter        {_, t_text }* &
843        [xrc:p="o"] element defaultfilter {_, t_integer }*
844    }
845
846
847wxGrid =
848    element object {
849        attribute class { "wxGrid" } &
850        stdObjectNodeAttributes &
851        stdWindowProperties
852    }
853
854
855wxHtmlWindow =
856    element object {
857        attribute class { "wxHtmlWindow" } &
858        stdObjectNodeAttributes &
859        stdWindowProperties &
860        [xrc:p="o"](
861            element url       {_, t_url } |
862            element htmlcode  {_, t_text }
863        )* &
864        [xrc:p="o"] element borders {_, t_dimension }*
865    }
866
867
868wxHyperlinkCtrl =
869    element object {
870        attribute class { "wxHyperlinkCtrl" } &
871        stdObjectNodeAttributes &
872        stdWindowProperties &
873        [xrc:p="important"] element label {_, t_text }* &
874        [xrc:p="important"] element url   {_, t_url }*
875    }
876
877
878wxListBox =
879    element object {
880        attribute class { "wxListBox" } &
881        stdObjectNodeAttributes &
882        stdWindowProperties &
883        [xrc:p="o"] element selection {_, t_integer }* &
884        element content {
885            platform,
886            element item {_, t_text }*
887        }?
888    }
889
890
891wxListbook =
892    element object {
893        attribute class { "wxListbook" } &
894        stdObjectNodeAttributes &
895        stdWindowProperties &
896        [xrc:p="o"] element imagelist {_, t_imagelist }* &
897        (wxListbook_listbookpage | objectRef)*
898    }
899
900wxListbook_listbookpage =
901    element object {
902        attribute class { "listbookpage" } &
903        [xrc:p="important"] element label {_, t_text }* &
904        [xrc:p="o"](
905            element bitmap {_, t_bitmap } |
906            element image  {_, t_integer }
907        )* &
908        [xrc:p="o"] element selected {_, t_bool }* &
909        windowNode
910    }
911
912
913wxListCtrl =
914    element object {
915        attribute class { "wxListCtrl" } &
916        stdObjectNodeAttributes &
917        stdWindowProperties &
918        [xrc:p="o"] element imagelist {_, t_imagelist }* &
919        [xrc:p="o"] element imagelist-small {_, t_imagelist }* &
920        (wxListCtrl_listcol | wxListCtrl_listitem | objectRef)*
921    }
922
923wxListCtrl_listcol =
924    element object {
925        attribute class { "listcol" } &
926        platform &
927        [xrc:p="o"] element align   {_, ("wxLIST_FORMAT_LEFT" | "wxLIST_FORMAT_RIGHT" |
928                                         "wxLIST_FORMAT_CENTRE") }* &
929        [xrc:p="o"] element text    {_, t_text }* &
930        [xrc:p="o"] element width   {_, t_integer }* &
931        [xrc:p="o"] element image   {_, t_integer }*
932    }
933
934wxListCtrl_listitem =
935    element object {
936        attribute class { "listitem" } &
937        platform &
938        [xrc:p="o"] element align        {_, ("wxLIST_FORMAT_LEFT" | "wxLIST_FORMAT_RIGHT" |
939                                              "wxLIST_FORMAT_CENTRE") }* &
940        [xrc:p="o"] element bg           {_, t_colour }* &
941        [xrc:p="o"] element col          {_, t_integer }* &
942        [xrc:p="o"] element data         {_, t_integer }* &
943        [xrc:p="o"] element font         {_, t_font }* &
944        [xrc:p="o"] element state        {_, ("wxLIST_STATE_FOCUSED" | "wxLIST_STATE_SELECTED") }* &
945        [xrc:p="o"] element text         {_, t_text }* &
946        [xrc:p="o"] element textcolour   {_, t_colour }* &
947        [xrc:p="o"](
948            element bitmap   {_, t_bitmap } |
949            element image    {_, t_integer }
950        )* &
951        [xrc:p="o"](
952            element bitmap-small {_, t_bitmap } |
953            element image-small  {_, t_integer }
954        )*
955    }
956
957
958wxMDIParentFrame =
959    element object {
960        attribute class { "wxMDIParentFrame" } &
961        stdObjectNodeAttributes &
962        stdWindowProperties &
963        [xrc:p="o"] element title    {_, t_text }* &
964        [xrc:p="o"] element icon     {_, t_bitmap }* &
965        [xrc:p="o"] element centered {_, t_bool }* &
966        (wxMDIChildFrame | objectRef)*
967    }
968
969wxMDIChildFrame =
970    element object {
971        attribute class { "wxMDIChildFrame" } &
972        stdObjectNodeAttributes &
973        stdWindowProperties &
974        [xrc:p="o"] element title    {_, t_text }* &
975        [xrc:p="o"] element icon     {_, t_bitmap }* &
976        [xrc:p="o"] element centered {_, t_bool }* &
977        (sizerNode | windowNode* )?
978    }
979
980
981wxMenuBar =
982    element object {
983        attribute class { "wxMenuBar" } &
984        stdObjectNodeAttributes &
985        [xrc:p="o"] element style {_, t_style }* &
986        (wxMenu | objectRef)*
987    }
988
989wxMenu =
990    element object {
991        attribute class { "wxMenu" } &
992        stdObjectNodeAttributes &
993        [xrc:p="o"] element label   {_, t_text }* &
994        [xrc:p="o"] element style   {_, t_style }* &
995        [xrc:p="o"] element help    {_, t_text }* &
996        [xrc:p="o"] element enabled {_, t_bool }* &
997        (
998            wxMenuItem |
999            wxMenu |
1000            objectRef |
1001            element object { attribute class { "separator" }, platform } |
1002            element object { attribute class { "break" },     platform }
1003        )*
1004    }
1005
1006wxMenuItem =
1007    element object {
1008        attribute class { "wxMenuItem" } &
1009        stdObjectNodeAttributes &
1010        [xrc:p="o"] element label     {_, t_text }* &
1011        [xrc:p="o"] element accel     {_, t_text }* &
1012        [xrc:p="o"] element radio     {_, t_bool }* &
1013        [xrc:p="o"] element checkable {_, t_bool }* &
1014        [xrc:p="o"] element bitmap    {_, t_bitmap }* &
1015        [xrc:p="o"] element bitmap2   {_, t_bitmap }* &
1016        [xrc:p="o"] element help      {_, t_text }* &
1017        [xrc:p="o"] element enabled   {_, t_bool }* &
1018        [xrc:p="o"] element checked   {_, t_bool }*
1019    }
1020
1021
1022wxNotebook =
1023    element object {
1024        attribute class { "wxNotebook" } &
1025        stdObjectNodeAttributes &
1026        stdWindowProperties &
1027        [xrc:p="o"] element imagelist {_, t_imagelist }* &
1028        (wxNotebook_notebookpage | objectRef)*
1029    }
1030
1031wxNotebook_notebookpage =
1032    element object {
1033        attribute class { "notebookpage" } &
1034        platform &
1035        [xrc:p="important"] element label {_, t_text }* &
1036        (
1037            element bitmap {_, t_bitmap } |
1038            element image  {_, t_integer }
1039        )? &
1040        [xrc:p="o"] element selected {_, t_bool }* &
1041        windowNode
1042    }
1043
1044
1045wxOwnerDrawnComboBox =
1046    element object {
1047        attribute class { "wxOwnerDrawnComboBox" } &
1048        stdObjectNodeAttributes &
1049        stdWindowProperties &
1050        [xrc:p="o"] element selection  {_, t_integer }* &
1051        [xrc:p="o"] element value      {_, t_string }* &
1052        [xrc:p="o"] element buttonsize {_, t_size }* &
1053        element content {
1054            platform,
1055            element item {_, t_text }*
1056        }?
1057    }
1058
1059
1060wxPanel =
1061    element object {
1062        attribute class { "wxPanel" } &
1063        stdObjectNodeAttributes &
1064        stdWindowProperties &
1065        (sizerNode | windowNode* )?
1066    }
1067
1068
1069wxPropertySheetDialog =
1070    element object {
1071        attribute class { "wxPropertySheetDialog" } &
1072        stdObjectNodeAttributes &
1073        stdWindowProperties &
1074        [xrc:p="o"] element title    {_, t_text }* &
1075        [xrc:p="o"] element icon     {_, t_bitmap }* &
1076        [xrc:p="o"] element centered {_, t_bool }* &
1077        [xrc:p="o"] element buttons  {_, t_style }* &
1078        (wxNotebook_notebookpage | objectRef)*
1079    }
1080
1081wxPropertySheetDialog_propertysheetpage =
1082    element object {
1083        attribute class { "propertysheetpage" } &
1084        platform &
1085        [xrc:p="important"] element label {_, t_text }* &
1086        [xrc:p="o"] element bitmap {_, t_bitmap }* &
1087        [xrc:p="o"] element selected {_, t_bool }* &
1088        windowNode
1089    }
1090
1091
1092wxRadioButton =
1093    element object {
1094        attribute class { "wxRadioButton" } &
1095        stdObjectNodeAttributes &
1096        stdWindowProperties &
1097        [xrc:p="important"] element label {_, t_text }* &
1098        [xrc:p="o"] element value {_, t_bool }*
1099    }
1100
1101
1102wxRadioBox =
1103    element object {
1104        attribute class { "wxRadioBox" } &
1105        stdObjectNodeAttributes &
1106        stdWindowProperties &
1107        [xrc:p="important"] element label {_, t_text }* &
1108        [xrc:p="o"] element dimension {_, t_integer }* &
1109        [xrc:p="o"] element selection {_, t_integer }* &
1110        element content {
1111            platform,
1112            element item {
1113                platform,
1114                attribute tooltip  { t_string }?,
1115                attribute helptext { t_string }?,
1116                attribute enabled  { t_bool }?,
1117                attribute hidden   { t_bool }?,
1118                t_text
1119            }*
1120        }?
1121    }
1122
1123
1124wxRibbonBar =
1125    element object {
1126        attribute class { "wxRibbonBar" } &
1127        stdObjectNodeAttributes &
1128        stdWindowProperties &
1129        [xrc:p="o"] element art-provider {_, ("default" | "aui" | "msw") }* &
1130        (wxRibbonPage | objectRef)*
1131    }
1132
1133wxRibbonButtonBar =
1134    element object {
1135        attribute class { "wxRibbonButtonBar" } &
1136        stdObjectNodeAttributes &
1137        stdWindowProperties &
1138        (wxRibbonButtonBar_button | objectRef)*
1139    }
1140
1141wxRibbonButtonBar_button =
1142    element object {
1143        attribute class { "button" } &
1144        stdObjectNodeAttributes &
1145        [xrc:p="o"] element hybrid                {_, t_bool }* &
1146        [xrc:p="o"] element disabled              {_, t_bool }* &
1147        [xrc:p="important"] element label         {_, t_text }* &
1148        [xrc:p="important"] element bitmap        {_, t_bitmap }* &
1149        [xrc:p="o"] element small-bitmap          {_, t_bitmap }* &
1150        [xrc:p="o"] element disabled-bitmap       {_, t_bitmap }* &
1151        [xrc:p="o"] element small-disabled-bitmap {_, t_bitmap }* &
1152        [xrc:p="o"] element help                  {_, t_text }*
1153    }
1154
1155wxRibbonControl =
1156    element object {
1157        attribute class { "wxRibbonControl" } &
1158        attribute subclass { t_identifier } & # must be subclassed
1159        attribute name     { t_identifier }? &
1160        platform
1161    }
1162
1163wxRibbonGallery =
1164    element object {
1165        attribute class { "wxRibbonGallery" } &
1166        stdObjectNodeAttributes &
1167        stdWindowProperties &
1168        (wxRibbonGallery_item | objectRef)*
1169    }
1170
1171wxRibbonGallery_item =
1172    element object {
1173        attribute class { "item" } &
1174        stdObjectNodeAttributes &
1175        [xrc:p="o"] element bitmap {_, t_bitmap }*
1176    }
1177
1178wxRibbonPage =
1179    element object {
1180        # unfortunately, wxRibbonXmlHandler supports "page" alias
1181        attribute class { "wxRibbonPage" | "page" } &
1182        stdObjectNodeAttributes &
1183        stdWindowProperties &
1184        [xrc:p="o"] element label {_, t_text }* &
1185        [xrc:p="o"] element icon  {_, t_bitmap }* &
1186        (wxRibbon_anyControl | objectRef)*
1187    }
1188
1189wxRibbonPanel =
1190    element object {
1191        # unfortunately, wxRibbonXmlHandler supports "panel" alias
1192        attribute class { "wxRibbonPanel" | "panel" } &
1193        stdObjectNodeAttributes &
1194        stdWindowProperties &
1195        [xrc:p="o"] element label {_, t_text }* &
1196        [xrc:p="o"] element icon  {_, t_bitmap }* &
1197        (sizerNode | wxRibbon_anyControl | objectRef)*
1198    }
1199
1200wxRibbon_anyControl = wxRibbonBar | wxRibbonButtonBar | wxRibbonControl |
1201                      wxRibbonGallery | wxRibbonPanel
1202
1203
1204wxRichTextCtrl =
1205    element object {
1206        attribute class { "wxRichTextCtrl" } &
1207        stdObjectNodeAttributes &
1208        stdWindowProperties &
1209        [xrc:p="o"] element value     {_, t_text }* &
1210        [xrc:p="o"] element maxlength {_, t_integer }*
1211    }
1212
1213
1214wxScrollBar =
1215    element object {
1216        attribute class { "wxScrollBar" } &
1217        stdObjectNodeAttributes &
1218        stdWindowProperties &
1219        [xrc:p="o"] element value     {_, t_integer }* &
1220        [xrc:p="o"] element range     {_, t_integer }* &
1221        [xrc:p="o"] element thumbsize {_, t_integer }* &
1222        [xrc:p="o"] element pagesize  {_, t_integer }*
1223    }
1224
1225
1226wxScrolledWindow =
1227    element object {
1228        attribute class { "wxScrolledWindow" } &
1229        stdObjectNodeAttributes &
1230        stdWindowProperties &
1231        [xrc:p="o"] element scrollrate {_, t_size }* &
1232        (sizerNode | windowNode* )?
1233    }
1234
1235
1236wxSimpleHtmlListBox =
1237    element object {
1238        attribute class { "wxSimpleHtmlListBox" } &
1239        stdObjectNodeAttributes &
1240        stdWindowProperties &
1241        [xrc:p="o"] element selection {_, t_integer }* &
1242        element content {
1243            platform,
1244            element item {_, t_text }*
1245        }?
1246    }
1247
1248
1249wxSimplebook =
1250    element object {
1251        attribute class { "wxSimplebook" } &
1252        stdObjectNodeAttributes &
1253        stdWindowProperties &
1254        (wxSimplebook_simplebookpage | objectRef)*
1255    }
1256
1257wxSimplebook_simplebookpage =
1258    element object {
1259        attribute class { "simplebookpage" } &
1260        platform &
1261        element label {_, t_text }* &
1262        [xrc:p="o"] element selected {_, t_bool }* &
1263        windowNode
1264    }
1265
1266
1267wxSlider =
1268    element object {
1269        attribute class { "wxSlider" } &
1270        stdObjectNodeAttributes &
1271        stdWindowProperties &
1272        [xrc:p="o"] element value    {_, t_integer }* &
1273        [xrc:p="o"] element min      {_, t_integer }* &
1274        [xrc:p="o"] element max      {_, t_integer }* &
1275        [xrc:p="o"] element pagesize {_, t_integer }* &
1276        [xrc:p="o"] element linesize {_, t_integer }* &
1277        [xrc:p="o"] element tickfreq {_, t_integer }* &
1278        [xrc:p="o"] element tick     {_, t_integer }* &
1279        [xrc:p="o"] element thumb    {_, t_integer }* &
1280        [xrc:p="o"] element selmin   {_, t_integer }* &
1281        [xrc:p="o"] element selmax   {_, t_integer }*
1282    }
1283
1284
1285wxSpinButton =
1286    element object {
1287        attribute class { "wxSpinButton" } &
1288        stdObjectNodeAttributes &
1289        stdWindowProperties &
1290        [xrc:p="o"] element value {_, t_integer }* &
1291        [xrc:p="o"] element min   {_, t_integer }* &
1292        [xrc:p="o"] element max   {_, t_integer }*
1293    }
1294
1295
1296wxSpinCtrl =
1297    element object {
1298        attribute class { "wxSpinCtrl" } &
1299        stdObjectNodeAttributes &
1300        stdWindowProperties &
1301        [xrc:p="o"] element value {_, t_integer }* &
1302        [xrc:p="o"] element min   {_, t_integer }* &
1303        [xrc:p="o"] element max   {_, t_integer }* &
1304        [xrc:p="o"] element base  {_, ("10" | "16") }*
1305    }
1306
1307
1308wxSplitterWindow =
1309    element object {
1310        attribute class { "wxSplitterWindow" } &
1311        stdObjectNodeAttributes &
1312        stdWindowProperties &
1313        [xrc:p="o"] element orientation {_, ("vertical" | "horizontal") }* &
1314        [xrc:p="o"] element sashpos     {_, t_dimension }* &
1315        [xrc:p="o"] element minsize     {_, t_dimension }* &
1316        [xrc:p="o"] element gravity     {_, t_float }* &
1317        (windowNode, windowNode?) # 1 or 2 child windows
1318    }
1319
1320
1321wxSearchCtrl =
1322    element object {
1323        attribute class { "wxSearchCtrl" } &
1324        stdObjectNodeAttributes &
1325        stdWindowProperties &
1326        [xrc:p="o"] element value {_, t_text }*
1327    }
1328
1329
1330wxStatusBar =
1331    element object {
1332        attribute class { "wxStatusBar" } &
1333        stdObjectNodeAttributes &
1334        stdWindowProperties &
1335        [xrc:p="o"] element fields {_, t_integer }* &
1336        [xrc:p="o"] element widths {_, t_list_of_numbers }* &
1337        [xrc:p="o"] element styles {_, xsd:string { pattern = "wxSB_(NORMAL|FLAT|RAISED|SUNKEN)(,wxSB_(NORMAL|FLAT|RAISED|SUNKEN))*" } }*
1338    }
1339
1340
1341wxStaticBitmap =
1342    element object {
1343        attribute class { "wxStaticBitmap" } &
1344        stdObjectNodeAttributes &
1345        stdWindowProperties &
1346        element bitmap {_, t_bitmap }
1347    }
1348
1349
1350wxStaticBox =
1351    element object {
1352        attribute class { "wxStaticBox" } &
1353        stdObjectNodeAttributes &
1354        stdWindowProperties &
1355        [xrc:p="important"] element label {_, t_text }*
1356    }
1357
1358
1359wxStaticLine =
1360    element object {
1361        attribute class { "wxStaticLine" } &
1362        stdObjectNodeAttributes &
1363        stdWindowProperties
1364    }
1365
1366
1367wxStaticText =
1368    element object {
1369        attribute class { "wxStaticText" } &
1370        stdObjectNodeAttributes &
1371        stdWindowProperties &
1372        [xrc:p="important"] element label {_, t_text }* &
1373        [xrc:p="o"] element wrap  {_, t_dimension }*
1374    }
1375
1376
1377wxTextCtrl =
1378    element object {
1379        attribute class { "wxTextCtrl" } &
1380        stdObjectNodeAttributes &
1381        stdWindowProperties &
1382        [xrc:p="o"] element value     {_, t_text }* &
1383        [xrc:p="o"] element maxlength {_, t_integer }* &
1384        [xrc:p="o"] element hint      {_, t_text }*
1385    }
1386
1387
1388wxTimePickerCtrl =
1389    element object {
1390        attribute class { "wxTimePickerCtrl" } &
1391        stdObjectNodeAttributes &
1392        stdWindowProperties
1393    }
1394
1395
1396wxToggleButton =
1397    element object {
1398        attribute class { "wxToggleButton" } &
1399        stdObjectNodeAttributes &
1400        stdWindowProperties &
1401        [xrc:p="important"] element label {_, t_text }* &
1402        [xrc:p="o"] element checked {_, t_bool }*
1403    }
1404
1405
1406wxToolBar =
1407    element object {
1408        attribute class { "wxToolBar" } &
1409        stdObjectNodeAttributes &
1410        stdWindowProperties &
1411        [xrc:p="o"] element bitmapsize        {_, t_size }* &
1412        [xrc:p="o"] element margins           {_, t_size }* &
1413        [xrc:p="o"] element packing           {_, t_integer }* &
1414        [xrc:p="o"] element separation        {_, t_integer }* &
1415        [xrc:p="o"] element dontattachtoframe {_, t_bool }* &
1416        (
1417            windowNode |
1418            wxToolBar_tool |
1419            element object { attribute class { "separator" }, platform } |
1420            element object { attribute class { "space" },     platform }
1421        )*
1422    }
1423
1424wxToolBar_tool =
1425    element object {
1426        attribute class { "tool" } &
1427        stdObjectNodeAttributes &
1428        [xrc:p="important"] element bitmap {_, t_bitmap }* &
1429        [xrc:p="o"] element bitmap2  {_, t_bitmap }* &
1430        [xrc:p="o"] element label    {_, t_text }* &
1431        [xrc:p="o"] element tooltip  {_, t_text }* &
1432        [xrc:p="o"] element longhelp {_, t_text }* &
1433        [xrc:p="o"] element disabled {_, t_bool }* &
1434        [xrc:p="o"] element checked  {_, t_bool }* &
1435        [xrc:p="o"](
1436            element radio    {_, t_bool } |
1437            element toggle   {_, t_bool } |
1438            element dropdown {_, wxMenu? }
1439        )*
1440    }
1441
1442
1443wxToolbook =
1444    element object {
1445        attribute class { "wxToolbook" } &
1446        stdObjectNodeAttributes &
1447        stdWindowProperties &
1448        [xrc:p="o"] element imagelist {_, t_imagelist }* &
1449        (wxToolbook_toolbookpage | objectRef)*
1450    }
1451
1452wxToolbook_toolbookpage =
1453    element object {
1454        attribute class { "toolbookpage" } &
1455        platform &
1456        [xrc:p="important"] element label {_, t_text }* &
1457        [xrc:p="o"](
1458            element bitmap {_, t_bitmap } |
1459            element image  {_, t_integer }
1460        )* &
1461        [xrc:p="o"] element selected {_, t_bool }* &
1462        windowNode
1463    }
1464
1465
1466wxTreeCtrl =
1467    element object {
1468        attribute class { "wxTreeCtrl" } &
1469        stdObjectNodeAttributes &
1470        stdWindowProperties &
1471        [xrc:p="o"] element imagelist {_, t_imagelist }*
1472    }
1473
1474
1475wxTreebook =
1476    element object {
1477        attribute class { "wxTreebook" } &
1478        stdObjectNodeAttributes &
1479        stdWindowProperties &
1480        [xrc:p="o"] element imagelist {_, t_imagelist }* &
1481        (wxTreebook_treebookpage | objectRef)*
1482    }
1483
1484wxTreebook_treebookpage =
1485    element object {
1486        attribute class { "treebookpage" } &
1487        platform &
1488        [xrc:p="important"] element depth {_, t_integer }* &
1489        [xrc:p="important"] element label {_, t_text }* &
1490        [xrc:p="o"](
1491            element bitmap {_, t_bitmap } |
1492            element image  {_, t_integer }
1493        )* &
1494        [xrc:p="o"] element selected {_, t_bool }* &
1495        [xrc:p="o"] element expanded {_, t_bool }* &
1496        windowNode
1497    }
1498
1499
1500wxWizard =
1501    element object {
1502        attribute class { "wxWizard" } &
1503        stdObjectNodeAttributes &
1504        stdWindowProperties &
1505        [xrc:p="o"] element title  {_, t_text }* &
1506        [xrc:p="o"] element bitmap {_, t_bitmap }* &
1507        (wxWizardPage_any | objectRef)*
1508    }
1509
1510wxWizardPage_any =
1511    element object {
1512        attribute class { "wxWizardPage" | "wxWizardPageSimple" } &
1513        stdObjectNodeAttributes &
1514        stdWindowProperties &
1515        [xrc:p="o"] element bitmap {_, t_bitmap }* &
1516        (sizerNode | windowNode* )?
1517    }
1518
1519
1520
1521
1522wxSizer_item =
1523    element object {
1524        (
1525            (
1526                attribute class { "spacer" } &
1527                [xrc:p="o"] element size {_, t_size }*
1528            )
1529            |
1530            (
1531                attribute class { "sizeritem" } &
1532                (windowNode | sizerNode)
1533            )
1534        ) &
1535        stdObjectNodeAttributes &
1536        [xrc:p="o"] element option   {_, t_integer }* &
1537        [xrc:p="o"] element border   {_, t_dimension }* &
1538        [xrc:p="o"] element minsize  {_, t_size }* &
1539        [xrc:p="o"] element ratio    {_, t_size }* &
1540        # TODO: cell{pos,span} are wxGridBagSizer-only and required in it, this is too lax
1541        [xrc:p="o"] element cellpos  {_, t_position }* &
1542        [xrc:p="o"] element cellspan {_, t_size }* &
1543        [xrc:p="o"] element flag     {_,
1544            xsd:string {
1545                pattern = "(wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxNORTH|wxSOUTH|wxEAST|wxWEST|wxALL|wxGROW|wxEXPAND|wxSHAPED|wxSTRETCH_NOT|wxALIGN_CENTER|wxALIGN_CENTRE|wxALIGN_LEFT|wxALIGN_RIGHT|wxALIGN_TOP|wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTRE_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTRE_VERTICAL)( *\| *(wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxNORTH|wxSOUTH|wxEAST|wxWEST|wxALL|wxGROW|wxEXPAND|wxSHAPED|wxSTRETCH_NOT|wxALIGN_CENTER|wxALIGN_CENTRE|wxALIGN_LEFT|wxALIGN_RIGHT|wxALIGN_TOP|wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTRE_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTRE_VERTICAL))*"
1546            }
1547        }*
1548    }
1549
1550wxBoxSizer =
1551    element object {
1552        attribute class { "wxBoxSizer" } &
1553        stdObjectNodeAttributes &
1554        [xrc:p="o"] element minsize {_, t_size }* &
1555        [xrc:p="o"] element orient  {_, ("wxHORIZONTAL" | "wxVERTICAL") }* &
1556        (wxSizer_item | objectRef)*
1557    }
1558
1559wxStaticBoxSizer =
1560    element object {
1561        attribute class { "wxStaticBoxSizer" } &
1562        stdObjectNodeAttributes &
1563        [xrc:p="o"] element minsize {_, t_size }* &
1564        [xrc:p="important"] element label {_, t_text }* &
1565        [xrc:p="o"] element orient  {_, ("wxHORIZONTAL" | "wxVERTICAL") }* &
1566        (wxSizer_item | objectRef)*
1567    }
1568
1569wxGridSizer =
1570    element object {
1571        attribute class { "wxGridSizer" } &
1572        stdObjectNodeAttributes &
1573        [xrc:p="o"] element minsize {_, t_size }* &
1574        [xrc:p="o"] element rows    {_, t_unsigned }* &
1575        [xrc:p="o"] element cols    {_, t_unsigned }* &
1576        [xrc:p="o"] element vgap    {_, t_dimension }* &
1577        [xrc:p="o"] element hgap    {_, t_dimension }* &
1578        (wxSizer_item | objectRef)*
1579    }
1580
1581wxFlexGridSizer =
1582    element object {
1583        attribute class { "wxFlexGridSizer" } &
1584        stdObjectNodeAttributes &
1585        [xrc:p="o"] element minsize             {_, t_size }* &
1586        [xrc:p="o"] element rows                {_, t_unsigned }* &
1587        [xrc:p="o"] element cols                {_, t_unsigned }* &
1588        [xrc:p="o"] element vgap                {_, t_dimension }* &
1589        [xrc:p="o"] element hgap                {_, t_dimension }* &
1590        [xrc:p="o"] element flexibledirection   {_, ("wxVERTICAL" | "wxHORIZONTAL" | "wxBOTH") }* &
1591        [xrc:p="o"] element nonflexiblegrowmode {_, ("wxFLEX_GROWMODE_NONE" |
1592                                                     "wxFLEX_GROWMODE_SPECIFIED" |
1593                                                     "wxFLEX_GROWMODE_ALL") }* &
1594        [xrc:p="o"] element growablerows        {_, t_list_of_numbers_with_weights }* &
1595        [xrc:p="o"] element growablecols        {_, t_list_of_numbers_with_weights }* &
1596        (wxSizer_item | objectRef)*
1597    }
1598
1599wxGridBagSizer =
1600    element object {
1601        attribute class { "wxGridBagSizer" } &
1602        stdObjectNodeAttributes &
1603        [xrc:p="o"] element minsize             {_, t_size }* &
1604        [xrc:p="o"] element vgap                {_, t_dimension }* &
1605        [xrc:p="o"] element hgap                {_, t_dimension }* &
1606        [xrc:p="o"] element flexibledirection   {_, ("wxVERTICAL" | "wxHORIZONTAL" | "wxBOTH") }* &
1607        [xrc:p="o"] element nonflexiblegrowmode {_, ("wxFLEX_GROWMODE_NONE" |
1608                                                     "wxFLEX_GROWMODE_SPECIFIED" |
1609                                                     "wxFLEX_GROWMODE_ALL") }* &
1610        [xrc:p="o"] element growablerows        {_, t_list_of_numbers_with_weights }* &
1611        [xrc:p="o"] element growablecols        {_, t_list_of_numbers_with_weights }* &
1612        (wxSizer_item | objectRef)*
1613    }
1614
1615wxWrapSizer =
1616    element object {
1617        attribute class { "wxWrapSizer" } &
1618        stdObjectNodeAttributes &
1619        [xrc:p="o"] element minsize {_, t_size }* &
1620        [xrc:p="important"] element orient {_, ("wxHORIZONTAL" | "wxVERTICAL") }* &
1621        [xrc:p="o"] element flag    {_, t_style }* &
1622        (wxSizer_item | objectRef)*
1623    }
1624
1625wxStdDialogButtonSizer =
1626    element object {
1627        attribute class { "wxStdDialogButtonSizer" } &
1628        stdObjectNodeAttributes &
1629        element object {
1630            attribute class { "button" },
1631            platform,
1632            (wxButton | customClasses | objectRef)
1633        }+
1634    }
1635