alias npanel dialog -m npanel npanel
alias -l npanel_f return $+($mrcdir,npanel.txt)
dialog npanel {
title "Nick Panel - [/npanel]"
size -1 -1 0 0
option dbu
icon $ico, 0
list 2, 0 0 200 110, result size
list 4, 0 110 200 10, size
}
on *:dialog:npanel:init:0:{
mdx SetMircVersion $version
mdx MarkDialog $dname
mdx SetControlMDX $dname 2 ListView infotip autoarrange > $vmdx
mdx SetControlMDX $dname 4 Statusbar hsbar > $bmdx
mdx SetBorderStyle $dname 4 noborder
mdx SetBorderStyle $dname 2 noborder
did -i $dname 2 1 setbkg color $rgb(235,235,235)
did -i $dname 4 1 setbkcolor $rgb(235,235,235)
did -i $dname 2 1 settxt bgcolor $rgb(235,235,235)
;did -i $dname 4 1 setparts 10000 200 -1
did -i $dname 4 1 seticon big $ico
did -i $dname 4 2 1 /npanel
npanel.initicon
}
alias npanel.initicon {
var %file = $npanel_f,%line = 0
did -r npanel 2
did -i npanel 2 1 clearicons normal
while (%line < $lines(%file)) {
inc %line
tokenize 124 $read(%file,%line)
var %iconfile = $iif($gettok($2,2,44),$ifmatch,$gettok($1,2,44))
if (!$isfile(%iconfile)) var %iconfile = $icodir $+ cpanel.ico
else %iconfile = $2
did -i npanel 2 1 seticon normal %iconfile
did -a npanel 2 0 %line $1
}
}
on *:dialog:npanel:dclick:*:{
var %line = $get_a_line1($gettok($did(2).seltext,6-,32))
$gettok(%line,3,124)
}
on *:dialog:npanel:sclick:*:{
if ($gettok($did(2,1),1,32) = sclick) {
var %line = $get_a_line1($gettok($did(2).seltext,6-,32))
var %iconfile = $gettok(%line,2,124)
did -i $dname 4 1 clearIcons
if (%iconfile) {
did -i $dname 4 1 seticon big %iconfile
did -i $dname 4 2 +p 1 $gettok(%line,1,124)
goto end
} else {
did -i $dname 4 1 seticon big $ico
did -i $dname 4 2 +p 1 /npanel
goto end
}
:end
}
}
alias Get_A_Line1 {
var %file = $npanel_f,%line = 0
while (%line < $lines(%file)) {
inc %line
var %linetext = $read(%file,%line)
if ($1- = $gettok(%linetext,1,124)) return %linetext
}
}