
<script sc_FindHistory>
	mydata.history.list.index 0
	.map.store_cursor_pos
    NEXTSTATE st_FindHistory
</script>


<state st_FindHistory>
	<uselayer ui_Header2/>
    <uselayer ui_Background/>
	<uselayer ui_Title/>
	<uselayer ui_Footer2/>
	<uselayer ui_FindHistory_wr/>
	<uselayer ui_FindHistory_wor/>

	<script init>
		Title.set "History"
		runif dFindHistoryListType 0 'ui_FindHistory_wr.hide, ui_FindHistory_wor.show'
		else_run 'ui_FindHistory_wor.hide, ui_FindHistory_wr.show'
	</script>
</state>

<script sc_SearchHistoryAndGo>
	SELECT_HISTORY %mydata.history.list.index

	run sc_OpenMapAfterFind
</script>

<state st_ManageHistory>
	<uselayer ui_Header2/>
	<uselayer ui_Background/>
	<uselayer ui_Title/>
	<uselayer ui_Footer2/>
	<uselayer ui_ManageHistory/>

	<script init>
		title.set "Manage History"

	    runif %mydata.history.list.size 0 'btnMH_ClearAll.disable'
	    else_run 'btnMH_ClearAll.enable'
	</script>

</state>

<script sc_btnMH_ClearAll_OnRelease>
    INITMESSAGEBOX 1 "Deleting all history entries." 'CLEARHISTORY, STATE st_ManageHistory'
</script>

<script sc_et_ManageHistoryDel_OnRelease>
	vTmpID.SET %mydata.history.list.index
	INITMESSAGEBOX 1 "Deleting history entry." 'REMOVEHISTORYITEM vTmpID, STATE st_ManageHistory'
</script>
<script d_ChandeModeListRouteHistory>
	runif dFindHistoryListType 0 'dFindHistoryListType.set 1'
	else_run 'dFindHistoryListType.set 0'
	runif $1 0 st_FindHistory_init
</script>

