It is currently September 24th, 2020, 1:14 am

Using !SetOption

Tips and Tricks from the Rainmeter Community
User avatar
santa_ryan
Posts: 417
Joined: June 22nd, 2010, 4:11 am

Re: Using !SetOption

Post by santa_ryan »

Typo.

Code: Select all

[SomeMeter]
Meter=STRING
...
FontSize=10
MouseOverAction=!SetOption "SomeMeter" "12" "FontSize"
MouseLeaveAction=!SetOption "SomeMeter" "10" "FontSize"
should be

Code: Select all

[SomeMeter]
Meter=STRING
...
FontSize=10
MouseOverAction=!SetOption "SomeMeter" "FontSize" "12"
MouseLeaveAction=!SetOption "SomeMeter" "FontSize" "10"
I have three rules when I'm trying to help you.
  • Don't get mad when you don't understand something
  • Be VERY specific with what you ask for.
    The more specific you are, the higher the quality of support you receive.
  • Do not just copy and paste what I put in examples and come back saying it doesn't work.
    It does work, but I purposely left blanks that you need to fill for your specific needs.
User avatar
jsmorley
Developer
Posts: 21386
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using !SetOption

Post by jsmorley »

Fixed.
User avatar
fabularasa
Posts: 76
Joined: February 26th, 2011, 12:51 am
Location: Poland

Re: Using !SetOption

Post by fabularasa »

Code: Select all

[RSSIconOff]
Hidden=0
Meter=Image
X=65
Y=31
W=20
PreserveAspectRatio=1
ImageName="RSS.png"
MouseOverAction=!Execute [!RainmeterHideMeter RSSIconOff][!RainmeterShowMeter RSSIconOn][!RainmeterRedraw]

[RSSIconOn]
Hidden=1
Meter=Image
X=65
Y=31
W=25
PreserveAspectRatio=1
ImageName="RSS.png"
MouseLeaveAction=!Execute [!RainmeterHideMeter RSSIconOn][!RainmeterShowMeter RSSIconOff][!RainmeterRedraw]
LeftMouseUpAction=!Execute [!RainmeterActivateConfig "RainSideBar RSS" "RainSideBar RSS.ini"][!RainmeterRedraw]

Instead I can use:

Code: Select all

[RSSIconOff]
Hidden=0
Meter=Image
X=65
Y=31
W=20
PreserveAspectRatio=1
ImageName="RSS.png"
MouseOverAction=!SetOption "RSSIconOff" "W" "25" 
MouseLeaveAction=!SetOption "RSSIconOff" "W" "20" 

In this case showing and hiding (icon) is much slower ;(
poiru
Developer
Posts: 2875
Joined: April 17th, 2009, 12:18 pm

Re: Using !SetOption

Post by poiru »

fabularasa wrote:Instead I can use:

Code: Select all

[RSSIconOff]
Hidden=0
Meter=Image
X=65
Y=31
W=20
PreserveAspectRatio=1
ImageName="RSS.png"
MouseOverAction=!SetOption "RSSIconOff" "W" "25" 
MouseLeaveAction=!SetOption "RSSIconOff" "W" "20" 
In this case showing and hiding (icon) is much slower ;(
Use:

Code: Select all

MouseOverAction=!Execute [!SetOption "RSSIconOff" "W" "25"][!UpdateMeter "RSSIconOff"][!Redraw]
MouseLeaveAction=!Execute [!SetOption "RSSIconOff" "W" "85"][!UpdateMeter "RSSIconOff"][!Redraw]
User avatar
fabularasa
Posts: 76
Joined: February 26th, 2011, 12:51 am
Location: Poland

Re: Using !SetOption

Post by fabularasa »

poiru wrote: Use:

Code: Select all

MouseOverAction=!Execute [!SetOption "RSSIconOff" "W" "25"][!UpdateMeter "RSSIconOff"][!Redraw]
MouseLeaveAction=!Execute [!SetOption "RSSIconOff" "W" "85"][!UpdateMeter "RSSIconOff"][!Redraw]
:thumbup:

Is it works for X=... Y=... ?

MouseOverAction=!Execute [!SetOption "RSSIconOff" "Y" "29"][!UpdateMeter "RSSIconOff"][!Redraw]
MouseLeaveAction=!Execute [!SetOption "RSSIconOff" "Y" "32"][!UpdateMeter "RSSIconOff"][!Redraw]

nothing happened
User avatar
Seahorse
Posts: 1220
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: Using !SetOption

Post by Seahorse »

He means:

Code: Select all

[RSSIconOff]
Hidden=0
Meter=Image
X=65
Y=31
W=20
PreserveAspectRatio=1
ImageName="RSS.png"
MouseOverAction=!Execute [!SetOption "RSSIconOff" "W" "25"][!UpdateMeter "RSSIconOff"][!Redraw]
MouseLeaveAction=!Execute [!SetOption "RSSIconOff" "W" "85"][!UpdateMeter "RSSIconOff"][!Redraw]
Is this what you have?
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

poiru
Developer
Posts: 2875
Joined: April 17th, 2009, 12:18 pm

Re: Using !SetOption

Post by poiru »

fabularasa wrote:Is it works for X=... Y=... ?
From the first post in this thread:
poiru wrote:!SetOption cannot change..
- the X or Y of a meter (use !MoveMeter)
User avatar
XANCI
Posts: 106
Joined: September 18th, 2011, 6:37 am
Location: Nanjing, China

Re: Using !SetOption

Post by XANCI »

Code: Select all

!SetOptionGroup [Group] [Option] [Value] (Config)
Can you guys make a !bang that take effect in a Config Group like that?

I got multiple skins with multiple meters(STRING, LINE, HISTOGRAM), and they share a same color(FontColor, LineColor, PrimaryColor), lets call it #Color1#. This #Color1# is recorded in a .inc file, once I want to change it, I use !WriteKeyValue to change #Color1# in that .inc file and then refresh all skins.
This is efficient, but per refresh Line & Histogram Meters will reset

I find that !SetOption will change Line & Histogram 's Color without reset them, but this is too troublesome in coding since I got multiple skins. !SetOption will be handy if it can take effect with each [Meter/Measure Group] in [Config Group]

What's more, can it be possible that there be no more !xxxGroup !bang, and [Meter/Measure]/[Meter/Measure Group] & [Config]/[Config Group] can be refered the same ways in !bangs ? Of course it is Author's responsibility to make sure these names are unique.
User avatar
jsmorley
Developer
Posts: 21386
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using !SetOption

Post by jsmorley »

XANCI wrote:

Code: Select all

!SetOptionGroup [Group] [Option] [Value] (Config)
Can you guys make a !bang that take effect in a Config Group like that?

I got multiple skins with multiple meters(STRING, LINE, HISTOGRAM), and they share a same color(FontColor, LineColor, PrimaryColor), lets call it #Color1#. This #Color1# is recorded in a .inc file, once I want to change it, I use !WriteKeyValue to change #Color1# in that .inc file and then refresh all skins.
This is efficient, but per refresh Line & Histogram Meters will reset

I find that !SetOption will change Line & Histogram 's Color without reset them, but this is too troublesome in coding since I got multiple skins. !SetOption will be handy if it can take effect with each [Meter/Measure Group] in [Config Group]

What's more, can it be possible that there be no more !xxxGroup !bang, and [Meter/Measure]/[Meter/Measure Group] & [Config]/[Config Group] can be refered the same ways in !bangs ? Of course it is Author's responsibility to make sure these names are unique.
Interesting. No idea if it is practical or possible in the current code structure, but will bring it up.
User avatar
smurfier
Moderator
Posts: 1937
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Using !SetOption

Post by smurfier »

Sooo... What's this for then?
Manual wrote:!SetOptionGroup [Group] (Config)
Sets a an option (e.g. FontSize, Text, Formula, etc.) of meters and measures in the specified group.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .