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
		defaultButton		ok
	endres:
	ditem: msg
		res:
			itemType	bitmap
			label		'Ȯ , ٽѹ ԷϿ ֽʽÿ.'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
		endres:
	endditem:
	ditem: passwd_cover
		res:
			itemType	bitmap
			fromVert	msg
			leftLabel	'        '
			leftKanjiFont	$(kanjiFont)
			leftFont	$(kanaFont)
			borderWidth	2
			height		#(fHeight)+4
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
		endres:
	endditem:
	ditem: passwd
		res:
			itemType	text
			fromVert	msg
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
			length		8
			height		#(fHeight)
			width		#(fWidth)*8+4
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			focus
			shadowWidth	0
			borderWidth	0
			bind		getchar
		endres:
		act:
			put $(passwd)
		endact:
	endditem:
	ditem: ok
		res:
			itemType	button
			fromVert	msg
			fromHoriz	passwd
			label		' ϡ '
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*8
		endres:
		act:
			switch #(step)
				case 1:
					put $(passwd) $(newpasswd)
					put 2 $(step)
					job init
					buzzer
					break
				case 2:
					$(bin)/Spwd_check -u $(USER_NAME) -s $(newpasswd) $(passwd) 2> /dev/null
					switch #(status)
						case 0:
							put on $(ONRUN)
							put 101 $(menu_no)
							$(onrun) = sub $(commonPath)/onrun ++48++48
							$(pid) = bg $(etc)/User/Spassword.sh set $(USER_NAME) $(passwd)
							$(bgstat) = trap $(pid) cmd_end
							break
						default:
							put 'Էµ н尡  ʽϴ.' $(confirm_msg1)
							put ' ٽ մϱ?' $(confirm_msg2)
							put 10 $(menu_no)
							$(err) = sub $(commonPath)/yesno2 ++48++48
							buzzer
							trap $(err) retry
							break
					endswitch
					break
			endswitch
		endact:
	endditem:
enddialog:
proc: pre
	put off $(opened)
	put on $(mapped)
	put 0 $(menu_no)
endproc:
proc: close
	close
endproc:
proc: open
	put 1 $(step)
	job init
endproc:
proc: init
	put '' $(passwd)
	setval passwd string $(passwd)
	job getchar
	switch #(step)
		case 1:
			setval title leftLabel 'н '
			setval msg label 'ο н带 ԷϿ ֽʽÿ.  '
			break
		case 2:
			setval title leftLabel 'н Ȯ'
			setval msg label 'Ȯ , ٽѹ ԷϿ ֽʽÿ.'
			break
	endswitch
endproc:
proc: retry
	switch $(answer)
		case ok:
			put 1 $(step)
			job init
			buzzer
			break
		case cancel:
			close
			break
	endswitch
endproc:
proc: cmd_end
	buzzer $(main)
	close $(onrun)
	switch $(mapped)
		case on:
			job bgdone
			break
		default:
			put on $(opened)
			break
	endswitch
	put 102 $(menu_no)
endproc:
proc: bgdone
	switch #(bgstat)
		case 0:
			$(n_end) = sub $(commonPath)/normalEnd ++48++48
			trap $(n_end) n_end
			quit
		default:
			put 'н尡  ʾҽϴ.' $(confirm_msg1)
			$(n_end) = sub $(commonPath)/error1 ++48++48
			trap $(n_end) n_err
			break
	endswitch
endproc:
proc: n_end
	put off $(ONRUN)
	put 0 $(menu_no)
	close
endproc:
proc: n_err
	put off $(ONRUN)
	put 0 $(menu_no)
endproc:
proc: getchar
	varlen $(passwd)
	switch #(status)
		case 0:
			put '?' $(str)
			setval ok sensitive false
			break
		case 1:
			put '#?' $(str)
			setval ok sensitive true
			break
		case 2:
			put '##?' $(str)
			break
		case 3:
			put '###?' $(str)
			break
		case 4:
			put '####?' $(str)
			break
		case 5:
			put '#####?' $(str)
			break
		case 6:
			put '######?' $(str)
			break
		case 7:
			put '#######?' $(str)
			break
		case 8:
			put '########' $(str)
			break
	endswitch
	setval passwd_cover leftLabel $(str)
endproc:
proc: unmap
	switch #(menu_no)
		case 10:
			unmap $(err)
			break
		case 101:
			unmap $(onrun)
			break
		case 102:
			unmap $(n_end)
			break
	endswitch
endproc:
proc: map
	switch #(menu_no)
		case 10:
			move $(err)
			raise $(err)
			map $(err)
			break
		case 101:
			move $(onrun)
			raise $(onrun)
			map $(onrun)
			break
		case 102:
			switch $(opened)
				case on:
					job bgdone
					break
				default:
					move $(n_end)
					raise $(n_end)
					map $(n_end)
					break
			endswitch
			break
	endswitch
endproc:
proc: title
	job move
	job up
endproc:
proc: raise
	job up
endproc:
proc: move
	switch #(menu_no)
		case 10:
			move $(err)
			break
		case 101:
			move $(onrun)
			break
		case 102:
			move $(n_end)
			break
	endswitch
endproc:
proc: up
	switch #(menu_no)
		case 10:
			raise $(err)
			break
		case 101:
			raise $(onrun)
			break
		case 102:
			raise $(n_end)
			break
	endswitch
endproc:
