mIRC Home    About    Download    Register    News    Help

Print Thread
#151230 15/06/06 04:58 AM
Joined: Mar 2004
Posts: 155
D
Darkmnm Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Mar 2004
Posts: 155
I've got a dialog docked at the bottom of my mirc and I was wondering is i were to dclick one of the lines with the incoming/outgoing information on it what would be the code to open that specified transfer window.

Code:
on 1:dialog:dccbar:dclick:2: {
???????????????
}


Would I have to do a sel like:

Code:
$did(dccbar,2).sel


Thanks for any help on the matter. I'm a bit lost on how I should make this happen.

#151231 15/06/06 02:20 PM
Joined: Mar 2004
Posts: 155
D
Darkmnm Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Mar 2004
Posts: 155
Since no one has replied I'm assuming I wasn't clear enough so below I am putting the code I currently have in hopes of some feedback.

Code:
on *:dialog:dccbar:init:0: {
  $mdx.load
  mdx SetDialog $dname style
  mdx SetControlMDX $dname 2 listview report infotip single rowselect > $mircdir $+ \script\mdx\views.mdx
  did -i $dname 2 1 headerdims 319 150 130 130 130 130 130 150
  did -i $dname 2 1 headertext Filename $chr(9) User Name $chr(9) Status $chr(9) Size $chr(9) $chr(37) Complete $chr(9) Rate $chr(9) Time Left $chr(9) Elasped Time
  did -i $dname 2 1 setbkg color $color($color(background))
  did -i $dname 2 1 settxt bgcolor $color($color(background))
  did -i $dname 2 1 settxt color $color($color(normal text))
  mdx SetFont $dname 2 -10 700 Tahoma
  dll script\dlls\hOS.dll DockWindow $dname bottom
  did -i $dname 2 1 seticon normal 0 72,script\icons\beos.icl
  did -i $dname 2 1 seticon normal 0 71,script\icons\beos.icl
}

on *:dialog:dccbar:dclick:2: {
  [color:red]/windows -x get[/color]
}

alias dccbar {
  if (!$dialog(dccbar)) { dialog -m dccbar dccbar }
  else { dll script\dlls\hOS.dll UndockWindow $dname bottom }
}

alias dccbar.update {
  if ($dialog(dccbar)) {
    var %sel = $did(dccbar,2).sel
    if ($calc($get(0) + $send(0)) != $calc($did(dccbar,2).lines -1)) { goto refresh }
    var %g = 1
    while $get(%g) {
      did -o dccbar 2 $calc(%g +1) +r 1 $chr(160) $get(%g).file $chr(9) $get(%g) $chr(9) $cap($get(%g).status) $chr(9) $regsize($get(%g).size,1) $chr(9) $get(%g).pc $+ % $chr(9) $round($calc($get(%g).cps /1024),1) kb/s $chr(9) $sduration($calc(($get(%g).size - $get(%g).rcvd) / $get(%g).cps)).sec $chr(9) $sduration($get(%g).secs).sec $chr(4) Nick: $get(%g) $crlf File: $get(%g).file $crlf Progress: $get(%g).pc $+ %
      inc %g
    }
    var %g = 1
    while $send(%g) {
      did -o dccbar 2 $calc(%g + $get(0) +1) +r 2 $chr(160) $send(%g).file $chr(9) $send(%g) $chr(9) $cap($send(%g).status) $chr(9) $regsize($send(%g).size,1) $chr(9) $send(%g).pc $+ % $chr(9) $round($calc($send(%g).cps /1024),1) kb/s $chr(9) $sduration($calc(($send(%g).size - $send(%g).rcvd) / $send(%g).cps)).sec $chr(9) $sduration($send(%g).secs).sec $chr(4) Nick: $send(%g) $crlf File: $send(%g).file $crlf Progress: $send(%g).pc $+ %
      inc %g
    }
    did -c dccbar 2 %sel
    goto end
    :refresh
    did -r dccbar 2
    var %g = 1
    while $get(%g) {
      did -a dccbar 2 $calc(%g +1) +r 1 $chr(160) $get(%g).file $chr(9) $get(%g) $chr(9) $cap($get(%g).status) $chr(9) $regsize($get(%g).size,1) $chr(9) $get(%g).pc $+ % $chr(9) $round($calc($get(%g).cps /1024),1) kb/s $chr(9) $sduration($calc(($get(%g).size - $get(%g).rcvd) / $get(%g).cps)).sec $chr(9) $sduration($get(%g).secs).sec $chr(4) Nick: $get(%g) $crlf File: $get(%g).file $crlf Progress: $get(%g).pc $+ %
      inc %g
    }
    var %g = 1
    while $send(%g) {
      did -a dccbar 2 +r 2 $calc(%g + $get(0) +1) 2 $chr(160) $send(%g).file $chr(9) $send(%g) $chr(9) $cap($send(%g).status) $chr(9) $regsize($send(%g).size,1) $chr(9) $send(%g).pc $+ % $chr(9) $round($calc($send(%g).cps /1024),1) kb/s $chr(9) $sduration($calc(($send(%g).size - $send(%g).rcvd) / $send(%g).cps)).sec $chr(9) $sduration($send(%g).secs).sec $chr(4) Nick: $send(%g) $crlf File: $send(%g).file $crlf Progress: $send(%g).pc $+ %
      inc %g
    }
    :end
  }
}

alias cap {
  return $upper($mid($1-,1,1)) $+ $mid($1-,2,$len($1-))
}

alias title {
  if ($dialog(dccbar)) { dccbar.update }
}

alias regsize {
  var %s = $1
  if ($len(%s) <= 4) { return $round($calc(%s /1024),$2) KB }
  elseif ( $len(%s) > 4 && $len(%s) <= 6) { return $round($calc(%s /1024),$2) KB }
  elseif ($len(%s) >= 7) { return $round($calc($calc(%s /1024) /1024),$2) MB }
}


The part in red is where I am in need of assistance. Thanks for any help anyone can give me in the matter.

#151232 15/06/06 09:40 PM
Joined: Dec 2002
Posts: 417
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
This is just a suggestion but you can streamline your script by combining the init and events into one script like this

Code:
  [color:red] 
on *:dialog:dccbar:*:*: {
  if $devent == init {
    if $did == 0 {
      $mdx.load
      mdx SetDialog $dname style
      mdx SetControlMDX $dname 2 listview report infotip single rowselect > $mircdir $+ \script\mdx\views.mdx
      did -i $dname 2 1 headerdims 319 150 130 130 130 130 130 150
      did -i $dname 2 1 headertext Filename $chr(9) User Name $chr(9) Status $chr(9) Size $chr(9) $chr(37) Complete $chr(9) Rate $chr(9) Time Left $chr(9) Elasped Time
      did -i $dname 2 1 setbkg color $color($color(background))
      did -i $dname 2 1 settxt bgcolor $color($color(background))
      did -i $dname 2 1 settxt color $color($color(normal text))
      mdx SetFont $dname 2 -10 700 Tahoma
      dll script\dlls\hOS.dll DockWindow $dname bottom
      did -i $dname 2 1 seticon normal 0 72,script\icons\beos.icl
      did -i $dname 2 1 seticon normal 0 71,script\icons\beos.icl
    }
  }
  if $devent == dclick {
    if $did == 2 { windows -x get }
    }
  }
}
 [/color]  




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
#151233 16/06/06 12:52 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
you really shouldnt do that
while you can combine all the dclicks or sclicks, the init should be done
on (level):dialog:(name):init:0:{

#151234 16/06/06 06:40 AM
Joined: Mar 2004
Posts: 155
D
Darkmnm Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Mar 2004
Posts: 155
Ok, thanks for the advise but what I am concerned with at the moment is getting the incoming/outgoing windows to open when I dclick on the corrisponding line when I am getting or sending a file. Incase it matters, in mirc options under display I have Include DCC's unchecked so that the dcc windows aren't showing because the info for those windows show in the dialog docked at the bottom. I just want/need the windows to open when I dclick. Thanks for any help on the matter.


Link Copied to Clipboard