mIRC Home    About    Download    Register    News    Help

Print Thread
Nicklist srollbar #265019 15/02/19 07:29 PM
Joined: Feb 2017
Posts: 19
D
Doctor_Souza Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Feb 2017
Posts: 19
how to check if nicklist has srollbar and no has scrollbar?

Re: Nicklist srollbar [Re: Doctor_Souza] #265035 18/02/19 07:08 PM
Joined: Sep 2010
Posts: 11
Matt5150 Offline
Pikka bird
Offline
Pikka bird
Joined: Sep 2010
Posts: 11
Hello,
Sorry for my bad english, it's not my native language.
I did a very rough way. You can check if there are more nicknames in a channel than the height of the window / vertical spacing.
For example, I'm using the font Verdana, size 13. The vertical spacing is 17 (so if the window height is 170, there are 10 lines).
So just edit the 17 according to your font size.
Code:
alias chscrollbar {
  if ($nick(#,0) >  $calc($window(#).dh / 17)) { return $true }
  else { return $false }
}

I hope you understand what I mean.
~cheers

EDIT: I don't know if there is a native way (or a better way) to do that, I tested this and looks like it works

Re: Nicklist srollbar [Re: Matt5150] #265037 19/02/19 01:51 AM
Joined: Feb 2003
Posts: 2,642
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,642
use $height() instead of 17.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: Nicklist srollbar [Re: Raccoon] #265042 20/02/19 04:19 PM
Joined: Sep 2010
Posts: 11
Matt5150 Offline
Pikka bird
Offline
Pikka bird
Joined: Sep 2010
Posts: 11
Uh thanks for the help @Raccoon, I didn't know that identifier.
So something like $height(a,$window(#).font,$window(#).fontsize) should give you the current and correct height, right?

Re: Nicklist srollbar [Re: Matt5150] #265046 20/02/19 08:41 PM
Joined: Jan 2004
Posts: 1,180
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,180
looks like something closer to this is working

Code:
//var -s %a $window( # ).dh , %b $height(a,$window($active).font,$window( # ).fontsize) | echo -a $calc( %a / %b )


Last edited by maroon; 20/02/19 11:23 PM.