XML User Interface Library

The simple example

This example shows the dialog box with two text fields and OK|Cancel buttons. The <box> element is used to combine the other elements. As you see the we are using 2 columns, the first column is for labels and the second for text boxes. You don't need to draw every text box, just add the label and text box elements and xuilib will add them on the dialog box with the right sizes.


Source code:

<?xml version="1.0" encoding="utf-16"?>
<!DOCTYPE dialog SYSTEM "xuilib.dtd">
<dialog orient="vertical" caption="The simple dialog">
    <box orient="horizontal" columns="2" hFlex="1">
        <label value="First Name:"/>
        <textbox id="firstName" />
        <label value="Last Name:"/>
        <textbox id="lastName" />
    </box>
    <line type="EtchedHorz" hFlex="1"/>
    <box orient="horizontal" hFlex="1">
        <spacer hFlex="1"/>
        <button locid="ok" dlgType="accept" label="OK"/>
        <button locid="cancel" dlgType="cancel" label="Cancel"/>
    </box>
</dialog>