| LISPのダイアログ・プログラムについて |
(choose-item-dialog "性別" (list "男" "女" "その他")) |
(defun dialog-box ()
(let* ((gender (send choice-item-proto :new (list "男" "女" "その他") :value 0))
(ok (send modal-button-proto :new "OK"
:action #'(lambda () (send self :dialog-result))))
(dialog-design (send modal-dialog-proto :new
(list
(list gender)
(list ok)
))))
(defmeth ok :dialog-result ()
(send gender :value)
)
#+msdos (send dialog-design :modal-dialog)
))
|
(defun dialog-box ()
(let* ((name-txt (send text-item-proto :new "名前:"))
(name (send edit-text-item-proto :new "" :text-length 15))
(gender (send choice-item-proto :new (list "男" "女" "その他") :value 0))
(age-txt (send text-item-proto :new "年齢:"))
(age-null (send text-item-proto :new " "))
(age (send interval-scroll-item-proto
:new (list 1 100) :points 100 :text-item age-null))
(married (send toggle-item-proto :new "実は既婚" :value t))
(ok (send modal-button-proto :new "OK"
:action #'(lambda () (send self :dialog-result))))
(dialog-design (send modal-dialog-proto :new
(list
(list name-txt name)
(list gender)
(list age-txt age age-null)
(list married)
(list ok)
))))
(defmeth ok :dialog-result ()
(list
(send name :text)
(send gender :value)
(send age :value)
(send married :value)
))
#+msdos (send dialog-design :modal-dialog)
))
|
|
|
Produce:Teranishi |