mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 162
R
RRX Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: Jan 2004
Posts: 162
I often use custom windows to store data because they are fast, versatile and have an order (unlike hashtables).
Problem is that when mirc is set to output in active window, the message interferes with my in hidden windows or formatted output data. Is there a way to avoid this regardless mirc settings?
The /window should have a switch that prevents that...

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
you can add the -l switch to the window making it a listbox, (nb: NOT a -l999 999 being any number, as that makes a sidelistbox, just -l which makes the wmain window a listbox)

then /echo -a well revert to the status window (from memory thats where it goes at least)

there are however drawbacks and advantages in having your windows as a listboxs,

(bad) you cant go onto them and highlight text for cut and paste
(bad) they are alot slower to load data into (this is hard to notice unless the data is big)

(good) you can select multiple lines in them and have right click functions attachjed to the window or the slines selected etc
(good) you can format your data into columns the /window -t10,20,30,40 tab columns works WAY WAY better than in normal windows, if you overshoot a tabstop in a normal window it just uses the next one so your data stops being in line down the page, in a listbox, if you over shoot, it essentially rubs out everything after the next tabmarker, and displayes the next text
Code:
alias example {
  var %t = $chr(9)
  ;
  window -e -t15,30,45 @win-normal
  aline @win-normal nick %t time %t message
  aline @win-normal bob                                    %t 12:00:00 %t hi how are you to day
  aline @win-normal DaveC                                  %t 12:12:12 %t Well isnt this a odd example
  aline @win-normal StupidlyLongNickNameHereThatsWayToLong %t 12:12:12 %t Blah my message is out of line
  ;
  window -el -t15,30,45 @win-listbox
  aline @win-listbox nick %t time %t message
  aline @win-listbox bob                                    %t 12:00:00 %t hi how are you to day
  aline @win-listbox DaveC                                  %t 12:12:12 %t Well isnt this a odd example
  aline @win-listbox StupidlyLongNickNameHereThatsWayToLong %t 12:12:12 %t Blah my message is NOT out of line
}


* be aware that I have been a little crafty about the output here, assuming you have a fixedwidth font (all characters same width) the last line in the listbox would look like this
Code:
StupidlyLongNic 12:12:12       Blah my message is NOT out of line

the space bewteen the name and the time is however a result of me using a space following the %t ($chr(9)) tab

i u used $+(StupidlyLongNickNameHereThatsWayToLong,%t,12:12:12,%t,Blah my message is NOT out of line) it would look like
Code:
StupidlyLongNic12:12:12       Blah my message is NOT out of line


Irregular width fonts are real cool looking, the 12:12:12 may appear to begin half way through a letter like in the middle of the W or something.

On the hole if you want to work with these windows interactively I would go for listbox

If its just for a script to processes something stick with a normal one, make it hidden, and make it stay hidden, something like this works
alias hwindow { window -h $1 | return $1 }
say your window name is @BLAH then use instead $hwindow(@BLAH) example
//aline $hwindow(@BLAH) what ever you want
This also has the side effect of creating the window for you so you dont need to worry if it doesnt exist.
This does however cause you heaps of trouble if you do want to look at it, and the scripts still active on events, the window well keep vanishing smile

Hope I been some help.
PS: another way might be to intercept things like ECHO and change the -a to -s but then somethings display to the active regardless, whcih sucks a bit frown

Joined: Jan 2004
Posts: 162
R
RRX Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: Jan 2004
Posts: 162
Thanks for the reply. Though the listbox solution isn't for me, those windows are supplmental (more detailed data) to a large dialog, and used often to copypaste data into that dialog.
There should be a switch that prevents echo-in-active in normal @windows smirk


Link Copied to Clipboard