It is currently April 28th, 2024, 11:09 am

[Suggestion] Meter1|Meter2|Meter3

Report bugs with the Rainmeter application and suggest features.
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

[Suggestion] Meter1|Meter2|Meter3

Post by AlC »

Just a thought, that I had already some months ago.

i.E. old
LeftMouseUpAction=!Execute [!ShowMeter Meter1][!ShowMeter Meter2][!ShowMeter Meter3][!UpdateMeter TestMeter66][!UpdateMeter TestMeter77]

new
LeftMouseUpAction=!Execute [!ShowMeter Meter1|Meter2|Meter3][!UpdateMeter TestMeter66|TestMeter77]

or:
LeftMouseUpAction=!Execute [!EnableMeasure mTimeHour|mTimeMin][!DisableMeasureGroup mCalc1|mTimeSec]

or maybe
LeftMouseUpAction=!Execute [!SetOption Meter1|Meter2|Meter5 FontColor 255,0,0,255]

maybe something others than |

BTW: Nice that you sort the bangs ;-)
Rainmeter - You are only limited by your imagination and creativity.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: [Suggestion] Meter1|Meter2|Meter3

Post by Kaelri »

We use groups for this. :)

Code: Select all

[Meter1]
Group=HideMe
...

[Meter2]
Group=HideMe
...

[Meter3]
Group=HideMe
...

LeftMouseUpAction=!HideMeterGroup HideMe
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Suggestion] Meter1|Meter2|Meter3

Post by jsmorley »

Have you looked at the Group version of these bangs? It is a way to have a single bang impact more than one meter/measure/skin at a time.
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: [Suggestion] Meter1|Meter2|Meter3

Post by AlC »

Of course I know the group bangs :)

but then you must add Group=... to the meters/measures. So when I have 6 meters or more then I use Groups, too. (If I want all meters in the Group for the bang)
It would be useful when you have 1 bang for some meters/measures, which maybe in different Groups

so you wouldn't have such a long code

LeftMouseUpAction=!Execute [!ShowMeter Meter1][!ShowMeter Meter2][!ShowMeter Meter3][!ShowMeter Meter4][!ShowMeter Meter5]

LeftMouseUpAction=!Execute [!ShowMeter Meter1|Meter2|Meter3|Meter4|Meter5]

so it would be clearly arranged

mh... I don't know if it's useful/possible/necessary.
My thought was to make it more clear or shorter. Like deleting Rainmeter from !RainmeterHideMeter (to !HideMeter).
Rainmeter - You are only limited by your imagination and creativity.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: [Suggestion] Meter1|Meter2|Meter3

Post by Kaelri »

We discussed this a little bit in the IRC yesterday. It should be possible to add support for this, although we'll have to study it in order to make sure the syntax won't break things.

I think I would still prefer to use groups in most cases, even if this was available. But that's just my personal style. They're really two different ways of solving the same problem: either you have one really long !HideMeter bang, or a short !HideMeterGroup bang plus a bunch of small keys in your meters. Both approaches would get the same job done with a similar amount of code.

(That said, I would say that Groups also have one advantage: you can use them in MeterStyles. I find that when I need to show or hide a bunch of meters, they tend to be part of a series, such as a row of tabs or a list of feed items, which means that I'm probably already using a common style for all of the affected meters. That means I can add a single "Group" key to the style section, and a single "!HideMeterGroup" bang, which is much shorter than either of your earlier examples.)

Anyway, consider this on our radar. :)
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: [Suggestion] Meter1|Meter2|Meter3

Post by AlC »

Yes I think experienced coder like you wouldn't use the suggestioned style. And I give you right with the MeterStyles, there is the group way the better solution.
But then I came back to the point "experienced coder". When I look at the Rainmeter codes that are shared, there are not so many codes which are so good coded (like in e.g. enigma or an other theme).

I believe for a beginner/standard Rainmeter coder, it would be a good looking style. Because you see with one watch what the mouseaction does:

e.g.
IfValue=...
IfAction=!Execute [!ShowMeter Meter1|Meter2|Meter3][!HideMeter Meter15|Meter17][!UpdateMeter CalcString1|CalcString2]

So you see with one watch : It show these meters and hide these meters and update these meters

And yes of course someting like this would be not the nice sollution:
LeftMouseUpAction=!Execute [!ShowMeter Meter1|Meter2|Meter3|Meter4|Meter5|Meter6|Meter7|Meter8] there is the group variant, the better solution
Rainmeter - You are only limited by your imagination and creativity.
User avatar
spx
Developer
Posts: 686
Joined: August 15th, 2009, 2:41 pm
Location: Osaka, JPN

Re: [Suggestion] Meter1|Meter2|Meter3

Post by spx »

Meter/Measure name can include various characters including "|". So it has the potential to break compatibility.

Code: Select all

[Background]
...
[Feed1]
...
[Feed1|Background]
...
[Feed1|Title]
...

LeftMouseUpAction=!execute [!ShowMeter Feed1|Background][!Redraw]
Should show "Feed1 and Background" or "Feed1|Background" ?

I would prefer to use Group=showgroup1|hidegroup3 etc. rather than adding other intricate separator to non-group bangs.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: [Suggestion] Meter1|Meter2|Meter3

Post by Kaelri »

AlC wrote:Yes I think experienced coder like you wouldn't use the suggestioned style. And I give you right with the MeterStyles, there is the group way the better solution.
But then I came back to the point "experienced coder". When I look at the Rainmeter codes that are shared, there are not so many codes which are so good coded (like in e.g. enigma or an other theme).

I believe for a beginner/standard Rainmeter coder, it would be a good looking style.
I don't think that's the issue here - I don't see clusters as the "easy" way and groups as the "hard" way. What you're suggesting may have some legitimate use cases, and giving coders more flexibility is almost always a good thing. So I support your suggestion on that basis.

However, if I thought this was only about adding a new feature for people who aren't willing to learn the "better" way, I would oppose it. I don't believe in "training wheels" when it comes to something like a programming language. It's a waste of time to teach a skill to someone if they're only going to abandon that skill later on. I think that Rainmeter's language (compared to others) has a very simple, intuitive structure that is all about providing you with the best way to accomplish a task. We also have a very collaborative, interactive community, and I see no value to be gained by segregating ourselves according to our skill levels. I've been here for three years, and you've been here for three months - but we're both shooting with the same gun, and I think that's an asset.

[/soapbox] :)
spx wrote:Meter/Measure name can include various characters including "|". So it has the potential to break compatibility.
...
I would prefer to use Group=showgroup1|hidegroup3 etc. rather than adding other intricate separator to non-group bangs.
Maybe we could require bangs of this type to contain meter names inside quotes in order for clustering to be valid?

Code: Select all

LeftMouseUpAction=!execute [!ShowMeter "Feed1" | "Background"][!Redraw]
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Suggestion] Meter1|Meter2|Meter3

Post by jsmorley »

I vote we leave it alone. This request is well intentioned, but is just "another way" to do the same thing you can do by defining multiple groups on meters. spx's point is well taken, and I see no reason to code around that. All things being equal, not adding more "quotes" to deal with in Bangs and Lua would be my preference.
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: [Suggestion] Meter1|Meter2|Meter3

Post by AlC »

@ Kaelri: Just to clear it:

The argument with the beginner/standard codes was just an example. And sorry I couldn't really bring it to you what was my intention.

The idea behind this suggestion was only:
Make it more readable, clearly arranged and shorther, if you have 2 or more bangs, which are the same.

Yes when this should make problems you should leave it, or find a better solution than |. As long as it is short and well understand, that don't confuse people.
And I give jsmorley absolute right, you should avoid putting more quotes to the bangs :) .

But thanks for all the replies.
Rainmeter - You are only limited by your imagination and creativity.