WaxRF File Format
The WaxRF file format uses XML to represent the different controls and containers that Wax offers. The name of an XML node refers to the name of the control you wish to create, as per the same names you would use in code. Any attributes of that node are used as keyword arguments passed to the control's constructor. There are three special attributes though:
- _align: the alignment of the control, with respect to its parent container
- _border: the surrounding border of the control
- _expand: how this control behaves to resizing
As you can see, these three properties correspond to the same attributes used when calling AddComponent from within one's code.
A list of accepted controls are listed below
Bitmap
Accepts children:
No
Special information:
bmp attribute should refer to either a file or an Image object from within the WaxRF file
BitmapButton
Accepts children:
Special information:
bmp attribute should refer to either a file or an Image object from within the WaxRF file
Button
Accepts children:
No
Special information:
None
Canvas
Accepts children:
No
Special information:
None
CheckBox
Accepts children:
No
Special information:
a state attribute is available which accepts a 3 state value (checked, unchecked [default], or undetermined)
CheckListBox
Accepts children:
Yes (see special information)
Special information:
The children specified for the CheckListBox node will be the items that are found in the list box. These child nodes should contain a text attribute, which specifies the text associated with that item, and an optional checked attribute, which should be set to 1 for checked, or 0 for unchecked [default].
ComboBox
Accepts children:
Yes (see special information)
Special information:
The children specified for the ComboBox node will be the items that are found in combo box. These child nodes should contain a text attribute, which specifies the text associated with that item. There is also an optional text attribute for the ComboBox node which will be the default text found in the combo box.
Dialog
Accepts children:
Yes
Special information:
There is an optional buttonpanel attribute which specifies whether or not the dialog should default with Ok and Cancel buttons on the bottom (default is no buttons)
DropDownBox
Accepts children:
Yes (see special information)
Special information:
The children specified for the DropDownBox node will be the items that are found in the drop down box. These child nodes should contain a text attribute, which specifies the text associated with that item. There is also an optional selected attribute which, when set to 1, will specify that item to be the default selected item.
FileTreeView
Accepts children:
No
Special information:
None
FlexGridPanel
Accepts children:
Yes
Special information:
There are two different attribuets: grows and gcols, which should be comma separated lists specifying the index of the rows that are growable and the columns that are growable, respectively. The children will be added from left to right, top to bottom as specified in the WaxRF file.
Grid
Accepts children:
No
Special information:
<< The grid currently has basic support >>
GridPanel
Accepts children:
Yes
Special information:
The children will be added from left to right, top to bottom as specified in the WaxRF file.
GroupBox
Accepts children:
Yes
Special information:
None
HTMLWindow
Accepts children:
No
Special information:
None
HorizontalPanel
Accepts children:
Yes
Special information:
None
Image
Accepts children:
No (see special information)
Special information:
The text contained within this node is base64 encoded image data. Please use img2waxrf.py to add images to, and remove images from, a WaxRF file.
ImageList
Accepts children:
Yes (see special information)
Special information:
The ImageList node can contain child nodes which have two attributes: cmp, which refers to a either another Image node in the WaxRF file or an image on the local filesystem, and id, which is the id that will be attached to this bitmap in the image list.
Label
Accepts children:
No
Special information:
None
Line
Accepts children:
No
Special information:
None
ListBox
Accepts children:
Yes (see special information)
Special information:
See special information for DropDownBox
ListView
Accepts children:
Yes (see special information)
Special information:
The ListView node introduces two new attributes. The first is columns, which is a comma separated list of column headers. The second is colwidths, which is a comma separated list of default widths for the list view.
The children specified for the ListView node will be the rows found within the list view. Each row node has an optional num attribute, which specifies the position of this row. If not specified, the rows going in incremental order. Each row child can contain the same amount of children as the number of columns contained within the colums attribute of the ListView node. The text within these nodes is the default text for that item in the list view.
Menu
Accepts children:
Yes (see special information)
Special information:
The Menu node has one different attribute, and that is the text attribute, which specifies the text/title of the menu.
The Menu node can contain two types of children: MenuListItem nodes, or additional Menu nodes, which will act as submenus. The MenuItem node has the similar text attribute, but also the checked and enabled attributes, which are self-explanatory.
MenuBar
Accepts children:
Yes (see special information)
Special information:
Can only contain Menu nodes!
NoteBook
Accepts children:
Yes (see special information)
Special information:
The NoteBook node can contain Page nodes. These page nodes have a text attribute, which specifies the text/title of each tab of the notebook. The Page nodes in turn can contain exactly one child, usually a panel containing a set of children.
OverlayPanel
Accepts children:
Yes
Special information:
None
Panel
Accepts children:
Yes
Special information:
None
PlainPanel
Accepts children:
Yes
Special information:
None
RadioButton
Accepts children:
No
Special information:
Has a selected attribute, which specifies that this radio button will be selected by default.
Splitter
Accepts children:
Yes (exactly two)
Special information:
There are three new attributes: direction, sashposition and minsize, which are all self-explanatory.
StyledTextbBox
Accepts children:
No
Special information:
Only basic support for the StyledTextBox node as of yet
TextBox
Accepts children:
No
Special information:
None
ToggleButton
Accepts children:
No
Special information:
A pressed attribute is suppled, 1 for pressed and 0 for depressed [default].
TreeListView
Accepts children:
Yes (see special information)
Special information:
A maincol attribute, which specifies the main column. Other than that, it is a similar to a TreeView. One exception is that, with the possibility of multiple columns, the way of specifying default text for these columns is new. The first column's default text will be specfied as an attribute named col1, the second column being col2, and so on. Also, there is no value attribute for child nodes.
TreeView
Accepts children:
Yes (see special information)
Special information:
The tree view can contain only one node, a root node. The root node can then contain any number of child item nodes, and so on. These child nodes can contain a text attribute, and a value attribute. Also, if the item node contains child item nodes, the expanded attrubute is useful for specifying that this item node will initially be expanded.
VerticalPanel
Accepts children:
Yes
Special information:
None