mIRC Home    About    Download    Register    News    Help

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

Joined: Sep 2010
Posts: 12
Pikka bird
Offline
Pikka bird
Joined: Sep 2010
Posts: 12
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

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
use $height() instead of 17.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Sep 2010
Posts: 12
Pikka bird
Offline
Pikka bird
Joined: Sep 2010
Posts: 12
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?

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
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.

Link Copied to Clipboard