I took "pages" example and was planning to modify it for my own purpose, hence you can recognise lot of code from that one:
Code: Select all
@VERSION 9,0
@OPTIONS {DPIAware = True}
@REQUIRE "RapaGUI"
/*
** Our XML GUI definition
*/
@FILE 1, "RapaGuiPart.xml"
; dynamically create GUI from an external *.xml file definition
moai.CreateApp(ReadString(1))
moai.CreateObject("<menuitem id=\"single1\">Item 1</menuitem>")
moai.CreateObject("<menuitem id=\"single2\">Item 2</menuitem>")
moai.DoMethod("Screenmode", "initchange")
amigapage$ = [[
<vgroup title="Amigatesti id="Amigapage" padding="16">
</vgroup>
]]
moai.CreateObject(amigapage$, "mainpages")
moai.DoMethod("register", "append", "page" .. count, True)
moai.DoMethod("testi", "insert", "single1")
moai.DoMethod("testi", "exitchange")
; main loop!
Repeat
WaitEvent
Forever
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
<window title="Rogue Football Cardgame" id="window" width="400">
<vgroup>
<vspace height="2"/>
<pageview id = "mainpages">
<hgroup title="testi">
<rectangle/>
<radio>
<item>Warrior</item>
<item>Rogue</item>
<item>Bard</item>
<item>Monk</item>
<item>Magician</item>
<item>Archmage</item>
</radio>
<rectangle/>
</hgroup>
<hgroup title="Screenmode">
<rectangle/>
<radio>
<item>Human</item>
<item>Elf</item>
<item>Dwarf</item>
<item>Fairy</item>
<item>Gnome</item>
</radio>
<rectangle/>
</hgroup>
<hgroup title="Volume">
<colgroup columns="2">
<label>Sounds:</label>
<slider min="0" max="100" level="50"/>
<label>Music:</label>
<slider min="0" max="100" level="50"/>
</colgroup>
</hgroup>
<hgroup title="Class">
<rectangle/>
<radio>
<item>Warrior</item>
<item>Rogue</item>
<item>Bard</item>
<item>Monk</item>
<item>Magician</item>
<item>Archmage</item>
</radio>
<rectangle/>
</hgroup>
<hgroup title="Amiga Specific">
<colgroup columns="2">
<label>Cloak:</label>
<checkbox selected="true"/>
<label>Shield:</label>
<checkbox selected="true"/>
<label>Gloves:</label>
<checkbox selected="true"/>
<label>Helmet:</label>
<checkbox selected="true"/>
</colgroup>
</hgroup>
</pageview>
</vgroup>
</window>
</application>
Couple of notices about changes to original "pages" example:
I have made one more Hgroup with title "testi", and changed names and items of some.
what comes to the Hollywood part, after using "moai.CreateApp(ReadString(1))" I have couple of lines where I am trying to add an item and a new page, but I cant get either to work.
The ultimate goal is that I want to generate a radio button which would show all the screenmode options, but I am first starting by simply trying to add an item.
What comes to the page, the idea is that Amiga versions would have an extra Page compared to other versions. Therefore it would check if software is ran on Amiga, then it would add that "amiga" page.
So why am I not getting item or page added. More specifically, why does it keep complaining "can find MOAI object Screenmode" when I try to run this, should group title "Screenmode" in the xml-file had made it so that this object is existing after the line " "moai.CreateApp(ReadString(1))" has been executed?