alias test { dialog -m test test }
alias mdx.file { return $+($scriptdir,dlls\,$1,.mdx) }
dialog test {
title "Dialog"
size -1 -1 162 246
list 1, 12 10 138 204, size
button "&OK", 2, 11 215 140 24, ok
}
on *:dialog:test:*:*:{
if ($devent == init) {
mdx SetControlMDX $dname 1 TreeView nohscroll haslines hasbuttons showsel > $mdx.file(views)
load.event
}
elseif ($devent == sclick) {
if ($did == 1) {
tokenize 32 $did($did,1)
echo $did($did,1)
}
}
}
alias load.event {
var %d,%t,%a,%l = 1,%z
did -r test 1
did -i test 1 1 cb root
did -a test 1 +eb 1 1 0 0 0 Info
did -i test 1 1 cb last
if ($isfile(info.txt)) {
.fopen info info.txt
while (!$feof) {
tokenize 32 $fread(info)
if ($regex($1-,/^0|1 \d+ .+ .+$/)) {
%t = $asctime($2,%dateformat)
if (%d != %t) {
if (%a) { did -i test 1 1 cb up }
%z = 1
did -a test 1 +e 1 1 0 0 0 %t
did -i test 1 1 cb last
}
var %d = %t,%a = 1
did -a test 1 $iif($1,+,+b) 1 1 0 0 0 $+($gettok($3,1,33))
}
inc %l
}
.fclose info
}
if (!%z) { did -a test 1 + 1 1 0 0 0 No info }
}