Source

LuaTools / Docs / luagui.rnc

Full commit
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"



## Structure and elements.
div
{
    start = lg.rootelements
    
    lg.rootelements =
        lg.app
    
    lg.app =
        ## The main application.
        element app { lg.appcontents }
        
    lg.appcontents =
        lg.app.attlist, lg.accelerator*, lg.frame, lg.dialog*, lg.execute*
        
    lg.accelerator =
        ## Accelerator keys that can call Lua functions.
        element accelerator { lg.accelerator.key.attribute, lg.accelerator.action.attribute }
    
    lg.frame =
        ## The primary window of the application.
        element frame { lg.frame.attlist, lg.frame.menubar?, lg.frame.containers+ }
        
    lg.frame.menubar =
        element menubar { lg.frame.menubar.attlist, lg.menubar.menu+}
        
    lg.menubar.menu =
        element menu { lg.menubar.menu.attlist,  (lg.menuitem | lg.menuspacer | lg.menubar.menu)+ }
        
    lg.menuitem =
        element menuitem { lg.menuitem.attlist }
        
    lg.menuspacer =
        element menuspacer { lg.menuspacer.attlist }
        
    lg.frame.containers =
        lg.toolbar | lg.panel
        
    lg.dialog =
        ## A dialog that the application can use.
        element dialog { lg.dialog.attlist, lg.dialog.containers*, (lg.dialog.panel, lg.dialog.containers*)? }
        
    lg.dialog.panel =
        ## The panel where the dialogs OK/Cancel/etc buttons are.
        element dialog-panel { lg.dialog.panel.attlist, lg.dialog.panel.contents }
        
    lg.execute =
        ## Contains either the text of a Lua function, or a reference to a filename to load and
        ## execute. The filename is always assumed to be relative to this XML file.
        element execute
        {
            lg.execute.loadfunc.attribute |
            (lg.execute.name.attribute?, lg.luafunction)
        }
        
    lg.toolbar =
        ## Creates a top-level toolbar. Toolbars can be anchored to the side of a frame.
        ## If the toolbar has no gripper, then it cannot be moved around.
        element toolbar { lg.toolbar.attlist, lg.windows* }
    
    lg.panel =
        ## Creates a top-level panel. Panels can be centered or anchored to a side of the frame.
        ## Panels are always tear-away.
        element panel { lg.panel.attlist, lg.windows* }
        
    lg.windows =
        lg.containers | lg.controls
        
    lg.containers =
        lg.tabs | lg.collpane | lg.scrollpane | lg.pane | lg.box | lg.sizer
        
    lg.dialog.containers =
        lg.tabs | lg.collpane | lg.scrollpane | lg.pane | lg.box | lg.sizer
        
    lg.tabs =
        ## Create a series of tab pages. Each tab can contain arbitrary controls.
        element tabs { lg.tabs.attlist, lg.tab+ }
        
    lg.tab =
        ## The tab pages themselves.
        element tab { lg.tab.attlist, lg.windows* }
    
    lg.collpane =
        ## A container that can be collapsed.
        element collpane { lg.collpane.attlist, lg.windows* }
        
    lg.scrollpane =
        ## A container that can be scrolled to see all of its contents.
        element scrollpane { lg.scrollpane.attlist, lg.windows* }
        
    lg.pane =
        ## A window container that can be referenced by id.
        element pane { lg.pane.attlist, lg.windows* }
        
    lg.sizer =
        ## A non-window container for controls that has no visuals for it.
        element sizer { lg.sizer.elem.attlist, lg.windows* }
        
    lg.box =
        ## Creates a named box that has a border around it. Used to group controls.
        element box { lg.box.attlist, lg.windows* }
        
    lg.controls =
        lg.button | lg.spacer | lg.checkbox | lg.checkbox3 | lg.static | lg.radiobuttons | lg.editbox |
        lg.spinner | lg.slider | lg.listbox | lg.dropdown | lg.luacontrol
    
    lg.button =
        ## Creates a simple text button control.
        element button { lg.button.attlist }
    
    lg.spacer =
        ## Adds some space within the parent control.
        element spacer { lg.spacer.attlist }
    
    lg.checkbox =
        ## Creates a checkbox.
        element checkbox { lg.checkbox.attlist }
        
    lg.checkbox3 =
        ## Creates a 3-state checkbox.
        element checkbox3 { lg.checkbox3.attlist }
    
    lg.static =
        ## Creates a static text box.
        element static { lg.static.attlist }
    
    lg.radiobuttons =
        ## Creates a series of radio buttons that act as a single control.
        element radiobuttons { lg.radiobuttons.attlist, lg.radio+ }
    
    lg.radio =
        ## Specifies the name and optionally a value for a radio button in a
        ## radiobuttons control.
        element radio { lg.radio.attlist }
    
    lg.editbox =
        ## Creates an editbox control. Can be single-line or multi-line.
        element editbox { lg.editbox.attlist }
    
    lg.spinner =
        ## Creates a text control with up/down buttons to change integers. Numbers must be within a
        ## specific range.
        element spinner { lg.spinner.attlist }
    
    lg.slider =
        ## Creates a slider control to select integer numbers. Can be vertical or horizontal.
        element slider { lg.slider.attlist }
    
    lg.listbox =
        ## Creates a list box.
        element listbox { lg.listbox.attlist }
    
    lg.dropdown =
        ## Creates a dropdown box.
        element dropdown { lg.dropdown.attlist }

    lg.dialog.panel.contents =
        lg.dialog.panel.btn.ok? &
        lg.dialog.panel.btn.cancel? &
        lg.dialog.panel.btn.yes? &
        lg.dialog.panel.btn.no?

    lg.dialog.panel.btn.ok =
        ## Creates an OK button in the dialog panel.
        element ok { lg.dialog.panel.btn.attlist }

    lg.dialog.panel.btn.cancel =
        ## Creates a cancel button in the dialog panel.
        element cancel { lg.dialog.panel.btn.attlist }

    lg.dialog.panel.btn.yes =
        ## Creates a yes button in the dialog panel.
        element yes { lg.dialog.panel.btn.attlist }

    lg.dialog.panel.btn.no =
        ## Creates a no button in the dialog panel.
        element no { lg.dialog.panel.btn.attlist }

    lg.luacontrol =
        ## Arbitrary controls that are defined by Lua functions.
        element luacontrol
        {
            attribute script { lg.luafunction },
            (attribute * - script {text})*,
            lg.controls*
        }
}


## Attribute Lists
div
{
    lg.app.attlist =
        lg.app.show.attribute?

    lg.frame.attlist =
        lg.orient.attribute?,
        lg.appWnd.title.attribute,
        lg.size
        
    lg.frame.menubar.attlist = empty
    
    lg.menubar.menu.attlist =
        lg.menu.name.attribute,
        lg.tip.attribute?
    
    lg.menuitem.attlist =
        lg.menuitem.name.attribute,
        lg.tip.attribute?,
        lg.menuitem.action.attribute?
    
    lg.menuspacer.attlist = empty
    
    lg.collpane.attlist =
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.text.attribute?,
        lg.collpane.collapsed.attribute?,
        lg.sizer.attlist
        
    lg.scrollpane.attlist =
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.sizer.attlist,
        lg.scrollpane.hscroll.attribute?,
        lg.scrollpane.vscroll.attribute?
    
    lg.pane.attlist =
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.sizer.attlist
    
    lg.sizer.elem.attlist =
        lg.size,
        lg.positioning.attlist,
        lg.sizer.attlist
    
    lg.panel.attlist =
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.sizer.attlist,
        lg.aui.attlist,
        lg.gripper.attribute?
    
    lg.toolbar.attlist =
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.sizer.attlist,
        lg.aui.toolbar.attlist,
        lg.gripper.attribute?
    
    lg.box.attlist =
        lg.text.attribute,
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.sizer.attlist?
    
    lg.tab.attlist =
        lg.text.attribute,
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.sizer.attlist
    
    lg.tabs.attlist =
        lg.id.attribute?,
        lg.size,
        lg.positioning.attlist,
        lg.tabs.onselchanged.attribute?
        
    lg.button.attlist =
        lg.text.attribute,
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.button.enabled.attribute?,
        lg.button.action.attribute?
    
    lg.spacer.attlist =
        lg.spacer.size.attribute?,
        lg.spacer.proportion.attribute?
    
    lg.checkbox.attlist =
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.text.attribute,
        lg.checkbox.default.attribute?,
        lg.checkbox.oncheck.attribute?,
        lg.checkbox.onuncheck.attribute?
    
    lg.checkbox3.attlist =
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.text.attribute,
        lg.checkbox3.default.attribute?,
        lg.checkbox3.user.attribute?,
        lg.checkbox3.action.attribute?
    
    lg.static.attlist =
        lg.text.attribute,
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist
    
    lg.radiobuttons.attlist =
        lg.orient.attribute?,
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.text.attribute,
        lg.radiobuttons.default.attribute?,
        lg.radiobuttons.action.attribute?
    
    lg.radio.attlist =
        lg.radio.name.attribute,
        lg.radio.value.attribute?
    
    lg.editbox.attlist =
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.label.attlist,
        lg.editbox.multiline.attribute?,
        lg.editbox.readonly.attribute?,
        lg.editbox.default.attribute?,
        lg.editbox.onentry.attribute?,
        lg.editbox.onchange.attribute?
    
    lg.spinner.attlist =
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.label.attlist,
        lg.spinner.min.attribute?,
        lg.spinner.max.attribute?,
        lg.spinner.default.attribute?,
        lg.spinner.wrap.attribute?,
        lg.spinner.onchange.attribute?
    
    lg.slider.attlist =
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.label.attlist,
        lg.slider.min.attribute?,
        lg.slider.max.attribute?,
        lg.slider.default.attribute?,
        lg.slider.ticks.attribute?,
        lg.slider.direction.attribute?,
        lg.slider.numticks.attribute?,
        lg.slider.onchange.attribute?
    
    lg.listbox.attlist =
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.listbox.type.attribute?,
        lg.listbox.sort.attribute?,
        lg.listbox.oncreate.attribute?,
        lg.listbox.onselchange.attribute?,
        lg.listbox.ondblclick.attribute?
    
    lg.dropdown.attlist =
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist,
        lg.label.attlist,
        lg.dropdown.edit.attribute?,
        lg.dropdown.sort.attribute?,
        lg.dropdown.oncreate.attribute?,
        lg.dropdown.onselchange.attribute?,
        lg.dropdown.onentry.attribute?
    
    lg.positioning.attlist =
        (lg.positioning.align.attribute | lg.positioning.halign.attribute)?,
        lg.positioning.valign.attribute?,
        lg.positioning.expand.attribute?,
        lg.positioning.proportion.attribute?,
        (lg.positioning.border.attribute | lg.positioning.vborder.attribute | lg.positioning.hborder.attribute)?
        
    lg.sizer.attlist =
        (
            lg.sizer.grid.attlist,
            lg.sizer.grid.other.attlist
        ) |
        lg.sizer.box.attlist?
        
    lg.sizer.box.attlist =
        lg.box.orient.attribute
        
    lg.sizer.grid.attlist =
        lg.gridsizer.numCols.attribute |
        lg.gridsizer.numRows.attribute |
        (lg.gridsizer.numCols.attribute, lg.gridsizer.numRows.attribute)
        
    lg.sizer.grid.other.attlist =
        lg.gridsizer.hGap.attribute?,
        lg.gridsizer.vGap.attribute?,
        lg.gridsizer.fixedGrid.attribute?,
        lg.gridsizer.colProportion.attribute?,
        lg.gridsizer.rowProportion.attribute?
    
    lg.aui.attlist =
        lg.aui.title.attribute?,
        (lg.aui.direction.attribute | lg.aui.centerpane.attribute),
        lg.aui.row.attribute?,
        lg.aui.maximizebutton.attribute?,
        lg.aui.floatable.attribute?,
        lg.aui.resizable.attribute?
    


    lg.aui.toolbar.attlist =
        lg.aui.direction.attribute,
        lg.aui.row.attribute?,
        lg.aui.resizable.attribute?

    lg.std.window.attlist =
        lg.tip.attribute?, lg.id.attribute?
    
    lg.std.control.attlist =
        lg.std.window.attlist,
        lg.size,
        lg.positioning.attlist
    
    lg.size =
        (lg.width.attribute?, lg.height.attribute?)
        
    lg.label.attlist =
        lg.label.attribute? | lg.vlabel.attribute?
        
    lg.dialog.attlist =
        lg.dialog.title.attribute?,
        lg.id.attribute,
        lg.resizeable.attribute?,
        lg.size,
        lg.sizer.attlist

    lg.dialog.panel.attlist =
        lg.positioning.attlist

    lg.dialog.panel.btn.attlist =
        lg.dialog.panel.script.attribute?
}

## Attribute definitions.
div
{
    lg.app.show.attribute =
        ## If false, then the main window will not be displayed automatically; you must manually
        ## show it.
        [ a:defaultValue = "true"]
        attribute show {lg.data.boolean}
        
    lg.menu.name.attribute =
        attribute name { text }
        
    lg.menuitem.name.attribute =
        attribute name { text }
        
    lg.menuitem.action.attribute =
        attribute action { lg.luafunction }

    lg.label.attribute =
        ## The label for this control. It will be offset to the left of the control.
        attribute label { text }
    
    lg.vlabel.attribute =
        ## The label for this control. It will be vertically above the control.
        attribute vlabel { text }

    lg.dropdown.edit.attribute =
        ## Set to true if you want the ability to change the text in an dropdown.
        [ a:defaultValue = "false" ]
        attribute edit { lg.data.boolean }

    lg.dropdown.sort.attribute =
        ## Set to true if you want the entries in the dropdown box to be sorted.
        [ a:defaultValue = "false" ]
        attribute sort { lg.data.boolean }

    lg.dropdown.oncreate.attribute =
        ## A Lua function that is called after this control is created. The parameter
        ## to the function is the control itself.
        attribute oncreate { lg.luafunction }

    lg.dropdown.onselchange.attribute =
        ## A Lua function that is called whenever an item in the dropdown is selected.
        ## The function is given the event as a parameter.
        attribute onselchange { lg.luafunction }
        
    lg.dropdown.onentry.attribute =
        ## A Lua function that is called when the text is changed by the user and enter is pressed.
        ## The function is given the event as a parameter.
        attribute onentry { lg.luafunction }

    lg.listbox.type.attribute =
        ## The kind of listbox. There are three possibilities.
        ##
        ## "single": The list box allows single selection.
        ##
        ## "multiple": The list box allows shift and ctrl-selection of multiple entries.
        ##
        ## "multichoice": The list box allows the user to select multiple entries by left-clicking
        ## to add/remove each individual entry.
        [a:defaultValue = "single"]
        attribute type { "single" | "multichoice" | "multiple" }

    lg.listbox.sort.attribute =
        ## Set to true if you want the entries in the list box to be sorted.
        [ a:defaultValue = "false" ]
        attribute sort { lg.data.boolean }
        
    lg.listbox.oncreate.attribute =
        ## A Lua function that is called after this control is created. The parameter
        ## to the function is the control itself.
        attribute oncreate { lg.luafunction }
    
    lg.listbox.onselchange.attribute =
        ## A Lua function that is called whenever the set of selections changes.
        ## The function is given the event as a parameter.
        attribute onselchange { lg.luafunction }
    
    lg.listbox.ondblclick.attribute =
        ## A Lua function that is called whenever an item is double clicked. The function
        ## is given the event as a parameter.
        attribute ondblclick { lg.luafunction }

    lg.slider.min.attribute =
        ## Sets the lower bounds of the spinner.
        [ a:defaultValue = "0" ]
        attribute min { xsd:integer }
    
    lg.slider.max.attribute =
        ## Sets the upper bounds of the spinner.
        [ a:defaultValue = "100" ]
        attribute max { xsd:integer }
    
    lg.slider.default.attribute =
        ## Sets the initial value, which should be between min and max.
        [ a:defaultValue = "50" ]
        attribute default { xsd:integer }
    
    lg.slider.ticks.attribute =
        ## Set to true if you want to have tick marks.
        [ a:defaultValue = "false" ]
        attribute ticks { lg.data.boolean }
        
    lg.slider.direction.attribute =
        ## The direction of the slider, horizontal or vertical.
        [ a:defaultValue = "horizontal" ]
        attribute direction { "horizontal" | "vertical" }
    
    lg.slider.numticks.attribute =
        ## Set this to the number of tickmarks you want.
        [ a:defaultValue = "true" ]
        attribute numticks { xsd:positiveInteger }
    
    lg.slider.onchange.attribute =
        ## A Lua function that is called when the slider's value changes. The first parameter
        ## is the new value of the spinner, and the second is the spin control event.
        attribute onchange { lg.luafunction }

    lg.spinner.min.attribute =
        ## Sets the lower bounds of the spinner.
        [ a:defaultValue = "0" ]
        attribute min { xsd:integer }
    
    lg.spinner.max.attribute =
        ## Sets the upper bounds of the spinner.
        [ a:defaultValue = "100" ]
        attribute max { xsd:integer }
    
    lg.spinner.default.attribute =
        ## Sets the initial value, which should be between min and max.
        [ a:defaultValue = "50" ]
        attribute default { xsd:integer }
    
    lg.spinner.wrap.attribute =
        ## If set to true, then the spinner will wrap around when it reaches its boundaries.
        [ a:defaultValue = "false" ]
        attribute wrap { lg.data.boolean }
    
    lg.spinner.onchange.attribute =
        ## A Lua function that will be called when the spinner changes. The first parameter
        ## is the new value of the spinner, and the second is the spin control event.
        attribute onchange { lg.luafunction }

    lg.editbox.multiline.attribute =
        ## If set to true, then the edit box is multiline.
        [ a:defaultValue = "false" ]
        attribute multiline { lg.data.boolean }
    
    lg.editbox.readonly.attribute =
        ## If set to true, then the edit box's text cannot be changed.
        ## Only use this if you intend for it to be permanent.
        [ a:defaultValue = "false" ]
        attribute readonly { lg.data.boolean }
        
    lg.editbox.default.attribute =
        ## The initial text in an edit box.
        attribute default { text }
    
    lg.editbox.onentry.attribute =
        ## A Lua function that gets called when the user presses enter while writing in the edit
        ## box. The first parameter is the string the user entered in the box, and the second
        ## parameter is the event object.
        attribute onentry { lg.luafunction }
    
    lg.editbox.onchange.attribute =
        ## A Lua chunk that will be called when the user changes the text in any way. It is
        ## given the text in the box as the first parameter, and the event as the second.
        attribute onchange { lg.luafunction }

    lg.radio.name.attribute =
        ## The name of the radio button. Each radio button should have a unique name.
        attribute name { text }
    
    lg.radio.value.attribute =
        ## The string to be passed to the action function set on the radio button. If this is not
        ## present, the name of the radio button will be passed instead.
        attribute value { text }

    lg.radiobuttons.default.attribute =
        ## The name of the radio button that you want to be initially selected.
        attribute default { text }
    
    lg.radiobuttons.action.attribute =
        ## A Lua function that you want to be called when a radio button is selected. It gets two
        ## parameters: the value of the radio button (or the name, if no value was given), and the
        ## radio button event.
        attribute action { lg.luafunction }

    lg.checkbox.default.attribute =
        ## Set to true if the check box is to be initially in the set state. It gets no parameters.
        [ a:defaultValue = "false" ]
        attribute default { lg.data.boolean }
    
    lg.checkbox.oncheck.attribute =
        ## A Lua function that gets called when the checkbox is checked. It gets no parameters.
        attribute oncheck { lg.luafunction }

    lg.checkbox.onuncheck.attribute =
        ## A Lua function that gets called when the checkbox is un-checked. It gets no parameters.
        attribute onuncheck { lg.luafunction }

    lg.checkbox3.default.attribute =
        ## The initial state of the 3-state checkbox.
        attribute default { "true" | "false" | "undef" }
    
    lg.checkbox3.user.attribute =
        ## Tells whether the undefined state can be set by the user.
        attribute user { lg.data.boolean }
    
    lg.checkbox3.action.attribute =
        ## A Lua function that is called when the 3-state checkbox is clicked. It gets a parameter
        ## that is the new state (as an enum) and the command event.
        attribute action { lg.luafunction }

    lg.button.enabled.attribute =
        ## Set this to false if you want the button to start off disabled.
        [ a:defaultValue = "true" ]
        attribute enabled { lg.data.boolean }
    
    lg.button.action.attribute =
        ## A Lua function that gets called when the button is pressed. It gets the command event as a
        ## parameter.
        attribute action { lg.luafunction }

    lg.spacer.size.attribute =
        ## The quantity of space added by the spacer.
        [ a:defaultValue = "0" ]
        attribute size { xsd:integer }
    
    lg.spacer.proportion.attribute =
        ## Overrides the size in the progression direction when non-zero. If non-zero, then the progression
        ## direction size will be proportional to all other controls in this sizer. A value of 3
        ## will be 3x larger than those with a value of 1.
        ## If it is zero, it will use the exact size or the minimum size of the control if no size
        ## is specified.
        [ a:defaultValue = "0" ]
        attribute proportion { xsd:nonNegativeInteger }

    lg.collpane.collapsed.attribute =
        ## If true, then the pane starts off initially collapsed.
        [ a:defaultValue = "false" ]
        attribute collapsed { lg.data.boolean }
        
    lg.scrollpane.hscroll.attribute =
        [ a:defaultValue = "0" ]
        attribute hscroll { xsd:nonNegativeInteger }

    lg.scrollpane.vscroll.attribute =
        [ a:defaultValue = "0" ]
        attribute vscroll { xsd:nonNegativeInteger }
    
    lg.tabs.onselchanged.attribute =
        ## A Lua function that gets called whenever the tabs change. It is given a
        ## wxNotebookEvent object as a parameter.
        attribute onselchanged { lg.luafunction }
    
    lg.positioning.align.attribute =
        ## The alignment relative to the containing window/sizer.
        attribute align { "left" | "right" | "center" }
        
    lg.positioning.halign.attribute =
        ## The horizontal alignment relative to the containing area.
        attribute halign { "left" | "right" | "center" }
    
    lg.positioning.valign.attribute =
        ## The vertical alignment relative to the containing area.
        attribute valign { "top" | "bottom" | "center" }
        

    
    lg.positioning.expand.attribute =
        ## If true, the size of the control will be expanded to fit the available space
        ## in the fixed direction.
        [ a:defaultValue = "false"]
        attribute expand { lg.data.boolean }
    
    lg.positioning.proportion.attribute =
        ## Overrides the size in the progression direction when non-zero. If non-zero, then the progression
        ## direction size will be proportional to all other controls in this sizer. A value of 3
        ## will be 3x larger than those with a value of 1.
        ## If it is zero, it will use the exact size or the minimum size of the control if no size
        ## is specified.
        attribute proportion { xsd:nonNegativeInteger }
    
    lg.positioning.border.attribute =
        ## The size of the border around this control on all 4 sides.
        attribute border { xsd:nonNegativeInteger }
    
    lg.positioning.vborder.attribute =
        ## The size of the border around this control on the top and bottom sides.
        attribute vborder { xsd:nonNegativeInteger }
    
    lg.positioning.hborder.attribute =
        ## The size of the border around this control on the left and right sides.
        attribute hborder { xsd:nonNegativeInteger }
    
    lg.aui.title.attribute =
        ## The title of the panel. 
        attribute title { text }
        
    lg.aui.direction.attribute =
        ## The side of the frame window that this container is on.
        ## Cannot be used with "centerpane".
        attribute direction { "right" | "left" | "top" | "bottom" }
    
    lg.aui.row.attribute =
        ## ... I don't know.
        attribute row { xsd:nonNegativeInteger }
    
    lg.aui.centerpane.attribute =
        ## Puts this container in the center of the window. Only one container can have this,
        ## and it cannot be used with "direction".
        [ a:defaultValue = "false" ]
        attribute centerpane { lg.data.boolean }
    
    lg.aui.maximizebutton.attribute =
        ## If true, then the container will have a maximize button. Not all containers
        ## can use this.
        [ a:defaultValue = "false" ]
        attribute maximizebutton { lg.data.boolean }
        
    lg.aui.floatable.attribute =
        ## If true, then the panel can be floated. If false, it cannot be floated or moved.
        [ a:defaultValue = "true" ]
        attribute floatable { lg.data.boolean }
        
    lg.aui.resizable.attribute =
        ## If true, then the panel or toolbar can be resized. If false, it cannot be resized.
        ## For panels, this is true by default. For toolbars, it is false by default.
        attribute resizable { lg.data.boolean }
    
    lg.gripper.attribute =
        ## If true, then the toolbar will have a region that the user can use to reposition it.
        [ a:defaultValue = "true"]
        attribute gripper { lg.data.boolean }
    
    lg.appWnd.title.attribute =
        ## The name of the application window, to be displayed in the task bar and main window.
        attribute title { text }
        
    lg.dialog.title.attribute =
        ## The name of the dialog box, to be displayed in .
        attribute title { text }
    
    lg.appWnd.onload.attribute =
        ## A Lua function that is called after the main window is created. It gets one parameter,
        ## the wxFrameWnd being created.
        attribute onload { lg.luafunction }
    
    lg.width.attribute =
        ## The width of the control.
        attribute width { xsd:positiveInteger }
        
    lg.height.attribute =
        ## The height of the control.
        attribute height { xsd:positiveInteger }
        
    lg.orient.attribute =
        ## The stacking orientation for children of this node.
        [ a:defaultValue = "vertical" ]
        attribute orient { "horizontal" | "vertical" }
        
    lg.box.orient.attribute =
        lg.orient.attribute |
        (
        ## The box-layout stacking orientation for children of this node.
        [ a:defaultValue = "vertical" ]
        attribute box.orient { "horizontal" | "vertical" })
       
    lg.gridsizer.numCols.attribute =
        ## This represents the number of columns in a grid sizer. The presents of this
        ## attribute means that the sizer used for child windows will be a grid sizer
        ## with this many columns.
        attribute grid.numCols { xsd:nonNegativeInteger }
        
    lg.gridsizer.numRows.attribute =
        ## The number of rows in a grid sizer.
        [ a:defaultValue = "0" ]
        attribute grid.numRows { xsd:nonNegativeInteger }
        
    lg.gridsizer.hGap.attribute =
        ## The gap, in pixels, between two adjacent columns of a grid sizer.
        [ a:defaultValue = "0" ]
        attribute grid.hGap { xsd:nonNegativeInteger }
        
    lg.gridsizer.vGap.attribute =
        ## The gap, in pixels, between two adjacent rows of a grid sizzer.
        [ a:defaultValue = "0" ]
        attribute grid.vGap { xsd:nonNegativeInteger }
        
    lg.gridsizer.fixedGrid.attribute =
        ## If true, then the grid sizer's entries will be of a fixed size. All grid items will
        ## have the same width and height.
        [ a:defaultValue = "false"]
        attribute grid.fixed { lg.data.boolean }
        
    lg.gridsizer.colProportion.attribute =
        attribute grid.colProportion { text }

    lg.gridsizer.rowProportion.attribute =
        attribute grid.rowProportion { text }
        
    lg.id.attribute =
        ## The identifier of the control. This identifier allows the user to find a particular
        ## control in script code. The return value of "wndlua.ParseFile" has an "idWnds" field.
        ## Each window that has an 'id' field will have an entry in this table that matches the
        ## given id.
        ##
        ## If you use '.'s in the 'id', then these will represent subtables. For example,
        ## if you have id="first.second", then the location of the control will be
        ## access via "idWnds.first.second".
        attribute id { text }
    
    lg.resizeable.attribute =
        ## If true, then the dialog box can be resized
        [ a:defaultValue = "false" ]
        attribute resizeable { lg.data.boolean }
        
    lg.tip.attribute =
        ## The tooltip for the control.
        attribute tip { text }
        
    lg.text.attribute =
        attribute text { text }
    
    lg.accelerator.key.attribute =
        ## A key combination that will cause the Lua function specified by "action" to be called.
        attribute key { text }
        
    lg.accelerator.action.attribute =
        ## A Lua function that is called when the corresponding "key" combination is pressed.
        ## This function is given no parameters.
        attribute action { lg.luafunction }
        
    lg.dialog.panel.okbtn.attribute =
        ## If true, then the dialog panel will have an OK button.
        [ a:defaultValue = "false" ]
        attribute okbtn { lg.data.boolean }

    lg.dialog.panel.cancelbtn.attribute =
        ## If true, then the dialog panel will have an Cancel button.
        [ a:defaultValue = "false" ]
        attribute cancelbtn { lg.data.boolean }

    lg.dialog.panel.yesbtn.attribute =
        ## If true, then the dialog panel will have an Yes button.
        [ a:defaultValue = "false" ]
        attribute yesbtn { lg.data.boolean }

    lg.dialog.panel.nobtn.attribute =
        ## If true, then the dialog panel will have an No button.
        [ a:defaultValue = "false" ]
        attribute nobtn { lg.data.boolean }
        
    lg.dialog.panel.script.attribute =
        ## The message handler for a dialog standard button.
        attribute script { lg.luafunction }
        
    lg.execute.loadfunc.attribute =
        ## The filename to load. Relative to this file.
        attribute script-file { text }
        
    lg.execute.name.attribute =
        ## The name of this particular script. Given to Lua, so you can track down script errors.
        attribute script-name { text }
}

lg.data.boolean = "true" | "false"

lg.luafunction = text