#module
#deffunc chkbox3 str, val
mref caption, 32 : mref state, 17
chkbox caption, state
objsend stat, 0x00F4, 0x06, nonuse, 0 // 3ステートチェックボックス
return
#deffunc getchkbox3 int, val
mref id, 0 : mref state, 17
objsend id, 0x00F2, 0x00, nonuse, 0 // 状態取得
state = stat & 0x03
return
#deffunc setchkbox3 int, int
mref id, 0 : mref value, 1
objsend id, 0x00F1, value, nonuse, 0 // 状態変更
return
#global
objsize 150, 25
pos 10, 10 : mes "野菜が好きならチェックしよう!"
pos 10, 40 : chkbox3 "私は野菜好き", chk // 3ステートチェックボックスを配置する
pos 10, 70 : button "確認する", *push
pos 10, 150 : combox chg, 100, "嫌いに変える\n好きに変える\nどっちだろう?"
pos 10, 180 : button "変更する", *change
stop
*push
switch chk
case 0: dialog "嫌いでも食べましょう", 1 : swbreak
case 1: dialog "好きなのはイイことです", 0 : swbreak
case 2: dialog "ハッキリしましょう", 1 : swbreak
swend
stop
*change
setchkbox3 0, chg // 状態を変更する
getchkbox3 0, chk // 管理変数を更新する
stop
|