mIRC Home    About    Download    Register    News    Help

Print Thread
#144248 07/03/06 08:25 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
hi

I have a dialog with treeview.
But how do I open the dialog in the midlle of the treeview?
Lets say I wanna open the talkers tab.
everything that has to do with the tab is red.
I have this for my dialog:

Code:
 alias mdx dll dll\mdx.dll $1- 
alias views return dll\views.mdx $1- 
alias mdx.load { mdx SetMircVersion $version | mdx MarkDialog $dname }
alias hideall {
did -h instel 6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,88,89,90,182,183,184,185,186,187,188,189,190,401,402,403,404,405,406,407,408,409,410,411,412,413,993,994,995,996,997,998,999 }
alias show.infologo { did -v instel 995 }
alias show.pers.asl { did -v instel 6,7,8,9,10,11,12,13,14,15,16,17 }
alias show.pers.overig { did -v instel 18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35 }
alias show.danklogo { did -v instel 994 }
alias show.status { did -v instel 36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51 }
[color:red]alias show.talker { did -v instel 52,53,54,55,56,57,58,59,60 }
alias show.talkerlogo { did -v instel 998 }[/color]
alias show.bloklogo { did -v instel 997 }
alias show.pmblock { did -v instel 61,62,63,68,69,70,71,72,73,74,75,76,77,78,79 }
alias show.pmblock.overig { did -v instel 64,65,66,67,80,81,82,83,84 }
alias show.pmblock.uitz { did -v instel 85,86,88,89,90 }
alias show.afweziglogo { did -v instel 996 }
alias show.afwezig { did -v instel 401,402,403,404,405,406,407,408,409,410,411,412,413 }
alias show.serverlogo { did -v instel 993 }
alias show.serverlijst { did -v instel 182,183,184,185,186,187,188,189,190 }

alias instel { dialog -m instel instel }

dialog instel {
title "Instellingen"
size -1 -1 200 150
option dbu
list 1, -1 0 72 150, size
box "", 2, 76 129 119 20
button "Ok", 3, 82 135 34 12, OK
button "Opslaan", 4, 118 135 34 12
button "Afbreken", 5, 154 135 34 12, CANCEL
text "Age:", 6, 93 4 15 8
edit "", 7, 105 3 12 8
text "Sex:", 8, 93 14 15 8
edit "", 9, 105 13 28 8
text "Plaats:", 10, 88 24 25 8, autohs
edit "", 11, 105 23 60 8
text "Land:", 12, 90 34 25 8
edit "", 13, 105 33 60 8, autohs
text "werelddeel:",14, 76 44 36 8, autohs
edit "", 15, 105 43 60 8
button "display #", 16, 76 55 34 10
button "display echo", 17, 116 55 34 10
text "Mijn e-mail:", 18, 77 4 40 10
edit "", 19, 76 11 90 8, autohs
icon 20, 168 6 16 16, icons\mail.ico,0 ,noborder
text "Mijn MSN:", 21, 77 21 40 10
edit "", 22, 76 28 90 8, autohs
icon 23, 168 21 16 16, icons\msn.ico,0 ,noborder
text "Mijn ICQ:", 24, 77 38 40 10
edit "", 25, 76 45 90 8, autohs
icon 26, 168 39 16 16, icons\flower.ico,0 ,noborder
text "Mijn AOL:", 27, 76 55 40 10
edit "", 28, 76 62 90 8, autohs
icon 29, 168 57 16 16, icons\aol.ico,0 ,noborder
text "Mijn Yahoo:", 30, 77 72 40 10
edit "", 31, 76 79 90 8, autohs
icon 32, 168 73 16 16, icons\yh.ico,0 ,noborder
text "Mijn homepage:", 33, 77 88 40 10
edit "", 34, 76 95 90 8, autohs
icon 35, 168 90 16 16, icons\explorer.ico,0 ,noborder
text "op:", 36, 77 4 20 8
edit "", 37, 76 11 100 10, autohs
text "deop:", 38, 77 21 20 8
edit "", 39, 76 28 100 10
text "hop:", 40, 78 38 20 8
edit "", 41, 76 45 100 10, autohs
text "dehop:", 42, 77 55 20 8
edit "", 43, 76 62 100 10, autohs
text "voice:", 44, 77 72 20 8
edit "", 45, 76 79 100 10, autohs
text "devoice:", 46, 77 89 20 8
edit "", 47, 76 96 100 10, autohs
check "activeer", 48, 76 107 30 10
icon 49, 176 16 16 16 ,icons\op.ico,0 ,noborder
icon 50, 176 50 16 16 ,icons\hop1.ico,0 ,noborder
icon 51, 173 83 16 16 ,icons\voice1.ico,0 ,noborder
[color:red]edit "", 52, 104 4 32 10, autohs
edit "", 53, 104 16 90 10, autohs
text "afkorting:", 54, 76 4 27 8
text "talkers:", 55, 76 16 21 8
check "Activeer talkers", 56, 148 4 56 7
list 57, 76 40 119 90, sort size extsel
button "Toevoegen", 58, 159 28 36 10, disable
button "Bewerk", 59, 76 28 36 10, disable
button "Verwijder", 60, 117 28 36 10, disable[/color]
box "Wat te doen bij privéaanvraag", 61, 76 4 82 30
radio "Automatisch afwijzen", 62, 80 10 65 10, group
radio "Vraag mij wat te doen", 63, 80 20 65 10
box "Text die de fluisteraar ziet bij aanvraag:", 64, 76 4 119 74
edit "",65, 79 12 114 28, multi autovs
text "Text voor afwijzen:", 66, 80 40 60 7, disable
edit "Privéaanvraag afgewezen", 67, 79 48 114 28, disable
box "Privéblock", 68, 160 4 37 30 
radio "Aan", 69, 170 10 23 12, group 
radio "Uit", 70, 170 20 26 12
box "Hoe wil ik fluistermeldingen zien?", 71, 76 39 90 40 
radio "Knocks tonen in @prive", 72, 82 45 74 10, group 
radio "Bericht in actieve scherm", 73, 82 55 74 10 
radio "Geef geen bericht aan mij", 74, 82 65 74 10 
box "Negeren voor hoelang?", 75, 76 81 90 33 
text "Bij afwijzen negeren voor", 76, 82 88 82 8, hide
text "Negeer knocks na de 1e X voor", 77, 82 88 82 8, hide
edit "", 78, 82 97 16 10, limit 4 
text "Minuten", 79, 102 98 29 8
box "Overige opties", 80, 76 80 119 49
check "Block automatisch aan bij away ", 81, 82 88 100 10
check "Berichten opslaan in een logbestand", 82, 82 98 100 10
button "Log weergeven", 83, 82 108 42 10 
check "Laat Operators wel fluisteren naar me", 84, 82 118 100 10 
edit "", 85, 76 12 50 10, autohs
button "Toevoegen", 86, 76 24 37 12
button "Verwijder", 88, 76 50 37 12
list 89, 130 12 64 116, sort size extsel
link "Vriendenlijst", 90, 144 4 36 8

list 182, 76 4 90 70, size
text "Address:", 183, 76 78 25 8
edit "", 184, 105 75 61 10, autohs
button "+", 185, 168 73 15 12, disable
button "-", 186, 168 4 15 12, disable
button "5", 187, 168 26 15 12, disable
button "6", 188, 168 39 15 12, disable
button "c", 189, 168 58 15 12, disable
check "Server menu", 190, 76 96 45 8

text "Afwezig bericht:", 401, 76 6 39 8
edit "", 402, 76 15 118 10, autohs
button "Bekijk", 403, 165 4 30 10
text "Terug bericht:", 404, 76 28 39 8
edit "", 405, 76 37 118 10, autohs
button "Bekijk", 406, 165 26 30 10
radio "/amsg", 407, 80 51 25 10
radio "/ame", 408, 110 51 28 10
box "", 409, 76 64 115 28
text " <reden>", 410, 80 70 40 8
text "<tijd>", 411, 80 81 40 8
text "<logger> - logger (aan/uit)", 412, 116 70 100 8
text "<pager>  - pager (aan/uit)", 413, 116 81 100 8
icon 999, 15 -55 240 240, $mircdirdesign\instel.jpg
icon 998, 15 -55 240 240, $mircdirdesign\talkers.jpg
icon 997, 15 -55 240 240, $mircdirdesign\blok.jpg
icon 996, 15 -55 240 240, $mircdirdesign\exit.jpg
icon 995, 15 -55 240 240, $mircdirdesign\persinfo.jpg
icon 994, 15 -55 240 240, $mircdirdesign\dank.jpg
icon 993, 15 -55 240 240, $mircdirdesign\servers.jpg
}

on *:dialog:instel:*:*:{
if ($devent == init) {
hideall
mdx.load
mdx SetControlMDX $dname 1 TreeView haslines linesatroot hasbuttons showsel > $views
mdx SetControlMDX 57 listview rowselect showsel single sortascending labeltip report > $views
mdx SetControlMDX 89 listview rowselect showsel single sortascending labeltip report > $views
mdx SetBorderStyle $dname 3,4,5 staticedge
var %i = $ulist(*,prive,0) | while ( %i ) { did -a instel 89 $ulist(*,prive,%i) $crlf | dec %i }
  .did -i instel 89 1 headerdims 112:1 
  .did -i instel 89 1 headertext vriendenlijst
  .var %a = 1, %b = $Hget(dialogs, 0).item
  While (%a <= %b) {
    .did -az instel 89 $Hget(dialogs, %a).item $Chr(9) $Hget(dialogs, $Hget(dialogs, %a).item)
    .inc %a
  }
did -r instel 65,67,78
did -a instel 65 %pri_text
did -a instel 67 %pri_afwtext
did -a instel 78 %pri_igtime
if (%pri_autaw == aan) { did -c instel 81 }
if (%privlog == aan) { did -c instel 82 }
if (%pri_opsw == aan) { did -c instel 84 }
did -c instel $iif((%privactive == On),69) $iif((%privactive == Off),70)
did -c instel $iif((%priknock == window),72) $iif((%priknock == active),73) $iif((%priknock == none),74)
did -c instel $iif((%privdoe == afwijzen),62) $iif((%privdoe == wacht),63)
if (%privdoe == wacht) { did -e instel 66,67 }
.did -i instel 57 1 headerdims 72:1 206:2
  .did -i instel 57 1 headertext Afkorting $Chr(9) Acronym
  .var %a = 1, %b = $Hget(AcroManager, 0).item
  While (%a <= %b) {
    .did -az instel 57 $Hget(AcroManager, %a).item $Chr(9) $Hget(AcroManager, $Hget(AcroManager, %a).item)
    .inc %a
  }
  If ($Group(#AcroManager) == On) { .did -c instel 56 }
did -i $dname 1 1 setcolor text $color(1)
did -i $dname 1 1 setcolor bkg $color(0)
did -i $dname 1 1 setcolor line $color(6)
did -a $dname 1 1 1 Persoonlijke info
did -i $dname 1 1 cb last
did -a $dname 1 2 ASL
did -a $dname 1  Overige
did -i $dname 1 1 cb root
did -a $dname 1  Status dank
did -i $dname 1 1 cb last
did -a $dname 1 Alg. instellingen
did -i $dname 1 1 cb root
[color:red]did -a $dname 1 Talkers
did -i $dname 1 1 cb last
did -a $dname 1 Alg. instellingen[/color]
did -i $dname 1 1 cb root
did -a $dname 1 Prive blokker
did -i $dname 1 1 cb last
did -a $dname 1 Alg. instellingen
did -a $dname 1 Overige
did -a $dname 1 Uitzonderingen
did -i $dname 1 1 cb root
did -a $dname 1 Afwezig systeem
did -i $dname 1 1 cb last
did -a $dname 1 Alg. instellingen
did -i $dname 1 1 cb root
did -a $dname 1 Serverlijst
did -i $dname 1 1 cb last
did -a $dname 1 Alg. instellingen
did -i $dname 1 1 cb root
did -a $dname 1 Help
did -i $dname 1 1 cb last
did -a $dname 1 is
did -a $dname 1 in
did -a $dname 1 de
did -a $dname 1 maak
did -i $dname 1 1 cd root
did -v $dname 999
} 
if ($devent == sclick) { 
if ($did == 1) {
tokenize 32 $did($did,1) 
if ($1 == slclick) {
if ($4 == 2) { hideall | show.infologo }
if ($4 == 2) && ($5 == 2) { hideall | show.pers.asl }
if ($4 == 2) && ($5 == 3) { hideall | show.pers.overig }
if ($4 == 3) { hideall | show.danklogo }
if ($4 == 3) && ($5 == 2) { hideall | show.status }
[color:red]if ($4 == 4) { hideall | show.talkerlogo }
if ($4 == 4) && ($5 == 2) { hideall | show.talker }[/color]
if ($4 == 5) { hideall | show.bloklogo }
if ($4 == 5) && ($5 == 2) { hideall | show.pmblock }
if ($4 == 5) && ($5 == 3) { hideall | show.pmblock.overig }
if ($4 == 5) && ($5 == 4) { hideall | show.pmblock.uitz }
if ($4 == 6) { hideall | show.afweziglogo }
if ($4 == 6) && ($5 == 2) { hideall | show.afwezig }
if ($4 == 7) { hideall | show.serverlogo }
if ($4 == 7) && ($5 == 2) { hideall | show.serverlijst }
}
} 
}
}
 

#144249 08/03/06 12:12 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You could make this entire thing a lot easier on yourself and use a tab control. Just make the tab headers appear outside of the dialogs client area, then you can use the built in tab controls instead of implementing your own. Then when you click on the item you want to view you simply use /did -f on the tab.


Link Copied to Clipboard