Source

LuaTools / Testing / LuaGuiTest.xml

Full commit
<?oxygen RNGSchema="../Docs/luagui.rnc" type="compact"?>
<app>
    <accelerator key="CTRL+SHIFT+R" action='print "Accelerated!"'/>
    <accelerator key="CTRL+A" action="DisplayDialog()"/>
    <accelerator key="CTRL+Q" action="CloseWindow()"/>
    <frame width="740" height="550" orient="horizontal" title="SomeName">
        <menubar>
            <menu name="&amp;File">
                <menuitem name="&amp;Open" action='print("goomba")' tip="SomeTip"/>
                <menuspacer/>
                <menuitem name="&amp;Close" action='CloseWindow()'/>
                <menu name="Submenu...">
                    <menuitem name="Foo"/>
                </menu>
            </menu>
        </menubar>
        <panel title="Left" width="175" direction="left" box.orient="vertical" >
            <collpane box.orient="vertical" text="somethingCute" collapsed="true">
                <button text="Page1a" align="left" tip="Page 1 Tooltip"/>
                <button text="Page1b" align="left" tip="Pushes the second page."/>
            </collpane>
            <radiobuttons text="foo" default="second" action="local value = ...; print(value)" orient="horizontal">
                <radio name="first" value="1"/>
                <radio name="second" value="32"/>
                <radio name="third" value="15"/>
            </radiobuttons>
            <static text="Some Static Text"/>
            <box border="0" text="Foo" expand="true" orient="horizontal">
                <button proportion="1" text="SingleP" expand="true" action='ShowBtnName(...)'/>
                <button proportion="1" text="MP" expand="true" action='ShowBtnName(...)'/>
            </box>
            <box border="0" text="Bar" expand="true">
                <button text="Stack Button 1" align="left" expand="true" tip="Manage .GDT files"/>
                <button text="Stack Button 2" align="left" expand="true" tip="View converted models"/>
                <slider direction="horizontal" expand="true"/>
            </box>
        </panel>
        <panel row="0" centerpane="true" width="300">
            <tabs id="maintabs" expand="true" proportion="1" onselchanged="SelChange(...)">
                <tab text="BSP Opts">
                    <button text="Button 1" align="left"/>
                    <button text="Button 2" align="right"/>
                    <editbox readonly="true" default="bisco" tip="This is a tooltip"/>
                    <editbox height="100" multiline="true"/>
                    <spinner min="-50" max="50" default="0" />
                    <sizer grid.numCols="2" grid.hGap="3" grid.colProportion="1=1" expand="true">
                        <static text="Label" valign="center"/>
                        <editbox default="Some special text." expand="true"/>
                        <static text="Longer Label" valign="center"/>
                        <editbox default="Different set of text." expand="true"/>
                    </sizer>
                    <slider min="-5" max="5" default="0" onchange="local value=...; print(value)"/>
                    <listbox id="the.List.Box" height="150" expand="true" onselchange="local event = ...; print(event:GetString())" />
                    <dropdown id="theDropDown"/>
                </tab>
                <tab text="Foo">
                    <button text="Page2a"    align="left" expand="true" tip="Manage .GDT files"/>
                </tab>
            </tabs>
        </panel>
        <panel title="Right" box.orient="vertical" width="340" expand="true" direction="right" maximizebutton="true">
            <box border="0" text="Game" expand="true" orient="horizontal">
                <button proportion="1" text="Left" expand="true"/>
                <button proportion="1" text="Right" expand="true"/>
            </box>
            <box border="0" text="Tools" expand="true">
                <button text="Drop" align="left" expand="true" tip="Drop the stuff"/>
                <button text="Raise" align="left" expand="true" tip="Raise the stuff"/>
            </box>
        </panel>
        <toolbar expand="true" gripper="true" proportion="1" height="100" direction="left" row="0">
            <sizer box.orient="vertical" expand="true" border="3" width="100">
                <checkbox border="2" text="Test Checkbox" oncheck='print("Checked!")' onuncheck='print("Unchecked!")'/>
                <checkbox border="2" text="Look" default="true"/>
                <checkbox border="2" text="See" default="true"/>
            </sizer>
        </toolbar>
        <toolbar expand="true" gripper="false" proportion="1" box.orient="vertical" height="100" direction="top" row="1">
            <checkbox border="2" text="Param 1" default="true" align="center" proportion="1"/>
            <checkbox border="2" text="Param 2" default="true"/>
            <checkbox border="2" text="Param 3" default="true"/>
            <checkbox border="2" text="Test Checkbox" oncheck='print("Checked!")' onuncheck='print("Unchecked!")'/>
            <checkbox border="2" text="Look" default="true"/>
            <checkbox border="2" text="See" default="true"/>
        </toolbar>
    </frame>
    <dialog id="dialog" title="Test Dialog" box.orient="vertical">
        <sizer box.orient="horizontal">
            <box text="Box1" border="5">
                <button text="Button A"/>
                <button text="Button B"/>
            </box>
            <box text="Checks" expand="true" border="5">
                <checkbox id="check_1" text="Check 1"/>
                <checkbox text="Check 2"/>
                <radiobuttons id="radio" text="Radios" orient="vertical">
                    <radio name="Alpha" value="20"/>
                    <radio name="Beta" value="Nuto"/>
                    <radio name="Gamma" value="dd"/>
                </radiobuttons>
                <editbox id="edit"/>
                <slider id="slider" min="-5" max="5"/>
                <spinner id="spinner" min="-15" max="15"/>
            </box>
        </sizer>
        <dialog-panel>
            <ok/>
            <cancel/>
        </dialog-panel>
    </dialog>
    <execute>print &quot;Hello!&quot;</execute>
    <execute script-file="DisplayMessage.lua"/>
    <execute script-name="DisplayDialog"><![CDATA[
local myWnds = ...;
function DisplayDialog()
    local dialog = myWnds:GetDialog("dialog");
    assert(dialog, "Couldn't find the dialog.");

    local testData =
    {
        check_1 = true,
        radio = "Nuto",
        edit = "Something Interesting",
        slider = 3,
        spinner = -10,
    };
    if(myWnds:DoModalData("dialog", testData) == wx.wxID_OK) then
        print(testData.check_1);
        print(testData.radio);
        print(testData.edit);
        print(testData.slider);
        print(testData.spinner);
    end
end
]]></execute>
    <execute script-name="CloseWindow"><![CDATA[
local myWnds = ...;
function CloseWindow()
    myWnds:GetMainWindow():Close();
end
        ]]></execute>
</app>