It is currently March 28th, 2024, 8:58 am

Disabled option in meters

Report bugs with the Rainmeter application and suggest features.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Disabled option in meters

Post by jsmorley »

BTW: This is only true of "click" actions. It is not true of MouseOverAction.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeterOne]
Meter=Image
W=100
H=100
SolidColor=255,0,0,255
MouseOverAction=[!SetOption MeterOne SolidColor "255,0,0,90"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterOne SolidColor "255,0,0,255"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=[!SetOption MeterOne SolidColor "255,355,0,2555"][!UpdateMeter *][!Redraw]

[MeterTwo]
Meter=Image
X=50
Y=50
W=100
H=100
SolidColor=0,255,0,255
MouseOverAction=[]
MouseLeaveAction=[]
LeftMouseUpAction=[]
You will want to think carefully about MouseOverAction when meters overlap.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy
Contact:

Re: Disabled option in meters

Post by fonpaolo »

jsmorley wrote:BTW: This is only true of "click" actions. It is not true of MouseOverAction.
...
Any suggestion on how to solve this?
Trying with !SetOption doesn't seem to work either...
The problem I have is:
- A "mouse sensor" with the size of the main image displayed, to activate and deactivate another skin;
- A "target point" (a button) to change the main image to another;
- If I click on the image, the second skin is loaded and/or unloaded (using your ConfigActive plugin :17good );
(as a side note, if the second skin is unloaded the mouse action is double click, if it's loaded is a single click. I tried to add another !SetOption to disable the single click on the main image, but... read below)
- If I click on the button (on top of all), it changes image, but, at the same time, it also closes the second skin (if loaded).
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Disabled option in meters

Post by jsmorley »

Not quite sure. While conflicting mouse button actions will be resolved by the one "in front" winning, mouse hover actions will fire both if there are two on a particular shared solid pixel. It creates some interesting design choices, where I think !SetOption would have to play a roll. Also be aware that this "winning" deal is only about the same kind of mouse action. So having a LeftMouseUpAction=[] on a front meter will not keep a LeftMouseDoubleClickAction from firing on a meter behind.

I think you are going to have to have a mouse over on the "front" meter use !SetOption to set any all conflicting mouse actions of any kind on all other meters that overlap to something "safe". You are going to have to carefully control what actions are taken when.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Disabled option in meters

Post by jsmorley »

There are oddities and limitations with mouse actions, due to the nature of Rainmeter. The fact that in spite of appearances, there are no "layers" in a Rainmeter skin. Any given pixel is either solid or it isn't, and it is either within the boundaries of one or more meter containers or it isn't. That is what Rainmeter really knows at the core of it. Nobody gets to "own" a pixel.

This means that skin "design" has to play a big role. Conflicts have to be managed by not having them.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy
Contact:

Re: Disabled option in meters

Post by fonpaolo »

To avoid the problem, I'm using your ConfigActive and SetOption, to switch between single click and double click, if a skin is loaded or not.
The problem occurs when I want to disable the single click on the meter below, to avoid that if I click to change image, it also closes the other skin if it's loaded.
I don't know if the problem is related to the use of a button, maybe I can change it with an image, or if it's not related and in general this is what happens anyway.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Disabled option in meters

Post by jsmorley »

At the risk of "being sorry I asked", I have to say I don't really follow entirely. Can you post some kind of "mock up" that is reasonably simple and easy to follow that demonstrates?
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy
Contact:

Re: Disabled option in meters

Post by fonpaolo »

Well, It's a very complicated skin... I'll try to explain with some code (I hope)
This is the measure that keeps an eye to a second skin, and changes the mouse click:

Code: Select all

;VERIFY SATELLITE PANEL STATUS ------------------------------------------

[MeasureSatPanelStatus]
Measure=Plugin
Plugin=ConfigActive
ConfigName=Avengers\AV Sat
IfCondition=MeasureSatPanelStatus=1
IfTrueAction=[!SetOption MeterSatBackground LeftMouseDoubleClickAction """[]"""][!SetOption MeterSatBackground LeftMouseUpAction """[!DeactivateConfig "Avengers\AV Sat"][!Delay "200"][!UpdateMeasure MeasureSatPanelStatus]"""][!UpdateMeter MeterSatBackground][!SetOption MeasureSatImage FinishAction """[!CommandMeasure MeasureTimeRemSat "Reset"][!UpdateMeasure MeasureTimeRemSat][!UpdateMeter MeterTimeRemSat][!UpdateMeter MeterDisplayImage][!UpdateMeter MeterDisplaySatImage "Avengers\AV Sat"][!Redraw]"""]
IfFalseAction=[!SetOption MeterSatBackground LeftMouseDoubleClickAction """[!ActivateConfig "Avengers\AV Sat"][!Delay "200"][!UpdateMeasure MeasureSatPanelStatus]"""][!SetOption MeterSatBackground LeftMouseUpAction """[]"""][!UpdateMeter MeterSatBackground][!SetOption MeasureSatImage FinishAction """[!CommandMeasure MeasureTimeRemSat "Reset"][!UpdateMeasure MeasureTimeRemSat][!UpdateMeter MeterTimeRemSat][!UpdateMeter MeterDisplayImage][!Redraw]"""]
UpdateDivider=-1
This is the backgroud image:

Code: Select all

[MeterSatBackground]
Meter=Image
SolidColor=150,200,200,90
x=19
y=237
W=247
H=277
LeftMouseDoubleClickAction=[!ActivateConfig "Avengers\AV Sat"][!Delay "200"][!UpdateMeasure MeasureSatPanelStatus]
LeftMouseUpAction=[]
MouseActionCursor=0
UpdateDivider=-1
Hidden=#SatClose#
Group=GroupSat
These are the buttons I use to change the images (I'm thinking to use only one, in the future):

Code: Select all

[MeterPointImage]
Meter=Button
ButtonImage=#@#Images\AVWeather\PointSatButton.png
x=([MeasurePointX]-12)
y=([MeasurePointY]-12)
ButtonCommand=[!HideMeterGroup 0][!ShowMeterGroup 1][!SetVariable ImgAllCloseA "1"][!SetVariable Active "1"][!WriteKeyValue Variables ImgAllCloseA "1"][!WriteKeyValue Variables Active "1"]
DynamicVariables=1
UpdateDivider=-1
Hidden=(#SatClose#+#ImgAllCloseA#)
Group=ImgSat| 0

[MeterPointImage_1]
Meter=Button
ButtonImage=#@#Images\AVWeather\PointSatButton1.png
x=([MeasurePointX_1]-12)
y=([MeasurePointY_1]-12)
ButtonCommand=[!HideMeterGroup 1][!ShowMeterGroup 0][!SetVariable ImgAllCloseA "0"][!SetVariable Active "0"][!WriteKeyValue Variables ImgAllCloseA "0"][!WriteKeyValue Variables Active "0"]
DynamicVariables=1
UpdateDivider=-1
Hidden=(#SatClose#+(1-#ImgAllCloseA#))
Group=ImgSat| 1
Let me know if all this can make sense to you...
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Disabled option in meters

Post by jsmorley »

Bang! Thud...
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy
Contact:

Re: Disabled option in meters

Post by fonpaolo »

Hit and sunk. :oops:
This is just a very small part of my skin, I also use two other skins (as inc files) to give the... complete experience.
...and it's not even the most complicated.

Sometimes... only sometimes? ...I get lost trying to understand my own code. :17oops :17denial

I can think that it's obvious why I'm taking so long to update my suite. :(
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Disabled option in meters

Post by eclectic-tech »

fonpaolo wrote:...Sometimes... only sometimes? ...I get lost trying to understand my own code. :17oops :17denial

I can think that it's obvious why I'm taking so long to update my suite. :(
Been there many times! :lol:

Note to Self: Remember to make more comments in the skin code, so when you come back a year(s) later, you can tell yourself what you were thinking when you coded that section! :D
Post Reply