It is currently May 9th, 2024, 3:47 pm

Problem on RoundLine meter mouse action

Get help with creating, editing & fixing problems with skins
Kris
Posts: 5
Joined: July 26th, 2012, 1:25 am

Problem on RoundLine meter mouse action

Post by Kris »

I'm trying to add mouse action on a RoundLine meter, but another meter can trigger the mouse action too.

The skin like this:
Snag20120727010851.png
Skin.ini:

Code: Select all

[MeasureCircle]
Measure=Calc
Formula=10


[MeterCPU1Back]
Meter=ROUNDLINE
MeasureName=MeasureCircle
X=0
Y=0
W=350
H=350
LineLength=170
LineStart=155
StartAngle=3.14
RotationAngle=1.0
AntiAlias=1
LineColor=255,255,255,110
Solid=1

LeftMouseDownAction=!Execute ["C:\"]

-CPU2
[MeterCPU2Back]
Meter=ROUNDLINE
MeasureName=MeasureCircle
X=0
Y=0
W=350
H=350
LineLength=170
LineStart=155
StartAngle=0
RotationAngle=1.0 
AntiAlias=1
LineColor=255,255,255,110
Solid=1
Anyone can help me please?
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5408
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Problem on RoundLine meter mouse action

Post by eclectic-tech »

You "covered" your first roundline meter (where you added the mouse action) with the second meter... so you cannot reach the first meter to have the mouse action work.
You can add mouse actions on the second meter, and they work...

So you can "see" the first meter, but the second meter is covering it, so you cannot click on it... You have both meters the same size and starting at 0,0?

You need to change the order of the meters in the ini or create separate skins and send a !Bang to change the ZPos (which skin is on top) in order to have mouse actions work on the topmost skin.
Right now the mouse only reaches the last loaded meter.

To change the zpos, you need to create a meter that executes a !Bang to change the ZPos of the skin configuration.
I am not that familiar with using the !ZPos bang, but here is some info on it from the manual:
!ZPos [POS] (Config)
Changes the z-position of the window. -2 = OnDesktop, -1 = OnBottom, 0 = Normal, 1 = OnTop, 2 = Topmost.
Check the manual: http://rainmeter.net/cms/Bangs

I not sure I understand what you mean by "another meter can trigger the mouse action too" ...

I would get in the habit of using LeftMouseUpAction= for mouse clicks, that way you can use MouseDown to move the skin position on the screen.
Also, you do not need the !Execute anymore, just ["C:\"] works with the latest rainmeter.
Kris
Posts: 5
Joined: July 26th, 2012, 1:25 am

Re: Problem on RoundLine meter mouse action

Post by Kris »

eclectic-tech wrote:You "covered" your first roundline meter (where you added the mouse action) with the second meter... so you cannot reach the first meter to have the mouse action work.
You can add mouse actions on the second meter, and they work...

So you can "see" the first meter, but the second meter is covering it, so you cannot click on it... You have both meters the same size and starting at 0,0?

You need to change the order of the meters in the ini or create separate skins and send a !Bang to change the ZPos (which skin is on top) in order to have mouse actions work on the topmost skin.
Right now the mouse only reaches the last loaded meter.

To change the zpos, you need to create a meter that executes a !Bang to change the ZPos of the skin configuration.
I am not that familiar with using the !ZPos bang, but here is some info on it from the manual: Check the manual: http://rainmeter.net/cms/Bangs

I not sure I understand what you mean by "another meter can trigger the mouse action too" ...

I would get in the habit of using LeftMouseUpAction= for mouse clicks, that way you can use MouseDown to move the skin position on the screen.
Also, you do not need the !Execute anymore, just ["C:\"] works with the latest rainmeter.
Many thanks for the reply, apologize for my English~~
Actually, when I click on any one of the two meters, the mouse action will be triggered at the same time (a new explorer window will pop up). Is that caused by the same size and position of the two meters?
I tried to write a circle meter that contains all my four disks, so that when I click the mouse on any disk, a new explorer window of that disk will pop up. How shall I make it work like that?
Hope I have expressed myself clearly this time~Thanks again!
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5408
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Problem on RoundLine meter mouse action

Post by eclectic-tech »

Yes, the problem is you are covering the meter with another one the same size...

In order to be able to click on more than 1 roundline meter located at the same center point, the only option is to reduce the size of the circle for each so the next one does not completely cover the previous meter.

Load the largest first, then reduce the H & W, adjust the starting point inward toward the center by half the reduced size, and place the second meter. Continue this for each...

Here is a sample skin that shows 4 drives; C: is the outside red ring, D: the next in, E: next, and F:... left click the line to open the drive folder.

Code: Select all

[Rainmeter]
Update=1000

[MeasureFreeDiskSpace1]
Measure=FreeDiskSpace
Drive=C:
InvertMeasure=1

[MeasureFreeDiskSpace2]
Measure=FreeDiskSpace
Drive=D:
InvertMeasure=1

[MeasureFreeDiskSpace3]
Measure=FreeDiskSpace
Drive=E:
IgnoreRemovable=0
InvertMeasure=1

[MeasureFreeDiskSpace4]
Measure=FreeDiskSpace
Drive=F:
IgnoreRemovable=0
InvertMeasure=1

[MeterDisk1]
Meter=ROUNDLINE
MeasureName=MeasureFreeDiskSpace1
X=0
Y=0
W=180
H=180
StartAngle=4.712
RotationAngle=6.283
LineStart=80
LineLength=85
LineColor=255,0,0,255
Solid=1
AntiAlias=1
LeftMouseUpAction=["C:\"]
ToolTipText=C

[MeterDisk2]
Meter=ROUNDLINE
MeasureName=MeasureFreeDiskSpace2
X=30
Y=30
W=120
H=120
StartAngle=4.712
RotationAngle=6.283
LineStart=55
LineLength=60
LineColor=0,255,0,255
Solid=1
AntiAlias=1
LeftMouseUpAction=["D:\"]
ToolTipText=D

[MeterDisk3]
Meter=ROUNDLINE
MeasureName=MeasureFreeDiskSpace3
X=50
Y=50
W=80
H=80
StartAngle=4.712
RotationAngle=6.283
LineStart=35
LineLength=40
LineColor=255,0,255,255
Solid=1
AntiAlias=1
LeftMouseUpAction=["E:\"]
ToolTipText=E

[MeterDisk4]
Meter=ROUNDLINE
MeasureName=MeasureFreeDiskSpace4
X=70
Y=70
W=40
H=40
StartAngle=4.712
RotationAngle=6.283
LineStart=15
LineLength=20
LineColor=128,0,255,255
Solid=1
AntiAlias=1
LeftMouseUpAction=["F:\"]
ToolTipText=F
Image

Not exactly like your idea, but as close as I could using roundline meters.
Kris
Posts: 5
Joined: July 26th, 2012, 1:25 am

Re: Problem on RoundLine meter mouse action

Post by Kris »

Your code works well! Thanks!!!
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5408
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Problem on RoundLine meter mouse action

Post by eclectic-tech »

Glad nothing was "lost in translation" ;-)

You helped me get a better understand of roundline meters,
so we both benefited from this!

Always happy to "play" with codes and see what happens,
Glad I was able to help a little :welcome:
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Problem on RoundLine meter mouse action

Post by MerlinTheRed »

I think there is a way using TransformationMatrix to use one quarter of a circle for each drive. TransformationMatrix lets you move the visual representation of a meter around without changing its clickable area. This means you would create four roundlines that are positioned in a square without overlapping and then use TransformationMatrix to move them on top of each other. This would however leave an invisible border around your skin that is the size of the roundline's diameter.

If you want I can throw together an example skin to demonstrate the idea.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5408
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Problem on RoundLine meter mouse action

Post by eclectic-tech »

I would like to see that...

My approach was akin to forcing a square peg into a round hole...
or should I say, a square background displaying a round line and have minimal overlap! :?

Thanks... always more than one way to get things done...
And that gives us all more choices, too!
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Problem on RoundLine meter mouse action

Post by MerlinTheRed »

Here you go. The background is dark so you see the extent of the skin. Each drive uses one quarter of a whole circle.

Code: Select all

[Rainmeter]
MiddleMouseUpAction=[!Refresh]
Update=1000
BackgroundMode=2
SolidColor=00000080

[Variables]
Radius=50
LineWidth=6
LineColor=ffffff
Drive1="C:"
Drive2="D:"
Drive3="E:"
Drive4="G:"

[MeasureDisk1]
Measure=FreeDiskSpace
Drive=#Drive1#
InvertMeasure=1

[MeasureDisk1Total]
Measure=FreeDiskSpace
Drive=#Drive1#
Total=1

[MeasureDisk1Quarter]
Measure=Calc
Formula=(MeasureDisk1/MeasureDisk1Total/4)
MinValue=0
MaxValue=1

[MeasureDisk2]
Measure=FreeDiskSpace
Drive=#Drive2#
InvertMeasure=1

[MeasureDisk2Total]
Measure=FreeDiskSpace
Drive=#Drive2#
Total=1

[MeasureDisk2Quarter]
Measure=Calc
Formula=(MeasureDisk2/MeasureDisk2Total/4)
MinValue=0
MaxValue=1

[MeasureDisk3]
Measure=FreeDiskSpace
Drive=#Drive3#
InvertMeasure=1

[MeasureDisk3Total]
Measure=FreeDiskSpace
Drive=#Drive3#
Total=1

[MeasureDisk3Quarter]
Measure=Calc
Formula=(MeasureDisk3/MeasureDisk3Total/4)
MinValue=0
MaxValue=1

[MeasureDisk4]
Measure=FreeDiskSpace
Drive=#Drive4#
InvertMeasure=1

[MeasureDisk4Total]
Measure=FreeDiskSpace
Drive=#Drive4#
Total=1

[MeasureDisk4Quarter]
Measure=Calc
Formula=(MeasureDisk4/MeasureDisk4Total/4)
MinValue=0
MaxValue=1

[MeterDisk1]
Meter=RoundLine
MeasureName=MeasureDisk1Quarter
X=0
Y=0
W=(#Radius#*2)
H=(#Radius#*2)
Solid=1
StartAngle=3.141
LineStart=(#Radius#-#LineWidth#)
LineLength=#Radius#
LineColor=#LineColor#
LeftMouseUpAction=[#Drive1#]
AntiAlias=1
TransformationMatrix=1;0;0;1;#Radius#;#Radius#

[MeterDisk2]
Meter=RoundLine
MeasureName=MeasureDisk2Quarter
X=(#Radius#*2)
Y=0
W=(#Radius#*2)
H=(#Radius#*2)
Solid=1
StartAngle=(3.141/2*3)
LineStart=(#Radius#-#LineWidth#)
LineLength=#Radius#
LineColor=#LineColor#
LeftMouseUpAction=[#Drive2#]
AntiAlias=1
TransformationMatrix=1;0;0;1;-#Radius#;#Radius#

[MeterDisk3]
Meter=RoundLine
MeasureName=MeasureDisk3Quarter
X=0
Y=(#Radius#*2)
W=(#Radius#*2)
H=(#Radius#*2)
Solid=1
StartAngle=(3.141/2)
LineStart=(#Radius#-#LineWidth#)
LineLength=#Radius#
LineColor=#LineColor#
LeftMouseUpAction=[#Drive3#]
AntiAlias=1
TransformationMatrix=1;0;0;1;#Radius#;-#Radius#

[MeterDisk4]
Meter=RoundLine
MeasureName=MeasureDisk4Quarter
X=(#Radius#*2)
Y=(#Radius#*2)
W=(#Radius#*2)
H=(#Radius#*2)
Solid=1
StartAngle=0
LineStart=(#Radius#-#LineWidth#)
LineLength=#Radius#
LineColor=#LineColor#
LeftMouseUpAction=[#Drive4#]
AntiAlias=1
TransformationMatrix=1;0;0;1;-#Radius#;-#Radius#

[MeterDisk1Label]
Meter=String
X=(#Radius#*2-4)
Y=(#Radius#*2-4)
FontFace=Arial Black
FontSize=12
FontColor=#LineColor#
Text=#Drive1#
AntiAlias=1
StringAlign=RightBottom

[MeterDisk2Label]
Meter=String
X=(#Radius#*2+4)
Y=(#Radius#*2-4)
FontFace=Arial Black
FontSize=12
FontColor=#LineColor#
Text=#Drive2#
AntiAlias=1
StringAlign=LeftBottom

[MeterDisk3Label]
Meter=String
X=(#Radius#*2-4)
Y=(#Radius#*2+4)
FontFace=Arial Black
FontSize=12
FontColor=#LineColor#
Text=#Drive3#
AntiAlias=1
StringAlign=RightTop

[MeterDisk4Label]
Meter=String
X=(#Radius#*2+4)
Y=(#Radius#*2+4)
FontFace=Arial Black
FontSize=12
FontColor=#LineColor#
Text=#Drive4#
AntiAlias=1
StringAlign=LeftTop
You do not have the required permissions to view the files attached to this post.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5408
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Problem on RoundLine meter mouse action

Post by eclectic-tech »

Thanks MTR!

Exactly what I had (trapped somewhere) in my mind! :D

I will definitely have to spend more time learning about the powers of the transformation tool.

Thanks again! :great: