Page 2 of 6

Re: Disabled option in meters

Posted: April 12th, 2018, 1:00 pm
by jsmorley
fonpaolo wrote:What I always do is to set up a line of commands, then I copy and paste, edit them accordingly, use "!Show" instead of "!Hide", "[]" instead of the command(s) and so on.
Even if the commands are many, it will take less than a minute.

...but this is only my opinion.
Again, it's not a game-changer, but I could argue that one of the things you have to be careful of when using !SetOption to turn off and on mouse actions on a meter is that mouse actions almost always consist of bangs. Bangs are generally made up of the bang name, the target measure or meter for the bang, and one or more string "parameters" that often can have spaces in them. That means that while:

LeftMouseUpAction=[!SetOption SomeMeter Text "Hello world"]

is fine, and turning it "off" might be:

SomeAction=[!SetOption SomeMeter LeftMouseUpAction "[]"]

and that's fine, turning it back "on" would have to be:

SomeAction=[!SetOption SomeMeter LeftMouseUpAction """[!SetOption SomeMeter LeftMouseUpAction "Hello world"]"""]

Since you have embedded "quotes" in the bang you are turning off and on.

What is being suggested is:

LeftMouseUpAction=[!SetOption SomeMeter Text "Hello world"]

SomeAction=[!DisableMouse SomeMeter]

SomeAction=[!EnableMouse SomeMeter]

I find that has a lot of charm, particularly for a new'ish skin author...

Add to this the fact that many mouse actions will have [!UpdateMeter SomeMeter][!Redraw] on them, that also need to be "put back".

Re: Disabled option in meters

Posted: April 12th, 2018, 1:17 pm
by fonpaolo
Well, I concur with you that this option can be useful.
So, given my last experience* not so long ago, could this be extended to LeftMouseDoubleClickAction and so on?

* I admit in this case I was really close to give up... but probably it was caused by my loss of attention.

Re: Disabled option in meters

Posted: April 12th, 2018, 1:19 pm
by jsmorley
fonpaolo wrote:Well, I concur with you that this option can be useful.
So, given my last experience* not so long ago, could this be extended to LeftMouseDoubleClickAction and so on?

* I admit in this case I was really close to give up... but probably it was caused by my loss of attention.
My thinking is that it would just cause the meter to entirely ignore all user-defined mouse actions - mouse clicks, mouse over, mouse scroll. That is one of the benefits as I see it, you don't need to separately turn "off" and "on" multiple mouse actions that might be on a meter.

This can't be "skin wide", nor impact mouse actions in [Rainmeter] or the fact that a right-mouse click on the skin opens the skin context menu. It is intended for turning off and on any mouse actions defined on a specific meter.

Re: Disabled option in meters

Posted: April 12th, 2018, 1:34 pm
by fonpaolo
jsmorley wrote:My thinking is that it would just cause the meter to entirely ignore all mouse actions - mouse clicks, mouse over, mouse scroll. That is one of the benefits as I see it, you don't need to separately turn "off" and "on" multiple mouse actions that might be on a meter.
Ugh! ...no.
I think that disable completely all mouse functions, it's a bit too much.
Let me explain, I'm using my "last" skin as reference, thanks to your ConfigActive plugin, I (finally) had the possibility to change mouse behavior if another skin is loaded or not:
- If the skin is loaded, do this with double click, don't do that with mouse click, and so on...
- If the skin is unloaded, do the opposite.

so, with your "disable mouse" function, you can't do anything.
... or simply, you've to do it the "old" way.

Re: Disabled option in meters

Posted: April 12th, 2018, 1:37 pm
by jsmorley
fonpaolo wrote:Ugh! ...no.
I think that disable completely all mouse functions, it's a bit too much.
Let me explain, I'm using my "last" skin as reference, thanks to your ConfigActive plugin, I (finally) had the possibility to change mouse behavior if another skin is loaded or not:
- If the skin is loaded, do this with double click, don't do that with mouse click, and so on...
- If the skin is unloaded, do the opposite.

so, with your "disable mouse" function, you can't do anything.
... or simply, you've to do it the "old" way.
Yes, this has nothing to do with "changing" a mouse action. That's not what this discussion is all about.

Re: Disabled option in meters

Posted: April 12th, 2018, 1:45 pm
by jsmorley
This is strictly about having a LeftMouseUpAction on a meter like:

LeftMouseUpAction=[!SetClip "[MeasureProductName] ([MeasureWinBits]-Bit)#CRLF#Version [MeasureReleaseID]#CRLF#Build [MeasureCurrentBuild].[MeasureUBR]#CRLF#[MeasureCPUName]#CRLF#Running at: [MeasureCPUSpeed] Mhz"][Play "#@#Sounds\Copy.wav"]

And wanting to toggle that "off" and "on". Today, that would be a pretty hefty !SetOption, and the intent is to simplify that.

Re: Disabled option in meters

Posted: April 12th, 2018, 1:45 pm
by fonpaolo
Sorry, I realized my explanations wasn't really clear enough.
I mean I'm enabling/disabling some mouse commands, using "[]" if another skin is loaded or not...
...and all the commands are used in a single Image meter.

If this makes more sense.

Re: Disabled option in meters

Posted: April 12th, 2018, 1:49 pm
by balala
jsmorley wrote:turning it "off" might be:

SomeAction=[!SetOption SomeMeter LeftMouseUpAction "[]"]
The above !SetOption gives an Error: Cannot replace variable with itself "" message in the log, while SomeAction=[!SetOption SomeMeter LeftMouseUpAction ""] doesn't. I'd say it's better to use the second form of the action, without the brackets.

Re: Disabled option in meters

Posted: April 12th, 2018, 1:50 pm
by jsmorley
fonpaolo wrote:Sorry, I realized my explanations wasn't really clear enough.
I mean I'm enabling/disabling some mouse commands, using "[]" if another skin is loaded or not...
...and all the commands are used in a single Image meter.

If this makes more sense.
It's still not about "alternative" mouse actions. You have a LeftMouseUpAction (or whatever) set on a meter. !DisableMouse causes the meter to ignore the mouse, and !EnableMouse causes it to detect and fire the mouse action.

Re: Disabled option in meters

Posted: April 12th, 2018, 1:51 pm
by jsmorley
balala wrote:The above !SetOption gives an Error: Cannot replace variable with itself "" message in the log, while SomeAction=[!SetOption SomeMeter LeftMouseUpAction ""] doesn't. I'd say it's better to use the second form of the action, without the brackets.
I'll have to look at that. The issue is that LeftMouseUpAction="" means something entirely different than LeftMouseUpAction=[].

One means "there is no mouse action" and the other means "there is a mouse action that doesn't do anything". This has implications when there are mouse actions on different meters that "overlap", or if there are mouse actions on the "skin".