mIRC Homepage
Posted By: WideOpenSpace @window help needed - 19/08/07 04:16 AM
so i create @window with (among other) parameter lS

so i get sortside listbox window and normal window.
my question is: how to clear content of sortside listbox window ?

coz for /dline i guess i need $sline
and $sline only reacts on selected lines and i dont have them
for this case :P
Posted By: Riamus2 Re: @window help needed - 19/08/07 04:20 AM
Why do you need $sline? Just use the line number that you want.

/dline -l @window 5
Posted By: WideOpenSpace Re: @window help needed - 19/08/07 02:40 PM
beacuse i load many random lines and i cant know how many lines are there since is not always same number (dynamical)
and i dont want just 1 line to be cleared, but all.
Posted By: RoCk Re: @window help needed - 19/08/07 02:49 PM
/dline -l @window 1-
Posted By: WideOpenSpace Re: @window help needed - 19/08/07 03:01 PM
thank you very much
Posted By: WideOpenSpace Re: @window help needed - 19/08/07 04:48 PM
bleh not to open new thread...

i have little craps with menu of window

basicaly i want detection of existing lines in side sort listbox
if there are none lines there, then script should halt (if user double clicks in normal window)
but instead it doesnt :P

why ?

Code:
menu @Window { 
  dclick { 
    if ($line(@Window,1,1) != 0) { 
    do some stuff
    }
    else { halt }
  }
}

Posted By: Riamus2 Re: @window help needed - 19/08/07 04:53 PM
Code:
menu @Window { 
  dclick { 
    if ($line(@Window,1,1) != $null) { 
      do some stuff
    }
  }
}


Unless you always have "0" in line 1 if it has lines, use $null. Also, no need to halt something like this. If it's $null, it won't have another other commands to do anyhow. If you DO want to halt something, use RETURN unless you're halting mIRC's commands/outputs rather than the script.
Posted By: WideOpenSpace Re: @window help needed - 19/08/07 04:58 PM
thanks it works nicely ^^

additional question:

is there a flag for menu commands like dclick sclick etc...
that only works if user clicks in sortside listbox and not normal window ?
Posted By: hixxy Re: @window help needed - 19/08/07 05:07 PM
lbclick
Posted By: WideOpenSpace Re: @window help needed - 19/08/07 05:32 PM
thanks
Posted By: WideOpenSpace Re: @window help needed - 20/08/07 02:11 PM
another question :P

help file says to change icon of @window that you specify
iconfile #number

so i have this:

/window -tags @name $mircdirsystem\icon-library.ICL number
but it still shows normal @ icon, why ?

or @windows cant load Libraries ?
Posted By: hixxy Re: @window help needed - 20/08/07 02:20 PM
Wrap the filename in quotes: $qt($mircdirsystem\icon-library.ICL)
Posted By: WideOpenSpace Re: @window help needed - 20/08/07 03:27 PM
doesnt work smirk

tried
$qt($mircdirsystem\file.icl) #number
$qt($mircdirsystem\file.icl #number)
Posted By: hixxy Re: @window help needed - 20/08/07 03:28 PM
Try pasting the entire command you're using as the problem might be elsewhere.
Posted By: WideOpenSpace Re: @window help needed - 20/08/07 03:30 PM
/window -CkSl18 $logwin(@window name) $qt($mircdirsystem\file.icl) 11

where $logwin is
alias logwin { return $replace($1- ,$chr(32),$chr(160)) }
Posted By: hixxy Re: @window help needed - 20/08/07 03:35 PM
That command works fine for me if I use $mircexe instead of $mircdirsystem\file.icl, so the problem is likely to do with the file -- either it doesn't exist, there isn't an icon at that index or it's corrupted.

Try seeing if it exists with //echo -a $isfile(system\file.icl)
Posted By: WideOpenSpace Re: @window help needed - 20/08/07 03:41 PM
its there coz i use it for all custom dialogs smile
and it has more than 11 indexes smile

i use mirc 6.21 if that helps in any way :P
Posted By: hixxy Re: @window help needed - 20/08/07 03:44 PM
Strange. I'm not sure what's going on. It works fine when I use the mIRC executable.
Posted By: WideOpenSpace Re: @window help needed - 20/08/07 03:50 PM
i tried now instead $qt(blabla) $mircexe
and $mircexe 3

doesnt work either
also tried on clean 6.20
dosnt work on that also O_o
Posted By: hixxy Re: @window help needed - 20/08/07 03:52 PM
Not $qt(blabla) $mircexe, this:

Code:
//window -CkSl18 $logwin(@window name) $qt($mircexe) 11
Posted By: WideOpenSpace Re: @window help needed - 20/08/07 03:54 PM
nah, nothing on both .20 and .21
Posted By: hixxy Re: @window help needed - 20/08/07 03:55 PM
Have you tried 6.3? Maybe a bug was fixed..

I'm not using 6.21 so I can't try it on that one.
Posted By: WideOpenSpace Re: @window help needed - 20/08/07 03:58 PM
nope, i avoid 6.3 in large radius :P
Posted By: hixxy Re: @window help needed - 20/08/07 04:02 PM
Fail.
Posted By: WideOpenSpace Re: @window help needed - 20/08/07 04:03 PM
what ?
Posted By: hixxy Re: @window help needed - 20/08/07 04:04 PM
Whatever your issues with 6.3 are, I'm sure that dozens of bug fixes and new features outweigh them. It makes helping you more difficult because the majority of people will be using the most up to date version of the software, and that's the one that's more commonly supported.
Posted By: OrionsBelt Re: @window help needed - 20/08/07 04:14 PM
Try viewing the icon when the window is not maximised.
When the window is maximised you dont see it or only in the menu bar.
Posted By: WideOpenSpace Re: @window help needed - 20/08/07 04:19 PM
it seems that it cant read icon libraries
i tried with single icon and it loads it ok.
Posted By: WideOpenSpace Re: @window help needed - 31/08/07 02:39 PM
Originally Posted By: Riamus2
Code:
menu @Window { 
  dclick { 
    if ($line(@Window,1,1) != $null) { 
      do some stuff
    }
  }
}


Unless you always have "0" in line 1 if it has lines, use $null. Also, no need to halt something like this. If it's $null, it won't have another other commands to do anyhow. If you DO want to halt something, use RETURN unless you're halting mIRC's commands/outputs rather than the script.


not to make NEW post, but just to add to this one...

so i use for same window this:

Code:
  lbclick {
    if ($line(@window),1,1) != $null) { 
do some things
    }
    else { return }
}


the problem is that when i load this window
and when window loads contents on side listbox
and when i DONT click on valid item but on the bottom (below all items) in blank space
i get errors

shouldnt this: else { return }
supposed to halt it ?
Posted By: hixxy Re: @window help needed - 31/08/07 03:01 PM
That code is saying "if there are lines in the side listbox, then do this" - it doesn't matter where abouts you click. In any event, nothing there would generate an error and you don't need the "else { return }" part at all.

What commands are you trying to execute in the "do some things" part?
Posted By: WideOpenSpace Re: @window help needed - 31/08/07 03:15 PM
this ones:
Code:
menu @Log*viewer { 
  lbclick {
    if ($line($logwin(@Log viewer),1,1) != $null) { 
      .clear $logwin(@Log viewer)
      .loadbuf $logwin(@Log viewer) $qt($+($logsdir,$sline($logwin(@Log viewer),1),.log))
    }
}


(i use it for loading and displaying logs)

but when i click on non showed item i get error:
* /loadbuf: unable to open 'C:\mirc\logs\.log'
Posted By: hixxy Re: @window help needed - 31/08/07 03:19 PM
That's because in the if statement you're checking that lines exist in the listbox, but you're not checking that a line is selected.

Code:
menu @Log*viewer { 
  lbclick {
    if ($sline($logwin(@Log viewer),1)) { 
      .clear $logwin(@Log viewer)
      .loadbuf $logwin(@Log viewer) $qt($+($logsdir,$sline($logwin(@Log viewer),1),.log))
    }
  }
}


Use $sline() instead of $line() in your if statement.
Posted By: WideOpenSpace Re: @window help needed - 31/08/07 03:30 PM
ah sweet !
thank you very much laugh
Posted By: WideOpenSpace Re: @window help needed - 31/08/07 05:41 PM
bleh another question...

when i loadbuff log into window
i get some too long lines out of border
and i cant find in help file anywhere a switch that
makes hsbar to be enabled.

is there solution for this ?
Posted By: hixxy Re: @window help needed - 31/08/07 06:32 PM
After you've finished adding data to the listbox, make a call to window -b $logwin(@Log viewer)
Posted By: WideOpenSpace Re: @window help needed - 31/08/07 10:44 PM
sorry

i didnt mean on listbox where i select log names, but on window where all text from log is loaded
Posted By: deegee Re: @window help needed - 31/08/07 10:48 PM
Try /loadbuf -pi @win file
(/help /loadbuf)
Posted By: WideOpenSpace Re: @window help needed - 01/09/07 03:12 AM
thank you, it worked smile
Posted By: WideOpenSpace Re: @window help needed - 08/10/07 02:56 AM
yet another revive of the same :P

i dont see this in help file but just to ask here...
since i have side listbox in @window
can that listbox have popup menu (with right click)
like you create for normal @window ?
Posted By: Lpfix5 Re: @window help needed - 08/10/07 08:16 PM
Originally Posted By: WideOpenSpace
yet another revive of the same :P

i dont see this in help file but just to ask here...
since i have side listbox in @window
can that listbox have popup menu (with right click)
like you create for normal @window ?


Depending on your @window size etc... you can do something like this...

Code:
menu @window {
rclick:{
;The inrect would be in rectangle where you have to 
;make an 
;hidden rectangle to which the mouse events can occur
if ($inrect(x,y,x,y,w,h)) { do stuff here }
}
}


or if you have trouble finding the rectangle of your @window in the listbox do... this..

Code:
menu @window {
rclick:{ echo -a The X of my mouse click is $mouse.x and the Y of my mouse is $mouse.y }
}


the way the inrect works is you need a point which is point left top corner to bottom right corner... then the height and width total of your rectangle.
Posted By: WideOpenSpace Re: @window help needed - 09/10/07 05:18 AM
hmm i thought more in a way to make popup interact with side listbox objects.

seems mirc doesnt have this at all.

thanks for trying to help tho.
© mIRC Discussion Forums