dialog styles {
title "Editbox Styles"
size -1 -1 125 20
option dbu
edit "KingTomato Styles Demo", 1, 0 0 100 10, autohs
button "Close", 2, 100 0 25 10, ok
radio "Shake", 3, 0 10 30 10, group
radio "Scroll", 4, 45 10 30 10
radio "Blink", 5, 90 10 30 10
}
on 1:DIALOG:styles:INIT:*: {
/did -c $dname 3
/styles.show $dname init
.timerstyles -m 0 300 /styles.show $dname
}
alias styles.show {
if ($dialog($$1)) {
if ($2 == init) {
/did -ra $$1 1 $replace($did($$1, 1), $chr(32), $chr(160))
/set -u5 %styleMsg $did($$1, 1)
}
else /set -u5 %styleMsg %styleMsg
var %curVal = $did($$1, 1)
if ($did($$1, 3).state == 1) {
if ($left(%curVal, 1) == $chr(160)) /did -ra $$1 1 $right(%curVal, -1)
else /did -ra $$1 1 $+($chr(160),%curVal)
}
else if ($did($$1, 4).state == 1) {
if (!%curVal) /did -ra $$1 1 %styleMsg
/did -ra $$1 1 $right(%curVal, -1) $+ $left(%curVal, 1)
}
else if ($did($$1, 5).state == 1) {
if (%curVal) /did -r $$1 1
else /did -ra $$1 1 %styleMsg
}
}
else .timer [ $+ [ $$1 ] ] off
}