Scrolling SysTray Thread last updated on 2003-11-10 22:19:56

Posted by member 99 on 2003-06-09 16:44:21

This will give you a systray that displays a fixed number of items displayed. If there are more icons than that, you can scroll through them with !systrayleft and !systrayright:
; change these
systrayIconSize 16
systrayIconSpacingX 1
systrayHeight 20
systrayBorderSize $(systrayHeight-systrayIconSize)/2$

systrayBoxX 0
systrayBoxY 0
systrayDisplayCount 4

; do not change these
systrayAutoSize
systrayX 0
systrayY 0

*SkinBox systrayBox
systrayBoxWidth $systrayDisplayCount*(systrayIconSize+systrayIconSpacingX)+2*systrayBorderSize$
systrayBoxHeight $systrayHeight$
systrayBoxOnCreate !systrayhook .none ^@ih^

*script var systrayx $systrayx$

*script bang !systrayLeft
*script exec !varadd systrayx $systrayIconSize+systrayIconSpacingX$
*script exec !systraymove -%#(resolutionx+%{systrayx})%# 0
*script ~bang

*script bang !systrayRight
*script exec !varadd systrayx -$systrayIconSize+systrayIconSpacingX$
*script exec !systraymove -%#(resolutionx+%{systrayx})%# 0
*script ~bang


You can use lsbox instead of skinbox, but I'm more familiar with this. This will also need mzScript 0.9 b12 (jam 4), although you can modify it a bit to work with earlier versions.

Load order: mzscript, systray, skinbox/lsbox.

It does no error checking as it is, if you try to scroll it right past the end, it will give you a seemingly unrelated error and scroll past the end. Perhaps someone who's done more with mzScript can add checks.

Posted by member 7223 on 2003-06-10 01:45:30 link

Glad to see the code section isn't dead :)

I haven't tested this piece of code but I understand it's logicial. Of course, some little tests can be add (haven't tested them):
*script bang !systrayLeft
*script exec !varadd systrayx $systrayIconSize+systrayIconSpacingX$
*Script exec !IfEval ("%{systrayx}" > "%#SystrayCurrentWidth-SystrayBorderSize%#") |VarSet systrayx %#SystrayCurrentWidth-SystrayBorderSize%#
*script exec !systraymove -%#(resolutionx+%{systrayx})%# 0
*script ~bang

*script bang !systrayRight
*script exec !varadd systrayx -$systrayIconSize+systrayIconSpacingX$
*Script exec !IfEval ("%{systrayx}" less than "%#SystrayBorderSize%#") |VarSet systrayx %#SystrayBorderSize%#
*script exec !systraymove -%#(resolutionx+%{systrayx})%# 0
*script ~bang


Of course, if you had defined SystrayBorderLeft and SystrayBorderRight instead of SystrayBorder, you should replace SystrayBorderSize with SystrayBorderLeft+SystrayBorderRight


Note: i've replaced the opposite sign of ">" with "less than" because this f** char is messing up everything

Posted by member 26 on 2003-09-11 01:30:48 link

Try < next time.

Posted by member 71746 on 2003-10-25 21:30:55 link

You don't need checks or mzScript, you just need to use VTray :P It specifically allows for scrolling via bangs, and allows you to define the step amount. (ie, how many icons it scrolls at once)

Also for those interested, scrolling can be achieved in Taskbar3 in a much the same fashion as VTray, by defining TaskbarMaxButtonCount and using !TaskbarShowPart next/prev

Posted by member 99 on 2003-10-25 23:01:25 link

Well too bad vtray wasn't around back in june. ;)

Besides, this technique can be used for other modules, and scrolls by pixel.

Posted by member 7223 on 2003-10-26 10:13:55 link

...and vtray display ugly icons when using iconsaturation; but systray2 deals with this fine :)

Posted by member 7223 on 2003-11-10 22:19:56 link

Well done RabidCow, I'm successfully using this kind of script to scroll systray, taskbar...

Does anyone knows what else should be scroll-able ?