csmit195

Titanium - TML Demo

Sep 29th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.13 KB | None | 0 0
  1. <TabbedPageContainer Z=1 X=1 Y=1 width="$application.width" height="$application.height" id="mainContainer">
  2.     <Page id="main" name="Landing" xScrollAllowed="false">
  3.         <Label X=2 Y=2 class="header">Titanium</Label>
  4.         <Label X=2 Y=3 class="sub">Test Application</Label>
  5.  
  6.         <Label X=41 Y=15>Allow Exit</Label>
  7.         <Label X=41 Y=16 class="sub" labelFor="yes_rating">Yes</Label>
  8.         <RadioButton value="yes" X=45 Y=16 group="rating" id="yes_rating"/>
  9.  
  10.         <Label X=47 Y=16 class="sub" labelFor="no_rating">No</Label>
  11.         <RadioButton value="no" X=50 Y=16 group="rating" id="no_rating" toggled/>
  12.  
  13.         <Label X=2 Y=6 labelFor="name_input">Name</Label>
  14.         <Input X=2 Y=7 width=18 id="name_input" placeholder="Your Name" focused="true"/>
  15.         <Label X=2 Y=8 id="name_display" class="sub">Enter your name</Label>
  16.         <Label X=2 Y=10 id="selected_name_display" class="sub">No selected text</Label>
  17.  
  18.         <Button X=41 Y=18 width=10 id="exit_button" enabled="false">Exit</Button>
  19.         <Button X=2 Y=18 id="toggle">Toggle Theme</Button>
  20.  
  21.         <Button X=2 Y=15 id="pane_toggle">Toggle Pane</Button>
  22.  
  23.         <Label id="left" X=5 Y=16 class="sub hotkey_part">ctrl</Label>
  24.         <Label X=9 Y=16 class="sub hotkey_part" id="hyphen_seperator">-</Label>
  25.         <Label id="right" X=10 Y=16 class="sub hotkey_part">p</Label>
  26.  
  27.         <Button X="${Container#pane}.X - 2 - self.width" Y=2 class="page_change" targetPage="console" id="shell_link">Shell</Button>
  28.         <Button X="${#shell_link}.X - 2 - self.width" Y=2 class="page_change" targetPage="text" id="button_link">Text</Button>
  29.         <Button X="${#button_link}.X - 2 - self.width" Y=2 class="page_change" targetPage="windows">Windows</Button>
  30.  
  31.         <Dropdown X=23 Y=6 width=25 maxHeight=7 Z=2>
  32.             <Option value="1">Example Option 1</Option>
  33.             <Option value="2">Example Option 2</Option>
  34.             <Option value="3">Example Option 3</Option>
  35.             <Option value="4">Example Option 4</Option>
  36.             <Option value="5">Example Option 5</Option>
  37.             <Option value="6">Example Option 6</Option>
  38.             <Option value="7">Example Option 7</Option>
  39.             <Option value="8">Example Option 8</Option>
  40.             <Option value="9">Example Option 9</Option>
  41.             <Option value="10">Example Option 10</Option>
  42.         </Dropdown>
  43.  
  44.         <Label X="${#animationSlider}.X" Y=10>Animation Duration</Label>
  45.         <Slider X=23 width=15 Y=11 id="animationSlider" value=2/>
  46.         <Label X="${#animationSlider}.X + ( {#animationSlider}.width / 2 ) - self.width / 2" Y=12 id="animationD" class="sub">${#animationSlider}.value * 0.15 .. 's'</Label>
  47.  
  48.         <Container id="pane" width=21 height="$parent.height" X=52 backgroundColour="grey" Z=3>
  49.             <Label colour=1 X=2 Y=2>Settings</Label>
  50.  
  51.             <ScrollContainer X=2 Y=4 width=20 height=10>
  52.                 <Label labelFor="config_1" Y=1>Config 1</Label>
  53.                 <Checkbox Y=1 id="config_1"/>
  54.  
  55.                 <Label labelFor="config_2" Y=3>Config 2</Label>
  56.                 <Checkbox Y=3 id="config_2"/>
  57.  
  58.                 <Label labelFor="config_3" Y=5>Config 3</Label>
  59.                 <Checkbox Y=5 id="config_3"/>
  60.  
  61.                 <Label labelFor="config_4" Y=7>Config 4</Label>
  62.                 <Checkbox Y=7 id="config_4"/>
  63.  
  64.                 <Label labelFor="config_5" Y=9>Config 5</Label>
  65.                 <Checkbox Y=9 id="config_5"/>
  66.  
  67.                 <Label labelFor="config_6" Y=11>Config 6</Label>
  68.                 <Checkbox Y=11 id="config_6"/>
  69.  
  70.                 <Label labelFor="config_7" Y=13>Config 7</Label>
  71.                 <Checkbox Y=13 id="config_7"/>
  72.  
  73.                 <Label labelFor="config_8" Y=15>Config 8</Label>
  74.                 <Checkbox Y=15 id="config_8"/>
  75.             </ScrollContainer>
  76.  
  77.             <Button width=17 height=3 X=3 Y=16 id="config_save">Save Settings</Button>
  78.         </Container>
  79.     </Page>
  80.  
  81.     <Page id="console" name="Terminal" xScrollAllowed="false">
  82.         <Terminal X=2 Y=2 width=49 height=15 id="shell"/>
  83.         <Button class="page_change" X=18 Y=18 targetPage="main">Back</Button>
  84.         <Button class="page_change" X=26 Y=18 targetPage="text">Next</Button>
  85.     </Page>
  86.  
  87.     <Page id="text" xScrollAllowed="false" name="Editor">
  88.         <EditableTextContainer X=2 Y=2 width="$parent.width - 2" height="$parent.height - 4" horizontalAlign="left" colour="256" focusedColour="white" backgroundColour="grey"/>
  89.  
  90.         <Button class="page_change" X=18 Y=18 targetPage="console">Back</Button>
  91.         <Button class="page_change" X=26 Y=18 targetPage="main">Home</Button>
  92.     </Page>
  93.  
  94.     <Page id="windows" xScrollAllowed="false" position=1 name="Windows">
  95.         <Window Z=5 X=6 Y=3 width=25 height=6 backgroundColour="256" title="Example Window" focusedBackgroundColour="lightBlue" minHeight="7">
  96.             <Label class="centre" Y=2 colour=128>Drag me around!</Label>
  97.             <Input width="$parent.width - 2" backgroundColour="red" X=2 Y=4/>
  98.         </Window>
  99.  
  100.         <Button class="page_change" X=23 Y=18 targetPage="main">Home</Button>
  101.     </Page>
  102. </TabbedPageContainer>
Add Comment
Please, Sign In to add comment