#include "hsp3utf.as"
title "Sub Launcher"
screen 0,660,500
sdim str4note,32000
notesel str4note
noteload "Luncher_Info_A.txt"
*l_begin
clrobj
color 0,0,128
boxf 0,0,700,700
objsize 320,300
lb_sel = 0
objmode 2
font "",16
pos 15,15
listbox lb_sel,100,str4note
pos 350,0
objsize 150,30
mes ""
button "I",*l_select
mes ""
sdim str4mesbox,10000
mesbox str4mesbox,290,150
ID4mesbox = stat
mes ""
button "Info_A",*l_chg2info_A
button "Info_B",*l_chg2info_B
button "Info_C",*l_chg2info_C
mes ""
button "Info_A edit",*l_edit_A
button "Info_B edit",*l_edit_B
button "Info_C edit",*l_edit_C
mes ""
button "ReadMe",*l_readme
stop

*l_chg2info_A
	sdim str4note,32000
	notesel str4note
	noteload "Luncher_Info_A.txt"
	goto *l_begin
*l_chg2info_B
	sdim str4note,32000
	notesel str4note
	noteload "Luncher_Info_B.txt"
	goto *l_begin
*l_chg2info_C
	sdim str4note,32000
	notesel str4note
	noteload "Luncher_Info_C.txt"
	goto *l_begin
*l_edit_A
	exec "Luncher_Info_A.txt",16
	stop
*l_edit_B
	exec "Luncher_Info_B.txt",16
	stop
*l_edit_C
	exec "Luncher_Info_C.txt",16
	stop
*l_select
	if lb_sel != -1{
		sdim tmp_s,512
		sdim tmp_show,4000
		noteget tmp_s,lb_sel
		tmp_show = "$ > " + tmp_s + "\n"
		sdim tmp_ss1
		sdim tmp_ss2
		split tmp_s,"#",tmp_ss1,tmp_ss2
		if tmp_ss1 != ""{
			tmp_show += " > " + tmp_ss1 + "\n"
		}
		sdim tmp_sss1
		sdim tmp_sss2
		sdim tmp_sss3
		split tmp_ss1,"%%%",tmp_sss1,tmp_sss2,tmp_sss3
		if tmp_sss1 != ""{
			tmp_show += " > " + tmp_sss1 + "\n"
		}
		if tmp_sss2 != ""{
			tmp_show += " > " + tmp_sss2 + "\n"
		}
		objprm ID4mesbox,tmp_show
		if tmp_sss1 == "URL"{
			if instr(tmp_sss2,0,"http")!=-1{
				if instr(tmp_sss2,0,"//")!=-1{
					exec tmp_sss2,16
				}
			}
		}
		if tmp_sss1 == "exe"{
			exec tmp_sss2
		}
		if tmp_sss1 == "txt"{
			exec "notepad " + tmp_sss2
		}
		if tmp_sss1 == "exec16"{
			exec tmp_sss2,16
		}		
	}
	stop
*l_tmp
	stop
*l_readme
	exec "notepad " + "README.txt"
	stop