window:
	res:
		windowType	wstandard
	endres:
endwindow:
close:
	res:
		bitmapPath	$(bitmaps)
		bitmapFile	CLOSE::CBM
	endres:
endclose:
title:
	res:
		leftLabel	'ũ ʱȭ'
		leftKanjiFont	$(kanjiFont)
		leftFont	$(kanaFont)
		switch $(COLOR)
			case MONO:
				bitmapPath	$(bitmaps)
				backgroundFile	GRAY3
				transparent	false
				break
		endswitch
	endres:
endtitle:
dialog: dialogs
	res:
		defaultDistance		#(fWidth)
		dialogType		modeless
	endres:
	ditem: msg1
		res:
			itemType	bitmap
			leftLabel	'Ƽ  Ͽ ֽʽÿ.'
			leftKanjiFont	$(kanjiFont)
			leftFont	$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
		endres:
	endditem:
	ditem: msg2
		res:
			itemType	bitmap
			leftLabel	'ƼǸ(MBytes)'
			fromHoriz	msg1
			leftKanjiFont	$(kanjiFont)
			leftFont	$(kanaFont)
			vertDistance	#(fWidth)*2-4
			horizDistance	#(fWidth)*4
		endres:
	endditem:
	ditem: 1c
		res:
			itemType	button
			fromVert	msg2
			label		c(40)
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
			borderWidth	1
			width		#(fWidth)*22+21
			translations	'<Btn1Down>: set() notify() unset()'
			bitmapPath	$(bitmaps)
		endres:
		act:
			put 1 $(kind)
			job change
		endact:
	endditem:
	ditem: 2a
		res:
			itemType	button
			fromVert	1c
			label		a(7)
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
			borderWidth	1
			width		#(fWidth)*4+6
			translations	'<Btn1Down>: set() notify() unset()'
			bitmapPath	$(bitmaps)
			highlightMode	0
			selectMode	0
		endres:
		act:
			put 2 $(kind)
			job change
		endact:
	endditem:
	ditem: 2b
		res:
			itemType	button
			label		b(4)
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			fromVert	1c
			fromHoriz	2a
			vertDistance	#(fWidth)
			horizDistance	-1
			borderWidth	1
			width		#(fWidth)*4+6
			translations	'<Btn1Down>: set() notify() unset()'
			bitmapPath	$(bitmaps)
			highlightMode	0
			selectMode	0
		endres:
		act:
			put 2 $(kind)
			job change
		endact:
	endditem:
	ditem: 2d
		res:
			itemType	button
			label		d(7)
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			fromVert	1c
			fromHoriz	2b
			vertDistance	#(fWidth)
			horizDistance	-1
			borderWidth	1
			width		#(fWidth)*4+6
			translations	'<Btn1Down>: set() notify() unset()'
			bitmapPath	$(bitmaps)
			highlightMode	0
			selectMode	0
		endres:
		act:
			put 2 $(kind)
			job change
		endact:
	endditem:
	ditem: 2f
		res:
			itemType	button
			label		f(19)
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			fromVert	1c
			fromHoriz	2d
			vertDistance	#(fWidth)
			horizDistance	-1
			borderWidth	1
			width		#(fWidth)*10
			translations	'<Btn1Down>: set() notify() unset()'
			bitmapPath	$(bitmaps)
			highlightMode	0
			selectMode	0
		endres:
		act:
			put 2 $(kind)
			job change
		endact:
	endditem:
	ditem: 3a
		res:
			itemType	button
			fromVert	2a
			label		a(7)
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
			borderWidth	1
			width		#(fWidth)*4+6
			translations	'<Btn1Down>: set() notify() unset()'
			bitmapPath	$(bitmaps)
			highlightMode	0
			selectMode	0
		endres:
		act:
			put 3 $(kind)
			job change
		endact:
	endditem:
	ditem: 3b
		res:
			itemType	button
			label		b(4)
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			fromVert	2a
			fromHoriz	3a
			vertDistance	#(fWidth)
			horizDistance	-1
			borderWidth	1
			width		#(fWidth)*4+6
			translations	'<Btn1Down>: set() notify() unset()'
			bitmapPath	$(bitmaps)
			highlightMode	0
			selectMode	0
		endres:
		act:
			put 3 $(kind)
			job change
		endact:
	endditem:
	ditem: 3g
		res:
			itemType	button
			label		g(27)
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			fromVert	2a
			fromHoriz	3b
			vertDistance	#(fWidth)
			horizDistance	-1
			borderWidth	1
			width		#(fWidth)*14+7
			translations	'<Btn1Down>: set() notify() unset()'
			bitmapPath	$(bitmaps)
			highlightMode	0
			selectMode	0
		endres:
		act:
			put 3 $(kind)
			job change
		endact:
	endditem:
	ditem: 4a
		res:
			itemType	button
			fromVert	3a
			label		a(7)
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
			borderWidth	1
			width		#(fWidth)*4+6
			translations	'<Btn1Down>: set() notify() unset()'
			bitmapPath	$(bitmaps)
			highlightMode	0
			selectMode	0
		endres:
		act:
			put 4 $(kind)
			job change
		endact:
	endditem:
	ditem: 4b
		res:
			itemType	button
			label		b(16)
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			fromVert	3a
			fromHoriz	4a
			vertDistance	#(fWidth)
			horizDistance	-1
			borderWidth	1
			width		#(fWidth)*9+13
			translations	'<Btn1Down>: set() notify() unset()'
			bitmapPath	$(bitmaps)
			highlightMode	0
			selectMode	0
		endres:
		act:
			put 4 $(kind)
			job change
		endact:
	endditem:
	ditem: 4g
		res:
			itemType	button
			label		g(16)
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			fromVert	3a
			fromHoriz	4b
			vertDistance	#(fWidth)
			horizDistance	-1
			borderWidth	1
			width		#(fWidth)*9
			translations	'<Btn1Down>: set() notify() unset()'
			bitmapPath	$(bitmaps)
			highlightMode	0
			selectMode	0
		endres:
		act:
			put 4 $(kind)
			job change
		endact:
	endditem:
	ditem: select
		res:
			itemType	button
			fromVert	msg2
			fromHoriz	1c
			label		'   '
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
		endres:
		act:
			switch #(kind)
				case 1:
				case 2:
				case 3:
					put hd41 $(DRIVE_TYPE)
					break
				case 4:
					put hd41l $(DRIVE_TYPE)
					break
			endswitch
			job off
			close
		endact:
	endditem:
	ditem: note1
		res:
			itemType	bitmap
			fromVert	4a
			label		'빮[xxx]'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			foreground	brown
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
			bitmapPath	$(bitmaps)
		endres:
	endditem:
	ditem: note2
		res:
			itemType	bitmap
			fromVert	4a
			fromHoriz	note1
			label		'() ̹ ǰ ִ Ƽ Ÿ ֽϴ.'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	0
		endres:
	endditem:
enddialog:
proc: pre
	put 0 $(menu_no)
	put on $(mapped)
	put off $(opened)
	put 0 $(kind)
	put 0 $(cur_kind)
	put off $(a)
	put off $(c)
	put off $(d)
	put off $(f)
	put off $(g)
	put off $(gl)
endproc:
proc: close
	switch $(ONRUN)
		case on:
			quit
	endswitch
	job off
	put '' $(DRIVE_TYPE)
	close
endproc:
proc: off
	job unselect
	switch $(c)
		case on:
			setval 1c label c(40)
			setval 1c foreground black
			setval 1c selected false
			setval 1c selectedBack #aebddb
			setval 1c selectedFore black
			switch $(COLOR)
				case MONO:
				case GRAY:
					setval 1c backgroundFile close_box_16::CBM
					break
			endswitch
			quit
	endswitch
	switch $(a)
		case on:
			setval 2a label a(7)
			setval 3a label a(7)
			setval 4a label a(7)
			setval 2a foreground black
			setval 3a foreground black
			setval 4a foreground black
			setval 2a selected false
			setval 3a selected false
			setval 4a selected false
			setval 2a selectedBack #aebddb
			setval 3a selectedBack #aebddb
			setval 4a selectedBack #aebddb
			setval 2a selectedFore black
			setval 3a selectedFore black
			setval 4a selectedFore black
			switch $(COLOR)
				case MONO:
				case GRAY:
					setval 2a backgroundFile close_box_16::CBM
					setval 3a backgroundFile close_box_16::CBM
					setval 4a backgroundFile close_box_16::CBM
					break
			endswitch
			break
	endswitch
	switch $(g)
		case on:
			setval 3g label g(27)
			setval 3g foreground black
			setval 3g selected false
			setval 3g selectedBack #aebddb
			setval 3g selectedFore black
			switch $(COLOR)
				case MONO:
				case GRAY:
					setval 3g backgroundFile close_box_16::CBM
					break
			endswitch
			quit
	endswitch
	switch $(gl)
		case on:
			setval 4g label g(16)
			setval 4g foreground black
			setval 4g selected false
			setval 4g selectedBack #aebddb
			setval 4g selectedFore black
			switch $(COLOR)
				case MONO:
				case GRAY:
					setval 4g backgroundFile close_box_16::CBM
					break
			endswitch
			quit
	endswitch
	switch $(f)
		case on:
			setval 2f label f(19)
			setval 2f foreground black
			setval 2f selected false
			setval 2f selectedBack #aebddb
			setval 2f selectedFore black
			switch $(COLOR)
				case MONO:
				case GRAY:
					setval 2f backgroundFile close_box_16::CBM
					break
			endswitch
	endswitch
	switch $(d)
		case on:
			setval 2d label d(7)
			setval 2d foreground black
			setval 2d selected false
			setval 2d selectedBack #aebddb
			setval 2d selectedFore black
			switch $(COLOR)
				case MONO:
				case GRAY:
					setval 2d backgroundFile close_box_16::CBM
					break
			endswitch
	endswitch
endproc:
proc: unselect
	switch #(cur_kind)
		case 1:
			setval 1c selected false
			break
		case 2:
			setval 2a borderColor black
			setval 2b borderColor black
			setval 2d borderColor black
			setval 2f borderColor black
			setval 2a selected false
			setval 2b selected false
			setval 2d selected false
			setval 2f selected false
			break
		case 3:
			setval 3a borderColor black
			setval 3b borderColor black
			setval 3g borderColor black
			setval 3a selected false
			setval 3b selected false
			setval 3g selected false
			break
		case 4:
			setval 4a borderColor black
			setval 4b borderColor black
			setval 4g borderColor black
			setval 4a selected false
			setval 4b selected false
			setval 4g selected false
			break
	endswitch
endproc:
proc: open
	setval select sensitive false
	put /dev/r$(DRIVE_NO) $(dev)
	$(bin)/Sgetdinfo $(DRIVE_NO) 2> /dev/null
	switch #(status)
		case 0x100:
			job noinfo
			break
		case 0x200:
		case 0x300:
			quit
		case 0:
			put $(stdout) $(DISK_TYPE)
			switch $(DISK_TYPE)
				case hd41:
				case HD41:
					job hd41
						break
				case hd41l:
				case HD41L:
					job hd41l
						break
			endswitch
			break
	endswitch
	switch $(COLOR)
		case MONO:
		case GRAY:
			setval note1 backgroundFile GRAY3
			break
	endswitch
endproc:
proc: noinfo
	put hd41 $(DISK_TYPE)
	job hd41
	put hd41l $(DISK_TYPE)
	job hd41l
endproc:
proc: hd41
	$(bin)/Smnt_check $(dev)c $(DISK_TYPE) 2 1 2> /dev/null
	switch #(status)
		case 0:
			put on $(c)
	endswitch
	$(bin)/Smnt_check $(dev)a $(DISK_TYPE) 0 1 2> /dev/null
	switch #(status)
		case 0:
			put on $(a)
			put off $(c)
	endswitch
	$(bin)/Smnt_check $(dev)g $(DISK_TYPE) 6 1 2> /dev/null
	switch #(status)
		case 0:
			put on $(g)
			put off $(c)
	endswitch
	$(bin)/Smnt_check $(dev)f $(DISK_TYPE) 5 1 2> /dev/null
	switch #(status)
		case 0:
			put on $(f)
			put off $(g)
			put off $(c)
	endswitch
	$(bin)/Smnt_check $(dev)d $(DISK_TYPE) 3 1 2> /dev/null
	switch #(status)
		case 0:
			put on $(d)
			put off $(g)
			put off $(c)
	endswitch
	switch $(c)
		case on:
			setval 1c label C[40]
			setval 1c foreground brown
			setval 1c selectedBack brown
			setval 1c selectedFore #e6e6e1
			switch $(COLOR)
				case MONO:
				case GRAY:
					setval 1c backgroundFile GRAY3
					break
			endswitch
	endswitch
	switch $(a)
		case on:
			setval 2a label A[7]
			setval 3a label A[7]
			setval 4a label A[7]
			setval 2a foreground brown
			setval 3a foreground brown
			setval 4a foreground brown
			setval 2a selectedBack brown
			setval 3a selectedBack brown
			setval 4a selectedBack brown
			setval 2a selectedFore #e6e6e1
			setval 3a selectedFore #e6e6e1
			setval 4a selectedFore #e6e6e1
			switch $(COLOR)
				case MONO:
				case GRAY:
					setval 2a backgroundFile GRAY3
					setval 3a backgroundFile GRAY3
					setval 4a backgroundFile GRAY3
					break
			endswitch
	endswitch
	switch $(g)
		case on:
			setval 3g label G[27]
			setval 3g foreground brown
			setval 3g selectedBack brown
			setval 3g selectedFore #e6e6e1
			switch $(COLOR)
				case MONO:
				case GRAY:
					setval 3g backgroundFile GRAY3
					break
			endswitch
	endswitch
	switch $(f)
		case on:
			setval 2f label F[19]
			setval 2f foreground brown
			setval 2f selectedBack brown
			setval 2f selectedFore #e6e6e1
			switch $(COLOR)
				case MONO:
				case GRAY:
					setval 2f backgroundFile GRAY3
					break
			endswitch
	endswitch
	switch $(d)
		case on:
			setval 2d label D[7]
			setval 2d foreground brown
			setval 2d selectedBack brown
			setval 2d selectedFore #e6e6e1
			switch $(COLOR)
				case MONO:
				case GRAY:
					setval 2d backgroundFile GRAY3
					break
			endswitch
	endswitch
endproc:
proc: hd41l
	$(bin)/Smnt_check $(dev)c $(DISK_TYPE) 2 1 2> /dev/null
	switch #(status)
		case 0:
			put on $(c)
	endswitch
	$(bin)/Smnt_check $(dev)a $(DISK_TYPE) 0 1 2> /dev/null
	switch #(status)
		case 0:
			put on $(a)
			put off $(c)
	endswitch
	$(bin)/Smnt_check $(dev)g $(DISK_TYPE) 6 1 2> /dev/null
	switch #(status)
		case 0:
			put on $(gl)
			put off $(c)
	endswitch
	switch $(c)
		case on:
			setval 1c label C[40]
			setval 1c foreground brown
			setval 1c selectedBack brown
			setval 1c selectedFore #e6e6e1
			switch $(COLOR)
				case MONO:
				case GRAY:
					setval 1c backgroundFile GRAY3
					break
			endswitch
	endswitch
	switch $(a)
		case on:
			setval 2a label A[7]
			setval 3a label A[7]
			setval 4a label A[7]
			setval 2a foreground brown
			setval 3a foreground brown
			setval 4a foreground brown
			setval 2a selectedBack brown
			setval 3a selectedBack brown
			setval 4a selectedBack brown
			setval 2a selectedFore #e6e6e1
			setval 3a selectedFore #e6e6e1
			setval 4a selectedFore #e6e6e1
			switch $(COLOR)
				case MONO:
				case GRAY:
					setval 2a backgroundFile GRAY3
					setval 3a backgroundFile GRAY3
					setval 4a backgroundFile GRAY3
					break
			endswitch
	endswitch
	switch $(gl)
		case on:
			setval 4g label G[16]
			setval 4g foreground brown
			setval 4g selectedBack brown
			setval 4g selectedFore #e6e6e1
			switch $(COLOR)
				case MONO:
				case GRAY:
					setval 4g backgroundFile GRAY3
					break
			endswitch
	endswitch
endproc:
proc: change
	switch #(cur_kind)
		case 0:
			setval select sensitive true
	endswitch
	switch #(kind)
		case #(cur_kind):
			quit
	endswitch
	job unselect
	put $(kind) $(cur_kind)
	switch #(cur_kind)
		case 1:
			put c $(PARTITIONS)
			setval 1c selected true
			break
		case 2:
			put abdf $(PARTITIONS)
			setval 2a borderColor white
			setval 2b borderColor white
			setval 2d borderColor white
			setval 2f borderColor white
			setval 2a selected true
			setval 2b selected true
			setval 2d selected true
			setval 2f selected true
			break
		case 3:
			put abg $(PARTITIONS)
			setval 3a borderColor white
			setval 3b borderColor white
			setval 3g borderColor white
			setval 3a selected true
			setval 3b selected true
			setval 3g selected true
			break
		case 4:
			put abg $(PARTITIONS)
			setval 4a borderColor white
			setval 4b borderColor white
			setval 4g borderColor white
			setval 4a selected true
			setval 4b selected true
			setval 4g selected true
			break
	endswitch
endproc:
proc: cmd_end
	buzzer $(main)
	close $(onrun)
	switch $(mapped)
		case on:
			$(n_end) = sub $(commonPath)/normalEnd ++48++48
			trap $(n_end) n_end
			break
		case off:
			put on $(opened)
			break
	endswitch
	put 102 $(menu_no)
endproc:
proc: unmap
	switch #(menu_no)
		case 101:
			unmap $(onrun)
			break
		case 102:
			unmap $(n_end)
			break
	endswitch
	put off $(mapped)
endproc:
proc: map
	switch #(menu_no)
		case 101:
			move $(onrun)
			raise $(onrun)
			map $(onrun)
			break
		case 102:
			switch $(opened)
				case on:
					$(n_end) = sub $(commonPath)/normalEnd ++48++48
					trap $(n_end) n_end
					break
				case off:
					move $(n_end)
					raise $(n_end)
					map $(n_end)
					break
			endswitch
	endswitch
	put on $(mapped)
	put off $(opened)
endproc:
proc: title
	job move
	job up
endproc:
proc: raise
	job up
endproc:
proc: move
	switch #(menu_no)
		case 101:
			move $(onrun)
			break
		case 102:
			move $(n_end)
			break
	endswitch
endproc:
proc: up
	switch #(menu_no)
		case 101:
			raise $(onrun)
			break
		case 102:
			raise $(n_end)
			break
	endswitch
endproc:
proc: n_end
	put off $(ONRUN)
	put 0 $(menu_no)
endproc:
proc: confirm
	switch $(answer)
		case cancel:
			put 0 $(menu_no)
			quit
	endswitch
	put on $(ONRUN)
	put 101 $(menu_no)
	$(onrun) = sub $(commonPath)/onrun ++48++48
endproc:
proc: sub_end
	put 0 $(menu_no)
endproc:
