mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2007
Posts: 202
F
firefox Offline OP
Fjord artisan
OP Offline
Fjord artisan
F
Joined: Sep 2007
Posts: 202
there comes a point when you have too many channels for the switchbar and then there comes a point when you have too many for the treebar!

i.e. on 5 networks with 4 channels each = 25 plus say 2 custom windows each = 35 plus pm's you are easily at 40 or more windows

It can be unwieldy - has anyone written a good alternative via script/dcx ?

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
if you don't need to see some of the channels in switchbar/treebar, you can use /window -w0 #channelname to remove their icon, and then fish the channel out of the top window menu when you need to go there.

Joined: Mar 2010
Posts: 146
Vogon poet
Offline
Vogon poet
Joined: Mar 2010
Posts: 146
Personally, i do not use Treebar at all, I'm using Switchbar with multiple lines. In that way no matter how many Channel/Windows/Queries/... you have open, you can just add a line (or more) to your Switchbar. (ALT+O -> Display, Lines combobox.)


Nothing...
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
You can use /window -h #channel .. or /window -h nick to hide the windows, to bring them back again, replace -h with -ws .. To hide a status window /window -h $qt(Status Window) <- will hide the window on active network


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Here's a very simple dcx script that docks channels into multiple lines at the top of your mIRC window to get you started:

Code:
; /multibar to open/refresh
; /multibar close to close
alias multibar {
  if ((!$1) && ($dialog(multibar))) multibar_init multibar
  elseif (!$1) dialog -m multibar multibar
  if ($1 == close) dialog -x multibar
}

; initialize/update the multibar dialog
alias multibar_init {
  var %dname = $iif($dname,$dname,$1), %n = 1, %y = 1, %d = 1, %w = 80, %h = 24
  var %i = $calc($xdialog(%dname).nextid - 1)

  ; remove all controls in the dialog (complete refresh)
  while (%i >= 1) {
    xdialog -d %dname %i
    dec %i
  }

  ; iterate over channels and add buttons to each row
  while ($scon(%n)) {
    scon %n
    var %x = 1, %i = 1, %w = 80

    ; add status window button
    xdialog -c %dname %d button %x %y %w %h
    xdid -t %dname %d $network $me
    xdid -M %dname %d %n Status Window

    ; add channels
    while ($chan(%i)) {
      inc %x $calc(%w + 1)
      inc %d
      ; uncomment out next line for unequal width buttons
      ; %w = $width($chan(%i),arial,-11)
      xdialog -c %dname %d button %x %y %w %h
      xdid -x %dname %d +w
      xdid -t %dname %d $chan(%i)
      xdid -M %dname %d %n $chan(%i)
      inc %i 
    }

    inc %y $calc(%h + 1)
    inc %d
    inc %n
  }
  .timer 1 0 multibar_dock %dname
}

; dock multibar to top of window (+b for bottom)
alias multibar_dock {
  xdock -m $dialog($1).hwnd +t
  xdock -r $dialog($1).hwnd + 0 $calc($scon(0) * 25 + 3)
}

; callback alias for event handling
alias multibar_cb {
  if ($2 == sclick) { 
    ; mark data is <connection number> <window name>
    tokenize 32 $xdid($1,$3).mark
    scon $1
    window -a $qt($2-)
  }
}

on *:dialog:multibar:init:*: {
  dcx Mark $dname multibar_cb
  multibar_init
}
dialog multibar {
  size -1 -1 173 31
}


You need to properly download and install dcx. Once you do that, use /multibar and /multibar close to open/close the window.

Note that it lacks many things:

1. No displaying of query windows, custom windows, dcc windows, etc. -- only channels/status windows
2. No highlighting based on the highlight colour of a window, and no flash support
3. Joining/parting/opening/closing windows will not redraw the window. You would need to add event handling for JOIN,PART,OPEN,CLOSE (and possibly timers to handle manual window closing).
4. You can currently only redraw the entire dialog with subsequent calls to /multibar, but you might want to make that more efficient (not redraw the entire dialog, only what was changed)

All four issues could be addressed, but again, this is just to get you started.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard