Skip to content
General IRCd

LISTVIEWS

A TG007 community discussion started by LAS.

Discussion 6 posts
Page 1 of 1
Open
Topic #3366 · 6 published posts · 1,628 views

Now maybe you can help me with this.. cuz I'm just starting off on LISTVIEWS and sense I havnt had any exsperince in it, I'm not sure exactly how it all works. But besides that I am able to create a list view.

 

alias channels { if ($dialog(chan)) dialog -x chan chan | dialog -ma chan chan }
dialog chan {
 title "Channels"
 size -1 -1 200 90
 option dbu
 list 1, 0 0 200 80, size
 button "Join", 2, 162 80 37 10
 edit "", 3, 0 80 160 10, read autohs
}
on *:dialog:chan:init:*:{ 
 mdx SetMircVersion $version
 mdx MarkDialog $dname
 mdx SetControlMDX 1 ListView report nosortheader rowselect single > $view
 did -i $dname 1 1 headerdims 250:2 100:1
 did -i $dname 1 1 headertext Topic $+ $chr(9) $+ Room
 list 
}
on *:dialog:chan:sclick:1:{ 
 if ($me ison $did(1).seltext) { .did -ra $dname 3 Your on that channel. } 
 else { .did -ra $dname 3 Your not on that channel. } 
}
on *:dialog:chan:sclick:2:{ .join $did(1).seltext }
raw 322:*:{ if ($dialog(chan)) { .did -a chan 1 $5- $+ $chr(9) $+ $2 } }
raw 323:*:{ if ($dialog(chan)) { .window -c "Channels List" } }

 

^ I'm not sure how to make it bring the chan up. Becuase of the topic and all the 0 0 0 +fs code comes up.

either use a $gettok or $remove, but i would use the $gettok

/help $gettok lol its late and i really dont feel like typing it all out.

 

us3rX

You're missing the <dialog> parameter in SetControlMDX:

 

  mdx SetControlMDX $dname 1 ListView report nosortheader rowselect single > $view

Edited Apr 21, 2005 4:03 PM by tidy trax

Tidy I know how to do that.... What I was trying to say is how I can remove the 0000 stuff and +fs but I figured all that out now.. But thanks for the help.

well for starters the room name needs to be first, then the topic really

 

as the room name is allwas one word and the topic is several , thus the topic isnt a constant amount of words

 

if the first item was the users in room, then room name , then topic

then the code to get the room name would be

 

$gettok($did(1).seltext,10,32)

 

 

 

if it was room then topic it would be

 

$gettok($did(1).seltext,6,32)

 

 

i would suggest you change this

raw 322:*:{ if ($dialog(chan)) { .did -a chan 1 $5- $+ $chr(9) $+ $2 } }

to this

raw 322:*:{ if ($dialog(chan)) { .did -a chan 1 $2 $+ $chr(9) $+ $5- } }

Edited Apr 22, 2005 1:07 AM by OZZY_10â„¢

My code does NOT have bugs. It just develops random features.

Ok I've been working on my Channel List. And I believe I worked it out. Though it took me a little bit of thinking. So heres the code,

 

alias channels { if ($dialog(chan)) dialog -x chan chan | dialog -ma chan chan }
dialog chan {
 title "Channels"
 size -1 -1 200 90
 option dbu
 list 1, 0 0 200 80, size
 button "Join", 2, 162 80 37 10
 edit "", 3, 0 80 160 10, read autohs
}
on *:dialog:chan:init:*:{ 
 mdx SetMircVersion $version
 mdx MarkDialog $dname
 mdx SetControlMDX 1 ListView report nosortheader rowselect single > $view
 mdx SetFont $dname 1 13 500 Tahoma
 did -i $dname 1 1 headerdims 250:2 125:1
 did -i $dname 1 1 headertext Topic $+ $chr(9) $+ Room
 list 
}
on *:dialog:chan:sclick:1:{ 
 set %room $room($did(1).seltext)
 if ($me ison %room) { .did -ra $dname 3 Your on that channel. } 
 else { .did -ra $dname 3 Your not on that channel. } 
}
on *:dialog:chan:sclick:2:{ .join %room }
alias room {
 var %h = $chr(35)
 var %x = 1
 var %len = $numtok($1-,32)
 while (%x <= %len) {
   var %txt = $gettok($1-,%x,32)
   if (%h == $left(%txt,1)) { set %r %txt }
   inc %x
 }
 return %r
}
raw 322:*:{ if ($dialog(chan)) { var %t = $strip($5-) | .did -a chan 1 %t $chr(9) $2 | haltdef } }
raw 323:*:{ if ($dialog(chan)) { .window -c "Channels List" | haltdef } }

 

Though really none of yous help. lol I still thank ya for trying, but I got it to work. Whats great about it... I did it on my own so I'm really happy.