#module
#deffunc listbox_index int
mref id, 0
mref stt, 64
objsend id, 0x188, 0, nonuse // リスト選択アイテムを取得
return stat
#deffunc listbox_add int, str
mref id, 0 : mref string, 33
s = string
objsend id, 0x180, 0, s // リストアイテムを追加
return
#deffunc listbox_ins int, str, int
mref id, 0 : mref string, 33 : mref no, 2
s = string
objsend id, 0x181, no, s // リストアイテムを挿入
return
#deffunc listbox_del int, int
mref id, 0 : mref no, 1
objsend id, 0x182, no, nonuse // リストアイテムを削除
return
#global
objsize 150, 20
pos 10, 10
button "追加", *list
button "挿入", *list
button "削除", *list
pos 10, 100 : listbox index.1, 200, "リスト既存1\nリスト既存2\nリスト既存3" // オブジェクトID:3
stop
*list
// 押されたボタンの処理を行う
btnid = stat
listbox_index 3 : no = stat
switch btnid
case 0: lst.0++ : listbox_add 3, "リスト追加" + lst.0 : swbreak
case 1: lst.1++ : listbox_ins 3, "リスト挿入" + lst.1, no : swbreak
case 2: listbox_del 3, no : swbreak
swend
stop
|