onerror goto *error
sdim dir, 256
sdim list1, 4
sdim list2, 4
screen 0, 400, 380
title "パックファイルマネージャ"
color 220, 220, 220 : boxf : color
font "MS ゴシック", 12 : objmode 2
dir = curdir
objsize 120, 25
pos 10, 10 : input dir, 240, 25
pos 270, 10 : button "ディレクトリ移動", *seldir
objsize 380, 40
pos 10, 45 : listbox index.0, , list1
pos 10, 215 : listbox index.1, , list2
objsize 60, 25
pos 10, 180 : button "追加", *add
pos 80, 180 : button "削除", *del
pos 150, 180 : button "全削除", *alldel
objsize 80, 25
pos 220, 180 : chkbox "暗号化する", angou
pos 310, 350 : button "作成", *make
goto *getitem
*error
dialog "操作に誤りがあります。", 1
stop
*update
objprm 2, list1
objprm 3, list2
stop
*seldir
chdir dir // カレントフォルダの変更
*getitem
dirlist list1, "*.*", 1
goto *update
*add
// 選択フォルダ文字列を代入
dir = curdir
// 選択アイテムを取得
notesel list1
noteget item, index.0
strlen len, dir : strmid chk, dir, len - 1, 1
if chk ! "\\" : item = "\\" + item
item = curdir + item
// 既に選択済かをチェックする
notesel list2
notemax rows
repeat rows
noteget chk, cnt
if chk = item : poke item : break // 選択済
loop
if item = "" : stop
// アイテムをセットする
if angou : chk = "+" : else : chk = ""
noteadd chk + item, -1
goto *update
*del
if index.1 < 0 : goto *error
notesel list2
noteget item, index.1
notedel index.1
goto *update
*alldel
poke list2 // クリア
goto *update
*make
notesel list2
notesave exedir + "\\packfile"
dialog "packfileを作成しました"
stop
|