------------------------------------------------
Notify Treebar Tutorial/Snippet
[code];open the dialog
alias notify. { dialog -m notify notify }
dialog notify {
size -1 -1 134 164
title "notify treebar"
list 1,0 0 132 158,extsel size
}
;dialog startup
on *:dialog:notify:init:*:{ notify.load }
;for when someone on your list gets online
on *:Notify:{ notify.load }
on *:Unotify:{ notify.load }
;loads and refreshes the list
alias notify.load {
;if the dialog isnt open, we halt it so it doesnt beep and give errors
if ($dialog(notify)) { goto next }
else { halt }
:next
;loading the mdx stuff
var %dname notify
did -r %dname 1
dll $mdx SetMircVersion $version
dll $mdx MarkDialog %dname
dll $mdx SetControlMDX %dname 1 TreeView haslines linesatroot hasbuttons > $views.mdx
;start of the loading of the online names into the treebar
did -a %dname 1 +eb Online
did -i %dname 1 1 cb root last 1
;this loops through your list, then checks to see if they are online, if so it adds them online list
var %x 1
while (%x <= $notify(0)) {
if ($notify(%x).ison == $true) { did -a %dname 1 $notify(%x) | inc %x }
else { inc %x }
}
;start of the loading of the offline names into the treebar
did -i %dname 1 1 cb root 1
did -a %dname 1 +eb Offline
did -i %dname 1 1 cb root last 1
;this loops through your list, then checks to see if they are offline if so it adds them the offline list
var %y 1
while (%y <= $notify(0)) {
if ($notify(%y).ison == $false) { did -a %dname 1 $notify(%y) | inc %y }
else { inc %y }
}
}
;this will open a query(pm) window when you click on an online user\'s name
on *:dialog:notify:sclick:1:{
tokenize 32 $did($dname,1,1)
if ($1 == slclick) && ($4 == 2) && ($5) { query $notify($calc($5 - 1)) }
}[/code]
just a short Tutorial/Snippet i made since travis was asking about this... Whipped this up kind of quick, should be \"bug\" free tho >.>
us3rX

