<?xl version="0.1" encoding="SHIFT_JIS"?>

<vobj type="raw">

<Define> ^preferences-window-initialize () ^sym
<Let>
<Env>
	^vobj
</Env>
<Env>
	^current-lang-env
</Env>
<vobjTarget>
	<Define> ^current (CurrentEnvironment) </Define>
	<Define> ^cache-reset ^preferences-window-cache-reset </Define>
	<Define> ^proxy-http-reset ^preferences-window-proxy-http-reset </Define>
	<Define> ^proxy-native-reset ^preferences-window-proxy-native-reset </Define>
	<Define> ^appearance-reset ^preferences-window-appearance-reset </Define>
	<Define> ^home-reset ^preferences-window-home-reset </Define>
	<Define> ^gateway-reset ^preferences-window-gateway-reset </Define>

	<Define> ^home-initial-button-action () ^sym
	<Let>
	<ErrHandler>
	<Let>
	<Sub>
	<file> <GE path="value" el="1">
		<GetStatus refer="window-preferences-home-use-initial-warp-file"
			flags="value"/>
	</GE></file>
	<condition><GE path="value" el="1">
		 <GetStatus refer="window-preferences-home-use-default-condition"
			flags="value"/>
	</GE></condition>
	</Sub>
	<Switch>
	<Case> (= file 1)
		<VPushButton refer="home-initial-button"
			enabled="1"/>
		<VGroupBox refer="initial-gb-1"
			enabled="0"/>
		<VGroupBox refer="initial-gb-2"
			enabled="0"/>
	</Case>
	<Case> (= condition 1)
		<VPushButton refer="home-initial-button"
			enabled="0"/>
		<VGroupBox refer="initial-gb-1"
			enabled="1"/>
		<VGroupBox refer="initial-gb-2"
			enabled="1"/>
	</Case>
	</Switch>
	</Let>
	</ErrHandler>
	()
	</Let>
	</Define>

	<Define> ^call-edit-iwp () ^sym
	<Let>
		<VWindow refer="preferences-window" visible="0"/>
		(call-edit-warp-ind "#iwp")
	</Let>
	</Define>


	<VWindow	name="preferences-window"

		category="1"
		position="200,200"
		descriptor="^window-preferences-descriptor"
		attr="floating"
		close_event_handler="e/current/window-close"
		visible="0">

	<VVAlignView
		alignh="fill"
		alignv="fill"
		visible="1">

		<VTabView>
		<VTabPage label="^window-preferences-home">
			<VGroupBox
				ws="TitleStyle"
				descriptor="^window-preferences-home-initial-point"
				visible="1">
				<Let>
				<Sub>
				<method> (read-initial-warp-method) </method>
				<b1>
				<If> (= method 1) <Then> 1 </Then><Else> 0 </Else></If>
				</b1>
				<b2>
				<If> (= method 0) <Then> 1 </Then><Else> 0 </Else></If>
				</b2>
				</Sub>
				<VVAlignView>
					<VHAlignView
							alignh="fill">
						<VRadioButton 
							value="^b1"
							alignh="left"
							name="window-preferences-home-use-initial-warp-file"
							descriptor="^window-preferences-home-use-initial-warp-file"
							value_event_handler=
								"e/current/home-initial-button-action"
							/>
						<VPushButton 	
							name="home-initial-button"
							alignh="right"
							alignv="bottom"
							vert_desc="0"
							value_event_handler=
								"e/current/call-edit-iwp"
							descriptor="^window-preferences-home-initial-point-edit"/>
					</VHAlignView>
					<VRadioButton 
						value="^b2"
						name="window-preferences-home-use-default-condition"
						descriptor="^window-preferences-home-use-default-condition"
						group="window-preferences-home-use-initial-warp-file"
						value_event_handler=
							"e/current/home-initial-button-action"
						/>
				</VVAlignView>
				</Let>
			</VGroupBox>


			<VGroupBox
				name="initial-gb-1"
				ws="TitleStyle"
				descriptor="^window-preferences-home"
				visible="1">
				<VVAlignView>
				(window-preferences-home-setup)
				<Let>
				<Sub>
				<sp-URL> (read-start-point-URL)
				</sp-URL>
				</Sub>
				<VEditText name="window-preferences-home"
					alignh="fill"
					max_len="300"
					min_len="30"
						descriptor="^sp-URL"/>
				</Let>
				</VVAlignView>
			</VGroupBox>
			<VGroupBox
				name="initial-gb-2"
				ws="TitleStyle"
				descriptor="^window-preferences-default-condition"
				visible="1">
				<VVAlignView>
					(window-preferences-default-condition-setup)
					<VHAlignView
							alignh="left"
							alignv="fill"
							padding="0,0"
							spacing="0,0"
							visible="1">
					<VPushButton 	
						name="conditions.NewButton"
						alignh="left"
						alignv="bottom"
						vert_desc="0"
						descriptor="^general-new"/>
					<VPushButton
					 	name="conditions.DelButton"
						alignh="left"
						alignv="bottom"
						vert_desc="0"
						descriptor="^general-del"/>
					<VPushButton
					 	name="conditions.EditButton"
						alignh="left"
						alignv="bottom"
						vert_desc="0"
						descriptor="^general-edit"/>
					</VHAlignView>

					<Let>
					<Sub>
					<cond>
					(read-default-conditions)
					</cond>
					</Sub>
					<VgbQueryIndicate
						name = "scroll-conditions"
							min_size="400,200"
							padding="0,0"
							alignh="fill"
							alignv="fill"
							visible="1"
					name="window-preferences-conditions"
					qind.qthReplace="cond"
					qind.Eye.raw="file:eye1.gif"
					qind.Eye.elr="v2h1"
					qind.NewButton="conditions.NewButton"
					qind.DelButton="conditions.DelButton"
					qind.EditButton="conditions.EditButton"
					qind.EditEvent="e/vobj/qind-edit-window"
					qind.Focus="on"
					qind.Scroll="on"
							/>
					</Let>

				</VVAlignView>
			</VGroupBox>

			<VHAlignView>
			<VPushButton
				alignh="right"
				descriptor="^general-reset"
				value_event_handler="e/current/home-reset"
				visible="1"/>
			</VHAlignView>
		</VTabPage>
		<VTabPage label="^window-preferences-appearance">
			<VGroupBox
				ws="TitleStyle"
				descriptor="^window-preferences-language"
				visible="1">
				(window-preferences-language-setup)
			</VGroupBox>

			<VGroupBox
				ws="TitleStyle"
				descriptor="^window-preferences-theme"
				visible="1">
				<VVAlignView>
				(window-preferences-theme-setup)
				<VxlEditLine name="window-preferences-theme-file"
						xleditline.Items="edit:file"
						xleditline.WritingDirection="H-L2R"
						xleditline.AddDescriptor="^general-add"
						xleditline.DelDescriptor="^general-del"
						xleditline.BroDescriptor="^general-browse"
						descriptor=""/>

				</VVAlignView>
			</VGroupBox>

			<VHAlignView>
			<VPushButton
				alignh="right"
				descriptor="^general-reset"
				value_event_handler="e/current/appearance-reset"
				visible="1"/>
			</VHAlignView>
		</VTabPage>
		<VTabPage label="^window-preferences-cache">
			<VGroupBox
				ws="TitleStyle"
				descriptor="^window-preferences-mappath-cache"
				visible="1">
				<VVAlignView>
				(window-preferences-mappath-cache-setup)
				</VVAlignView>
			</VGroupBox>
			<VGroupBox
				ws="TitleStyle"
				descriptor="^window-preferences-resource-cache"
				visible="1">
				<VVAlignView>
				(window-preferences-resource-cache-setup)
				</VVAlignView>
			</VGroupBox>
			<VHAlignView>
			<VPushButton
				alignh="right"
				descriptor="^general-reset"
				name="preferences-window-cache-reset"
				value_event_handler="e/current/cache-reset"
				visible="1"/>
			</VHAlignView>
		</VTabPage>
		<VTabPage label="^window-preferences-proxy">
			<VTabView>
			<VTabPage label="^window-preferences-proxy-http">
			<VVAlignView>
				<VxlText
					ps-flags="text"
					fsize="120"
					ws="NormalStyle"
					xltext.Algorism="VText">

					<VRadioButton name="window-preferences-proxy-http-off"
						descriptor="^window-preferences-proxy-off"/>
					^"\n"
					<VRadioButton name="window-preferences-proxy-http-direct"
						group="window-preferences-proxy-http-off"
						descriptor="^window-preferences-proxy-direct"/>
					^"\n"
					($ window-preferences-proxy-direct-setup)
					^"\n"
					<VRadioButton name="window-preferences-proxy-http-on"
						group="window-preferences-proxy-http-off"
						descriptor="^window-preferences-proxy-on"/>
					^"\n"
				</VxlText>
				(window-preferences-proxy-server-setup
					"window-preferences-proxy-http-server"
					"window-preferences-proxy-http-port"
					"window-preferences-proxy-http-dservers")
				<VHAlignView>
				<VPushButton
					alignh="right"
					descriptor="^general-reset"
					value_event_handler=
						"e/current/proxy-http-reset"
					visible="1"/>
				</VHAlignView>
			</VVAlignView>
			</VTabPage>
			<VTabPage label="^window-preferences-proxy-native">
			<VVAlignView>
				<VxlText
					ps-flags="text"
					fsize="120"
					ws="NormalStyle"
					xltext.Algorism="VText">

					<VRadioButton name="window-preferences-proxy-native-off"
						descriptor="^window-preferences-proxy-off"/>
					^"\n"
					<VRadioButton name="window-preferences-proxy-native-on"
						group="window-preferences-proxy-native-off"
						descriptor="^window-preferences-proxy-on"/>
					^"\n"
				</VxlText>
				(window-preferences-proxy-server-setup
					"window-preferences-proxy-native-server"
					"window-preferences-proxy-native-port"
					"window-preferences-proxy-native-dservers")
				<VHAlignView>
				<VPushButton
					alignh="right"
					descriptor="^general-reset"
					value_event_handler=
						"e/current/proxy-native-reset"
					visible="1"/>
				</VHAlignView>
			</VVAlignView>
			</VTabPage>
			<VTabPage label="^window-preferences-proxy-gateway">
			<VVAlignView>
				<VxlText
					ps-flags="text"
					fsize="120"
					ws="NormalStyle"
					xltext.Algorism="VText">

					<VRadioButton
			name="window-preferences-proxy-gateway-off"
			descriptor="^window-preferences-proxy-gateway-off"/>
					^"\n"
					<VRadioButton 
			name="window-preferences-proxy-gateway-on"
			group="window-preferences-proxy-gateway-off"
			descriptor="^window-preferences-proxy-gateway-on"/>
				</VxlText>
				(window-preferences-proxy-gateway-setup)
				<VHAlignView>
				<VPushButton
					alignh="right"
					descriptor="^general-reset"
				value_event_handler="e/current/gateway-reset"
					visible="1"/>
				</VHAlignView>
			</VVAlignView>
			</VTabPage>
			</VTabView>
		</VTabPage>
		</VTabView>
		<VHAlignView
			alignh="fill"
			alignv="fill"
			visible="1">

			<VPushButton
				alignh="right"
				descriptor="^general-cancel"
				cancel_button="1"
				visible="1"
				value_event_handler="e/current/push-cancel"/>
			<VPushButton
				alignh="right"
				descriptor="^general-ok"
				default_button="1"
				visible="1"
				value_event_handler="e/current/push-ok"/>
		</VHAlignView>
	</VVAlignView>
	</VWindow>

	<vobjWaitSync/>

	<Define> ^window-close ()
	<Arguments>
		^id
		^data
	</Arguments>
	<Let>
		<VWindow refer.id="^id" visible="0"/>
	</Let>
	</Define>

	<Define> ^push-cancel ()
	<Arguments>
		^id
		^data
	</Arguments>
	<Let>
		<VWindow refer="preferences-window" visible="0"/>
	</Let>
	</Define>

	<Define> ^push-ok ()
	<Arguments>
		^id
		^data
	</Arguments>
	<Let>
		<VWindow refer="preferences-window" visible="0"/>
		(preferences-window-home-set)
		(preferences-window-cache-set)
		(preferences-window-proxy-native-set)
		(preferences-window-proxy-http-set)
		(preferences-window-appearance-set)
		(preferences-window-gateway-set)
		<gv-resource rid="4">
			<gv-set-status/>
		</gv-resource>
	</Let>
	</Define>
	
	<home-initial-button-action/>
(PrintStd "==========================================================")
</vobjTarget>
</Let>
</Define>

</vobj>


<Load option="exec"> ../../lib/preferences.xl </Load>

