; ; HSP help Manager script ; onitama/onion software 1999-2002 ; #include "mod_hs.as" #packopt name "helpman" #packopt runtime "hsp2c.hrt" ; title "HSP help Manager ver1.02" chdir exedir ; EXEのあるディレクトリをカレントに ; sdim work,256 sdim tools,256 if (hspstat&1) { ; debug中 work=curdir+"\\" tools=curdir+"\\" } else { ; exe時 work=exedir+"\\" tools=exedir+"\\" } ; chdir work ; sdim srch,256 sdim bootkw,256 bootkw=cmdline ; 起動時指定キーワード ; i=0:a=0 repeat ; キーワードを小文字に変換する peek a,bootkw,i if a=0 : break if a>='A' : if a<='Z' : poke bootkw,i,a+32 i++ loop *startup ; wx=640:wy=480 hm=0 ; help mode screen 0,wx,wy,paluse gsel 0,1 *main0 cls 1 objmode 1,1 ih_info="" ih_refinf="" ref_num=0 ; sysfont 17 pos 2,wy-292 mesbox ih_info,wx-6,260,1 ; ID0 pos 8,wy-26 mes "関連項目" pos 80,wy-31 objsize wx-85,24 combox ref_num,120,ih_refinf ; ID1 pos 0,0 if bootkw="" : goto *main1 srch=bootkw ; 起動時検索 bootkw="" goto *gohelp *main1 srch="" ; sysfont pos 4,8 mes "命令検索" pos 74,4 objsize 160,24 input srch pos 244,4 objsize 96,24 button "Help表示",*gohelp ; y=wy-350 objsize 120,24 ;pos wx-130,4 ;button "index作成",*main2 pos wx-130,y+28 button "終了",*owari *wtmain objsel 2 hm=2 *wtlp gsel 0 stick i if i&128 : goto *owari ; [Esc] if i&32 : goto *gohelp ; [Enter] wait 1 goto *wtlp *main2 ; index作成 ; exec "mkindex" wait 10 end *gohelp ; help表示スタート ; clrobj 2 ; ID2〜をすべて消去 ihelp_find srch lnnum=stat if lnnum>0 : goto *gohelp2 ; ; プリプロセッサ命令として検索 ; srch="#"+srch ihelp_find srch lnnum=stat if lnnum=0 : dialog "該当する項目がありません." : goto *main0 *gohelp2 ; キーワード一致 ; if lnnum=1 : ihelp_open 0 : goto *helpprt ; 複数の項目選択 ; ans_num=0 ; color 192,192,192 boxf 0,0,wx,185 sysfont color 0,0,0 pos 4,8:mes "["+srch+"]の検索結果" pos 4,34 notesel ih_ansbuf:notemax i mes ""+i+"項目の該当キーワードがあります。" ; objsize 320,24 listbox ans_num,120,ih_ansbuf ; ID2 pos 330,52 objsize 120,130 button "HELP表示",*hsel2 ; objsize 120,24 y=wy-350 pos wx-130,y+28 button "戻る",*main0 ; objsel 2 hm=3 *hselm gsel 0 stick i if i&128 : goto *main0 ; [Esc] if i&32 : goto *hsel2 ; [Enter] wait 1 goto *hselm *hsel2 clrobj 2 ; ID2〜をすべて消去 ihelp_open ans_num *helpprt ; help表示メイン ; color $f0,$e0,$d0 boxf 0,29,wx,185 color 0,0,128 boxf 0,0,wx,29 font "MS ゴシック",24,1 color 250,250,250 pos 4,4 mes ih_ans_key font "MS ゴシック",16,1 color 0,255,255 strlen a,ih_ans_title:a=a+4*8 pos 620-a,8 mes "["+ih_ans_title+"]" ; if ih_fncprm="" : goto *nofnc ; font "MS ゴシック",14,1 if ih_ans_dll="" : goto *nodll ; color 192,64,64 pos 12,166 mes "拡張プラグイン["+ih_ans_dll+"]が必要です。" *nodll color 0,0,0 pos 12,34 mes ih_ans_key+" "+ih_fncprm ; font "MS ゴシック",13,0 pos csrx,csry+4 mes ih_prminf *nofnc if ih_info!="" : ih_info+="\n[備考]\n"+ih_opt ; 拡張情報も取得(1.01) objprm 0,ih_info objprm 1,ih_refsel : ref_num=0 : objprm 1,0 objsize 26,24 if ih_prgsmp="" : goto *nosmp pos wx-95,34 button "S",*main3 *nosmp pos wx-65,34 button "I",*main4 pos wx-35,34 button "R",*main0 ; objsize 120,24 y=wy-350 pos wx-130,y+28 button "閉じる",*owari *chkrm ; ヘルプ表示チェックメイン ; gsel 0 a=ref_num hm=1 *chkref stick i if i&128 : goto *main0 ; [Esc] wait 1 if a=ref_num : goto *chkref ; 関連項目の選択チェック if ref_num=0 : goto *chkref notesel ih_refinf noteget srch,ref_num-1 ; peek a,srch,0 if a!='!' : goto *gohelp ; tmp="" peek tmp,srch,1 exec tmp ; 「!command」を実行 goto *chkrm *main3 ; sample program 表示 ; gosub *infopen title "["+ih_ans_key+"] 追加情報" objprm 0,ih_prgsmp goto *chkrm *main4 ; information 表示 ; ihelp_info gosub *infopen title "["+ih_ans_key+"] の詳細情報" ; objprm 0,ih_opt goto *chkrm *infopen ; 情報ウインドゥ表示 ; screen 2,480,200,paluse cls 1 objmode 1 ; sdim infadd,$4000 ; 追加情報表示バッファ(16K) ; pos 2,2 mesbox infadd,474,160,1 ; ID0 pos 320,170 objsize 150,24 button "閉じる",*infclose ; return *infclose ; [close]ボタンからのメイン復帰 ; gsel 2,-1 if hm=1 : goto *chkrm if hm=2 : goto *wtlp if hm=3 : goto *hselm stop *owari end