<?xml version="1.0" encoding="UTF-8"?>
<app name="Settings" version="0.1.0" icon="images/icon.png">
	<resources>
		<module src="modules/app_settings.klf" />
		<font src="../../fonts/ttf/arial_lite.ttf" type="ttf" size="14" name="arial" />
		<font src="../../fonts/ttf/comic_lite.ttf" type="ttf" size="22" name="comic" />
		<font src="../../fonts/ttf/m23.ttf" type="ttf" size="14" name="m23" />
		<surface height="45" name="header-bg">
			<fill color="#C9DADE" />
			<fill color="#BBBBBB" height="1" y="43" />
			<fill color="#CCCCCC" height="1" y="44" />
		</surface>
		<surface width="280" height="60" name="but-normal">
			<fill color="#FFFFFF" />
			<fill x="4" y="4" width="272" height="52" color="#BBBBBB" />
			<fill x="5" y="5" width="270" height="50" color="#31799F" />
		</surface>
		<surface width="280" height="60" name="but-hl">
			<fill color="#FFFFFF" />
			<fill x="4" y="4" width="272" height="52" color="#BBBBBB" />
			<fill x="5" y="5" width="270" height="50" color="#61BDEC" />
		</surface>
		<surface width="280" height="60" name="but-pressed">
			<fill color="#FFFFFF" />
			<fill x="4" y="4" width="272" height="52" color="#BBBBBB" />
			<fill x="5" y="5" width="270" height="50" color="#D4F129" />
		</surface>
		<surface width="280" height="60" name="but-disabled">
			<fill color="#FFFFFF" />
			<fill x="4" y="4" width="272" height="52" color="#BBBBBB" />
			<fill x="5" y="5" width="270" height="50" color="#CCCCCC" />
		</surface>
		<image src="images/check.png" name="check-on" />
		<image src="images/check_hl.png" name="check-on-hl" />
		<surface width="18" height="17" name="check-off">
			<fill color="#FFFFFF" />
		</surface>
		<surface width="18" height="17" name="check-off-hl">
			<fill color="#D4F129" />
		</surface>
		<surface width="40" height="20" name="input-normal4">
			<fill x="0" y="0" width="40" height="20" color="#FFFFFF" />
		</surface>
		<surface width="40" height="20" name="input-focus4">
			<fill x="0" y="0" width="40" height="20" color="#29B1EA" />
			<fill x="2" y="2" width="38" height="18" color="#7CFFC1" />
		</surface>
		
		<surface width="25" height="20" name="input-normal2">
			<fill x="0" y="0" width="25" height="20" color="#FFFFFF" />
		</surface>
		<surface width="25" height="20" name="input-focus2">
			<fill x="0" y="0" width="25" height="20" color="#29B1EA" />
			<fill x="2" y="2" width="23" height="18" color="#7CFFC1" />
		</surface>
		<theme>
			<input type="button" normal="but-normal" highlight="but-hl" pressed="but-pressed" disabled="but-disabled" />
			<input type="checkbox" onnormal="check-on" onhighlight="check-on-hl" offnormal="check-off" offhighlight="check-off-hl" />
		</theme>
	</resources>
	<body width="100%" height="100%" onload="export:SettingsApp_Init()" background="#DDDDDD">
		<panel height="45" background="header-bg">
			<label font="comic" color="#666666" text="DreamShell Settings" />
		</panel>
		<cardstack name="pages">
			<panel name="main-page" y="80">

				<panel height="70" width="50%">
					<input type="button" width="280" height="60" onclick="export:SettingsApp_ShowPage()" name="boot-but" align="center">
						<label font="m23" color="#ffffff" text="Boot settings" />
					</input>
				</panel>
				<panel height="70" width="50%">
					<input type="button" width="280" height="60" onclick="export:SettingsApp_ShowPage()" name="display-but" align="center">
						<label font="m23" color="#ffffff" text="Display settings" />
					</input>
				</panel>
				<panel height="70" width="50%">
					<input type="button" width="280" height="60" onclick="export:SaveSettings()" align="center">
						<label font="m23" color="#ffffff" text="Save to VMU" />
					</input>
				</panel>
				<panel height="70" width="50%">
					<input type="button" width="280" height="60" onclick="export:SettingsApp_ResetSettings()" align="center">
						<label font="m23" color="#ffffff" text="Reset to default" />
					</input>
				</panel>
				<panel height="70" width="50%">
					<input type="button" width="280" height="60" onclick="export:SettingsApp_ShowPage()" name="date-but" align="center">
						<label font="m23" color="#ffffff" text="Date and Time" />
					</input>
				</panel>
				<panel height="70" width="50%">
					<input type="button" width="280" height="60" onclick="console:dc -reboot" align="center">
						<label font="m23" color="#ffffff" text="Reboot" />
					</input>
				</panel>
				<panel height="70" width="50%">
					<input type="button" width="280" height="60" onclick="console:app -o -n Main" align="center">
						<label font="m23" color="#ffffff" text="Exit" />
					</input>
				</panel>

			</panel>
			<panel name="boot-page" y="10">
			
				<panel x="5%" width="95%" height="350">
					<panel height="40" name="boot-root">
						<label width="150" height="40" font="m23" color="#777777" text="Root directory" align="left" />
						<input type="checkbox" x="150" y="10" width="75" height="25" onclick="export:SettingsApp_ToggleRoot()">
							<label x="22" height="20" font="arial" color="#333333" text="Auto" align="left" />
						</input>
						<input type="checkbox" width="90" height="25" onclick="export:SettingsApp_ToggleRoot()">
							<label x="22" height="20" font="arial" color="#333333" text="/ide/DS" align="left" />
						</input>
						<input type="checkbox" width="85" height="25" onclick="export:SettingsApp_ToggleRoot()">
							<label x="22" height="20" font="arial" color="#333333" text="/sd/DS" align="left" />
						</input>
						<input type="checkbox" width="70" height="25" onclick="export:SettingsApp_ToggleRoot()">
							<label x="22" height="20" font="arial" color="#333333" text="/pc" align="left" />
						</input>
						<input type="checkbox" width="70" height="25" onclick="export:SettingsApp_ToggleRoot()">
							<label x="22" height="20" font="arial" color="#333333" text="/cd" align="left" />
						</input>
					</panel>
					<panel height="40" name="boot-startup">
						<label width="150" height="40" font="m23" color="#777777" text="Startup script" align="left" />
						<input type="checkbox" x="150" y="10" width="150" height="25" onclick="export:SettingsApp_ToggleStartup()">
							<label x="25" height="20" font="arial" color="#333333" text="/lua/startup.lua" align="left" />
						</input>
						<input type="checkbox" width="150" height="25" onclick="export:SettingsApp_ToggleStartup()">
							<label x="25" height="20" font="arial" color="#333333" text="/lua/custom.lua" align="left" />
						</input>
					</panel>
					<panel height="210" name="boot-app">
						<label height="40" font="m23" color="#777777" text="Application" align="left" />
					</panel>
				</panel>
				<panel height="60">
					<input type="button" width="280" height="60" onclick="export:SettingsApp_ShowPage()" name="main-but-boot" align="center">
						<label font="m23" color="#ffffff" text="Back to main page" />
					</input>
				</panel>

			</panel>
			<panel name="display-page" y="10">

				<panel height="340">
					<panel width="30%" x="5%" name="display-native-mode">
						<label height="43" font="m23" color="#777777" text="Native mode" align="left" />
						<input type="checkbox" height="25" onclick="export:SettingsApp_ToggleNativeMode()">
							<label x="25" font="arial" color="#333333" text="Auto" align="left" />
						</input>
						<input type="checkbox" height="25" onclick="export:SettingsApp_ToggleNativeMode()">
							<label x="25" font="arial" color="#333333" text="480i PAL" align="left" />
						</input>
						<input type="checkbox" height="25" onclick="export:SettingsApp_ToggleNativeMode()">
							<label x="25" font="arial" color="#333333" text="480i NTSC" align="left" />
						</input>
						<input type="checkbox" height="25" onclick="export:SettingsApp_ToggleNativeMode()">
							<label x="25" font="arial" color="#333333" text="480p VGA" align="left" />
						</input>
					</panel>

					<panel width="33%" name="display-screen-mode">
						<label height="40" font="m23" color="#777777" text="Screen mode" align="left" />
						<input type="checkbox" height="25" onclick="export:SettingsApp_ToggleScreenMode()">
							<label x="25" font="arial" color="#000000" text="640x480 4:3" align="left" />
						</input>
						<input type="checkbox" height="25" onclick="export:SettingsApp_ToggleScreenMode()">
							<label x="25" font="arial" color="#000000" text="720x480 3:2" align="left" />
						</input>
						<input type="checkbox" height="25" onclick="export:SettingsApp_ToggleScreenMode()">
							<label x="25" font="arial" color="#000000" text="768x480 16:10" align="left" />
						</input>
						<input type="checkbox" height="25" onclick="export:SettingsApp_ToggleScreenMode()">
							<label x="25" font="arial" color="#000000" text="854x480 16:9" align="left" />
						</input>
					</panel>

					<panel width="30%" name="display-screen-filter">
						<label height="40" font="m23" color="#777777" text="Screen filter" align="left" />
						<input type="checkbox" height="25" onclick="export:SettingsApp_ToggleScreenFilter()">
							<label x="25" font="arial" color="#000000" text="Auto" align="left" />
						</input>
						<input type="checkbox" height="25" onclick="export:SettingsApp_ToggleScreenFilter()">
							<label x="25" font="arial" color="#000000" text="Nearest" align="left" />
						</input>
						<input type="checkbox" height="25" onclick="export:SettingsApp_ToggleScreenFilter()">
							<label x="25" font="arial" color="#000000" text="Bilinear" align="left" />
						</input>
						<!--
						<input type="checkbox" height="25" onclick="export:SettingsApp_ToggleScreenFilter()">
							<label x="25" font="arial" color="#000000" text="Trilinear" align="left" />
						</input>
						-->
					</panel>

					<panel y="270" height="25">
						<label font="arial" color="#444444" text="After changing the native mode, you must reboot the console" />
					</panel>
					<panel height="25">
						<label font="arial" color="#444444" text="After changing the screen mode, you must restart the application" />
					</panel>
				</panel>

				<panel height="60">
					<input type="button" width="280" height="60" onclick="export:SettingsApp_ShowPage()" name="main-but-display" align="center">
						<label font="m23" color="#ffffff" text="Back to main page" />
					</input>
				</panel>
			</panel>
			<panel name="date-page" y="10">
				<panel x="0" y="20" width="100%" height="50" >
					<label font="m23" color="#000FFF" text="SYSTEM TIME" align="center" valign="center"/>
				</panel>
				
				<panel x="32%" y="80" width="230" height="20">
					<input  type="text" 
						onblur="export:SettingsApp_Time()"
						onfocus="export:SettingsApp_Time_Clr()"
						font="arial" 
						fontcolor="#000000" 
						value="1998" 
						size="5" x="5" width="40"
						name="year" 
						normal="input-normal4" 
						highlight="input-normal4"
						focus="input-focus4">
					</input>
					
					<panel x="45" width="20">
						<label font="arial" color="#000000" text="/" align="center" />
					</panel>
					
					<input  type="text" 
						onblur="export:SettingsApp_Time()"
						onfocus="export:SettingsApp_Time_Clr()"
						font="arial" 
						fontcolor="#000000" 
						value="03" 
						size="3" x="65" width="25"
						name="month" 
						normal="input-normal2" 
						highlight="input-normal2"
						focus="input-focus2">
					</input>
					
					<panel x="90" width="20">
						<label font="arial" color="#000000" text="/" align="center" />
					</panel>
					
					<input  type="text" 
						onblur="export:SettingsApp_Time()"
						onfocus="export:SettingsApp_Time_Clr()"
						font="arial" 
						fontcolor="#000000" 
						value="18" 
						size="3" x="110" width="25"
						name="day" 
						normal="input-normal2" 
						highlight="input-normal2"
						focus="input-focus2">
					</input>
						
					<input  type="text" 
						onblur="export:SettingsApp_Time()"
						onfocus="export:SettingsApp_Time_Clr()"
						font="arial" 
						fontcolor="#000000" 
						value="00" 
						size="3" x="155" width="25"
						name="hours" 
						normal="input-normal2" 
						highlight="input-normal2"
						focus="input-focus2">
					</input>
					
					<panel x="180" width="20">
						<label font="arial" color="#000000" text=":" align="center" />
					</panel>
					
					<input  type="text" 
						onblur="export:SettingsApp_Time()"
						onfocus="export:SettingsApp_Time_Clr()"
						font="arial" 
						fontcolor="#000000" 
						value="00" 
						size="3" x="200" width="25" 
						name="minute" 
						normal="input-normal2" 
						highlight="input-normal2"
						focus="input-focus2">
					</input>
					
				</panel>
				
				<panel x="32%" y="110" width="230" height="20">
					<panel x="5" width="45">
						<label font="arial" color="#000000" text="YYYY" align="center"/>
					</panel>
					<panel x="65" width="30">
						<label font="arial" color="#000000" text="MM" align="center"/>
					</panel>
					<panel x="110" width="30">
						<label font="arial" color="#000000" text="DD" align="center"/>
					</panel>
					<panel x="155" width="30">
						<label font="arial" color="#000000" text="HH" align="center"/>
					</panel>
					<panel x="200" width="30">
						<label font="arial" color="#000000" text="MM" align="center"/>
					</panel>
				</panel>
				
				<panel width="100%" height="50" />
				
				<panel height="70" width="50%">
					<input type="button" name="get-time" width="280" height="60" onclick="export:SettingsApp_TimeChange()" align="center">
						<label font="m23" color="#ffffff" text="Get DATE and Time" />
					</input>
				</panel>
				
				<panel height="70" width="50%">
					<input type="button" name="set-time" width="280" height="60" onclick="export:SettingsApp_TimeChange()" align="center">
						<label font="m23" color="#ffffff" text="Set DATE and Time" />
					</input>
				</panel>
				
				<panel height="60">
					<input type="button" width="280" height="60" onclick="export:SettingsApp_ShowPage()" name="main-but-clock" align="center">
						<label font="m23" color="#ffffff" text="Back to main page" />
					</input>
				</panel>

			</panel>
		</cardstack>
	</body>
</app>
