It is currently March 28th, 2024, 9:59 pm

Using the new MouseActionCursorName option

Changes made during the Rainmeter 2.5 beta cycle and earlier.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Using the new MouseActionCursorName option

Post by jsmorley »

Requires Rainmeter 2.4 beta version 1567 or better.

If a custom cursor file (i.e. .cur or .ani) is found in @Resources\Cursors in the root config folder of a skin, it will be automatically loaded and available as an alternative for the standard "hand" pointer for meters or skins with a mouse action. The option can be used in any meter or the [Rainmeter] section with MouseActionCursorName=MyCursor.cur. No path definition is needed in the option.

In addition, several built-in Windows cursors may be used without needing any file name or extension. (Hand, Text, Help, Busy, Cross, Pen) with MouseActionCursorName=Hand.

Demonstration skin:

Code: Select all

[Rainmeter]
Update=1000
Author=JSMorley
MouseActionCursorName=Hand
MouseActionCursor=1

[Metadata]
Name=CustomCursor
Information=Demonstrates the new MouseActionCursorName option for meters.  The cursor used on a meter with a mouse action can now be set to several built-in or any custom cursor.||Custom cursors must be stored in @Resources\Cursors in the root config path of the skin, and are automatically loaded and available.||Values set in [Rainmeter] will be the default for all meters in the skin.||This skin also demonstrates how to use the exising MouseActionCursor option to turn the mouse action cursors on and off.
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=Jul 18, 2012

[Variables]
Current=Standard Hand

[TextStyle]
FontSize=11
SolidColor=0,0,0,1
StringStyle=Bold
AntiAlias=1

[MeterBack]
Meter=Image
X=0
Y=0
W=290
H=280
SolidColor=51,18,0,255

[MeterTitle]
Meter=String
MeterStyle=TextStyle
X=145
Y=5
FontSize=13
FontColor=194,71,4,255
StringAlign=Center
Text=M o u s e  A c t i o n  C u r s o r

[MeterBlock]
Meter=Image
X=5
Y=10R
W=25
H=25
SolidColor=217,204,60,255
LeftMouseDownAction=[!SetOption #CURRENTSECTION# SolidColor 255,248,173,255][!Update]
LeftMouseUpAction=[!SetOption #CURRENTSECTION# SolidColor 217,204,60,255][!Update]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor 217,204,60,255][!Update]

[MeterBlockLabel]
Meter=String
MeterStyle=TextStyle
X=10R
Y=3r
FontSize=12
FontColor=217,204,60,255
Text=#Current#
DynamicVariables=1

[MeterOffLabel]
Meter=String
MeterStyle=TextStyle
X=5
Y=15R
FontColor=255,235,121,255
Text=• Action Cursor Off
LeftMouseUpAction=[!SetOption MeterBlock MouseActionCursor 0][!SetOption MeterBlockLabel FontColor 150,150,150,255][!Update]

[MeterOnLabel]
Meter=String
MeterStyle=TextStyle
X=5
Y=2R
FontColor=255,235,121,255
Text=• Action Cursor On
LeftMouseUpAction=[!SetOption MeterBlock MouseActionCursor 1][!SetOption MeterBlockLabel FontColor 217,204,60,255][!Update]

[MeterStandardLabel]
Meter=String
MeterStyle=TextStyle
X=5
Y=15R
FontColor=160,224,169,255
Text=Standard Cursors

[MeterLine1]
Meter=Image
X=5
Y=0R
W=130
H=2
SolidColor=160,224,169,255

[MeterHandLabel]
Meter=String
MeterStyle=TextStyle
X=5
Y=8R
FontColor=160,224,169,255
Text=• Hand
LeftMouseUpAction=[!SetOption MeterBlock MouseActionCursorName "Hand"][!SetVariable Current "Standard Hand"][!Update]

[MeterTextLabel]
Meter=String
MeterStyle=TextStyle
X=5
Y=2R
FontColor=160,224,169,255
Text=• Text
LeftMouseUpAction=[!SetOption MeterBlock MouseActionCursorName "Text"][!SetVariable Current "Standard Text"][!Update]

[MeterHelpLabel]
Meter=String
MeterStyle=TextStyle
X=5
Y=2R
FontColor=160,224,169,255
Text=• Help
LeftMouseUpAction=[!SetOption MeterBlock MouseActionCursorName "Help"][!SetVariable Current "Standard Help"][!Update]

[MeterBusyLabel]
Meter=String
MeterStyle=TextStyle
X=5
Y=2R
FontColor=160,224,169,255
Text=• Busy
LeftMouseUpAction=[!SetOption MeterBlock MouseActionCursorName "Busy"][!SetVariable Current "Standard Busy"][!Update]

[MeterCrossLabel]
Meter=String
MeterStyle=TextStyle
X=5
Y=2R
FontColor=160,224,169,255
Text=• Cross
LeftMouseUpAction=[!SetOption MeterBlock MouseActionCursorName "Cross"][!SetVariable Current "Standard Cross"][!Update]

[MeterPenLabel]
Meter=String
MeterStyle=TextStyle
X=5
Y=2R
FontColor=160,224,169,255
Text=• Pen
LeftMouseUpAction=[!SetOption MeterBlock MouseActionCursorName "Pen"][!SetVariable Current "Standard Pen"][!Update]

[MeterCustomLabel]
Meter=String
MeterStyle=TextStyle
X=155
Y=128
FontColor=219,255,224,255
Text=Custom Cursors

[MeterLine2]
Meter=Image
X=155
Y=0R
W=120
H=2
SolidColor=219,255,224,255

[MeterCAlienLabel]
Meter=String
MeterStyle=TextStyle
X=155
Y=8R
FontColor=219,255,224,255
Text=• AlienDance
LeftMouseUpAction=[!SetOption MeterBlock MouseActionCursorName "aliendance.ani"][!SetVariable Current "aliendance.ani"][!Update]

[MeterCNoLabel]
Meter=String
MeterStyle=TextStyle
X=155
Y=2R
FontColor=219,255,224,255
Text=• Forbidden
LeftMouseUpAction=[!SetOption MeterBlock MouseActionCursorName "Unavailable.cur"][!SetVariable Current "Unavailable.cur"][!Update]

[MeterCLinkLabel]
Meter=String
MeterStyle=TextStyle
X=155
Y=2R
FontColor=219,255,224,255
Text=• Link Select
LeftMouseUpAction=[!SetOption MeterBlock MouseActionCursorName "Link Select.cur"][!SetVariable Current "Link Select.cur"][!Update]

[MeterCNormalLabel]
Meter=String
MeterStyle=TextStyle
X=155
Y=2R
FontColor=219,255,224,255
Text=• Normal Select
LeftMouseUpAction=[!SetOption MeterBlock MouseActionCursorName "Normal Select.cur"][!SetVariable Current "Normal Select.cur"][!Update]

[MeterCTextLabel]
Meter=String
MeterStyle=TextStyle
X=155
Y=2R
FontColor=219,255,224,255
Text=• Text
LeftMouseUpAction=[!SetOption MeterBlock MouseActionCursorName "Text Select.cur"][!SetVariable Current "Text Select.cur"][!Update]

[MeterCWaitLabel]
Meter=String
MeterStyle=TextStyle
X=155
Y=2R
FontColor=219,255,224,255
Text=• Wait
LeftMouseUpAction=[!SetOption MeterBlock MouseActionCursorName "Working in Background.ani"][!SetVariable Current "Working in Background.ani"][!Update]
7-22-2012 12-09-52 PM.jpg
CustomCursor_1.0.rmskin
You do not have the required permissions to view the files attached to this post.
User avatar
Mordasius
Posts: 1167
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Using the new MouseActionCursorName option

Post by Mordasius »

I can't seem to get custom cursors to work with Mouse Wheel Scrolling Actions. For example, when I have the following:

Code: Select all

[Rainmeter]
MouseScrollDownAction=[!CommandMeasure "mWin7Audio" "ChangeVolume -10"]
MouseScrollUpAction=[!CommandMeasure "mWin7Audio" "ChangeVolume 10"]
MouseActionCursorName=Pointer.ani
I get Pointer.ani on those meters with LeftMouseUPAction= but the regular windows pointer everywhere else. What I want is Pointer.ani anytime the mouse is over the skin.

In fact the pointer doesn't change even if MouseScrollDownAction= and MouseScrollUpAction= are in a meter.
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Using the new MouseActionCursorName option

Post by Brian »

Typically mouse actions in the [Rainmeter] section do not trigger a mouse action cursor change. It has been this way for as long as I have been here. If you want a cursor to work over your entire skin, you need to create a background meter that has a dummy mouse action to achieve this. Something like this works:

Code: Select all

[Rainmeter]
MouseScrollDownAction=[!CommandMeasure "mWin7Audio" "ChangeVolume -10"]
MouseScrollUpAction=[!CommandMeasure "mWin7Audio" "ChangeVolume 10"]
MouseActionCursorName=Pointer.ani

[Background]
Meter=Image
X=0
Y=0
W=#CURRENTCONFIGWIDTH#
H=#CURRENTCONFIGHEIGHT#
SolidColor=0,0,0,1
X2MouseDownAction=[]
I chose X2MouseDownAction because it is unlikely you will need it.



However, you are correct that the mouse action cursor does not work for scroll actions (or the new X button actions) on meters. This has been fixed for the next beta. Thank you for reporting.

-Brian
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using the new MouseActionCursorName option

Post by jsmorley »

And I would NOT want to change it so MouseActionCursor is set when there are actions in the [Rainmeter] section. That is by design. If we changed it, then any skin level mouse action (I for one use a MiddleMouseAction=!Refresh on most skins) would cause the action cursor to just always be "on", even when you are on meters with no action. It would require a hideous amount of very granular work to set MouseActionCursor=0 on backgrounds and all meters with no action, just so you can get the cursor to react to actions and display properly.