window:
	res:
		windowType	wstandard
	endres:
endwindow:
close:
	res:
		bitmapPath	$(bitmaps)
		bitmapFile	CLOSE::CBM
	endres:
endclose:
title:
	res:
		leftLabel	'Ʈ Ŀǵ 㰡'
		leftKanjiFont	$(kanjiFont)
		leftFont	$(kanaFont)
		rightLabel	.rhosts
		rightKanjiFont	$(kanjiFont)
		rightFont	$(kanaFont)
		switch $(COLOR)
			case MONO:
				bitmapPath	$(bitmaps)
				backgroundFile	GRAY3
				transparent	false
				break
		endswitch
	endres:
endtitle:
dialog: dialogs
	res:
		defaultDistance		#(fWidth)
		dialogType		modeless
	endres:
	ditem: host_label
		res:
			itemType	bitmap
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
			label		ȣƮ
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
		endres:
	endditem:
	ditem: host
		res:
			itemType	bitmap
			fromHoriz	host_label
			vertDistance	#(fWidth)
			horizDistance	0
			leftLabel	'                '
			leftKanjiFont	$(kanjiFont)
			leftFont	$(kanaFont)
			borderWidth	1
		endres:
	endditem:
	ditem: host_list
		res:
			itemType	scrtext
			fromVert	host
			vertDistance	4
			horizDistance	#(fWidth)
			width		#(fWidth)+1*20
			height		#(lHeight)*6+8
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			bind1		host_select1
			bind2		host_select2
			file		/dev/null
		endres:
		act:
			put $(line)
			put $(line)@0 $(NEW_NAME1)
		endact:
	endditem:
	ditem: host_select
		res:
			itemType	button
			fromVert	host_label
			fromHoriz	host_list
			vertDistance	#(fHeight)*4
			horizDistance	#(fWidth)
			label		'   '
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
		endres:
		act:
			put $(NEW_NAME1) $(NEW_NAME)
			job host_select
		endact:
	endditem:
	ditem: user_label
		res:
			itemType	bitmap
			fromVert	host_list
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
			label		'    '
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
		endres:
	endditem:
	ditem: user
		res:
			itemType	bitmap
			fromHoriz	user_label
			fromVert	host_list
			vertDistance	#(fWidth)
			horizDistance	0
			leftLabel	'                '
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			borderWidth	1
		endres:
	endditem:
	ditem: user_list
		res:
			itemType	scrtext
			fromVert	user
			vertDistance	4
			horizDistance	#(fWidth)
			width		#(fWidth)+1*20
			height		#(lHeight)*6+8
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			bind1		user_select1
			bind2		user_select2
			file		/dev/null
		endres:
		act:
			put $(line)
			put $(line)@0 $(NEW_USER1)
		endact:
	endditem:
	ditem: user_select
		res:
			itemType	button
			fromVert	user_label
			fromHoriz	user_list
			vertDistance	#(fHeight)*4
			horizDistance	#(fWidth)
			label		'   '
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
		endres:
		act:
			put $(NEW_USER1) $(NEW_USER)
			job user_select
		endact:
	endditem:
	ditem: select
		res:
			itemType	button
			fromVert	user_list
			vertDistance	#(fHeight)
			horizDistance	#(fWidth)
			label		'   '
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
		endres:
		act:
			job select
		endact:
	endditem:
	ditem: belong_label
		res:
			itemType	bitmap
			fromHoriz	host_select
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
			label		'㰡 ȣƮ'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
		endres:
	endditem:
	ditem: belong
		res:
			itemType	scrtext
			fromVert	belong_label
			fromHoriz	host_select
			vertDistance	4
			horizDistance	#(fWidth)*2
			width		#(fWidth)+1*30
			height		#(lHeight)*15+8
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			bind1		delete1
			bind2		delete2
			file		/dev/null
		endres:
		act:
			put $(line)
			put $(line)@0 $(DEL_NAME)
			put $(line)@1 $(DEL_USER)
		endact:
	endditem:
	ditem: del
		res:
			itemType	button
			fromVert	belong
			fromHoriz	host_select
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
			label		'   '
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
		endres:
		act:
			job delete2
		endact:
	endditem:
	ditem: set
		res:
			itemType	button
			fromVert	belong_label
			fromHoriz	belong
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
			label		'   '
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
		endres:
		act:
			put 'Ʈ 㰡' $(cmdName)
			put on $(ONRUN)
			$(etc)/Network/Srhosts.sh mklist $(USER) $(NEW_LIST) > $(HOME)/.rhosts
			buzzer $(main)
			put 102 $(menu_no)
			$(n_end) = sub $(commonPath)/normalEnd ++48++48
			trap $(n_end) n_end
		endact:
	endditem:
	ditem: reset
		res:
			itemType	button
			fromVert	set
			fromHoriz	belong
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
			label		'   '
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
		endres:
		act:
			cp $(OLD_LIST) $(NEW_LIST)
			job belong_init
		endact:
	endditem:
	ditem: clear
		res:
			itemType	button
			fromVert	reset
			fromHoriz	belong
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
			label		' Ŭ '
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
		endres:
		act:
			echo -n > $(NEW_LIST)
			job belong_init
		endact:
	endditem:
enddialog:
proc: pre
	$(TMP) = mktemp
	put /tmp/$(TMP) $(NEW_LIST)
	$(TMP) = mktemp
	put /tmp/$(TMP) $(OLD_LIST)
	$(TMP) = mktemp
	put /tmp/$(TMP) $(STATION_LIST)
	$(TMP) = mktemp
	put /tmp/$(TMP) $(USER_LIST)
	$(TMP) = mktemp
	put /tmp/$(TMP) $(TMP_LIST)
	$(bin)/Snet_check -lh > $(TMP_LIST)
	sort -u $(TMP_LIST) > $(STATION_LIST)
	$(bin)/Spw_check -lu > $(TMP_LIST)
	sort -u $(TMP_LIST) > $(USER_LIST)
	$(etc)/Network/Srhosts.sh list $(USER) > $(OLD_LIST)
	cp $(OLD_LIST) $(NEW_LIST)
	put 0 $(menu_no)
	put on $(mapped)
	put off $(opened)
endproc:
proc: close
	switch $(ONRUN)
		case on:
			quit
	endswitch
	job off
	close
endproc:
proc: off
	rm -f $(NEW_LIST) $(OLD_LIST) $(STATION_LIST) $(USER_LIST) $(TMP_LIST)
endproc:
proc: open
	switch $(HOME)
		case /:
			setval title rightLabel /.rhosts
			break
		default:
			setval title rightLabel $(HOME)/.rhosts
			break
	endswitch
	setval title leftLabel	'Ʈ Ŀǵ 㰡(to ($(USER)))'
	setval host_list file $(STATION_LIST)
	setval user_list file $(USER_LIST)
	setval host_select sensitive false
	setval user_select sensitive false
	setval select sensitive false
	put $(USER) $(NEW_USER)
	setval user leftLabel $(NEW_USER)
	job belong_init
endproc:
proc: host_select1
	switch $(NEW_NAME1)
		case '':
			quit
	endswitch
	setval host_select sensitive true
endproc:
proc: host_select2
	switch $(NEW_NAME1)
		case '':
			quit
	endswitch
	put $(NEW_NAME1) $(NEW_NAME)
	setval host_select selected true
	job host_select
	setval host_select selected false
endproc:
proc: host_select
	setval host leftLabel $(NEW_NAME)
	setval select sensitive true
endproc:
proc: user_select1
	switch $(NEW_USER1)
		case '':
			quit
	endswitch
	setval user_select sensitive true
endproc:
proc: user_select2
	switch $(NEW_USER1)
		case '':
			quit
	endswitch
	put $(NEW_USER1) $(NEW_USER)
	setval user_select selected true
	job user_select
	setval user_select selected false
endproc:
proc: user_select
	setval user leftLabel $(NEW_USER)
endproc:
proc: select
	switch $(NEW_USER)
		case '':
			put '  $(NEW_NAME)' > $(TMP_LIST)
			break
		default:
			put '  $(NEW_NAME)\L16  $(NEW_USER)' > $(TMP_LIST)
			break
	endswitch
	$(bin)/Sfile_op -a -i $(TMP_LIST) -o $(NEW_LIST)
	put '' $(NEW_NAME)
	put $(USER) $(NEW_USER)
	setval host leftLabel $(NEW_NAME)
	setval user leftLabel $(NEW_USER)
	setval select sensitive false
	job belong_init
endproc:
proc: delete1
	switch $(DEL_NAME)
		case '':
			quit
	endswitch
	setval del sensitive true
endproc:
proc: delete2
	switch $(DEL_NAME)
		case '':
			quit
	endswitch
	setval del selected true
	job delete
	setval del selected false
endproc:
proc: delete
	switch $(DEL_USER)
		case '':
			put $(DEL_NAME) > $(TMP_LIST)
			break
		default:
			put '$(DEL_NAME) $(DEL_USER)' > $(TMP_LIST)
			break
	endswitch
	$(bin)/Sfile_op -d -i $(TMP_LIST) -o $(NEW_LIST)
	job belong_init
endproc:
proc: belong_init
	setval belong file $(NEW_LIST)
	setval del sensitive false
endproc:
proc: unmap
	switch #(menu_no)
		case 102:
			unmap $(n_end)
			break
	endswitch
	put off $(mapped)
endproc:
proc: map
	switch #(menu_no)
		case 102:
			move $(n_end)
			raise $(n_end)
			map $(n_end)
			break
	endswitch
	put on $(mapped)
endproc:
proc: title
	job move
	job up
endproc:
proc: raise
	job up
endproc:
proc: move
	switch #(menu_no)
		case 102:
			move $(n_end)
			break
	endswitch
endproc:
proc: up
	switch #(menu_no)
		case 102:
			raise $(n_end)
			break
	endswitch
endproc:
proc: n_end
	put off $(ONRUN)
	put 0 $(menu_no)
	job close
endproc:
