It is currently September 20th, 2019, 5:32 pm

Working with InputText

Our most popular Tips and Tricks from the Rainmeter Team and others
User avatar
jsmorley
Developer
Posts: 19467
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Working with InputText

jsmorley » May 15th, 2019, 1:18 pm

balala wrote:
May 14th, 2019, 7:08 pm
Probably there is not, but you can use the Clamp function to limit the value. For example if you're using a !SetVariable bang to set the entered value to a variable (Command1=[!SetVariable MyVariable "$UserInput$"]), you can limit this value as it follows: Command1=[!SetVariable MyVariable "(Clamp($UserInput$,0,10))"] (obviously you have to edit the limits of the above Clamp function to whatever you do need).
This is some damn-clever thinking outside the box... ;-)
User avatar
Pul53dr1v3r
Posts: 211
Joined: July 30th, 2014, 10:30 am

Re: Working with InputText

Pul53dr1v3r » May 15th, 2019, 5:00 pm

jsmorley wrote:
May 15th, 2019, 1:18 pm
This is some damn-clever thinking outside the box... ;-)
...and it is still not my "best" shot. :Whistle
User avatar
Pul53dr1v3r
Posts: 211
Joined: July 30th, 2014, 10:30 am

Re: Working with InputText

Pul53dr1v3r » May 16th, 2019, 12:16 pm

i guess there is a better way to simplify the refreshes of the multiple skins in skin suite as in this case:

LeftMouseUpAction=[!WriteKeyValue "Variables" "SkinColor1Alpha" "180" "#@#\Variables.inc"][!Refresh][!Refresh "illustro_Pulsar_HWi\CPU-RAM"][!Refresh "illustro_Pulsar_HWi\VolumeControl"]

Command2=[!Refresh][!Refresh #ROOTCONFIG#\CPU-RAM][!Refresh #ROOTCONFIG#\VolumeControl]

LeftMouseUpAction=["#@#Addons\RainRGB4.exe" "VarName=SkinColor2" "FileName=#@#\Variables.inc" "RefreshConfig=illustro_Pulsar_HWi\CPU-RAM | illustro_Pulsar_HWi\VolumeControl | illustro_Pulsar_HWi\Settings"]

Pls let me know if yes.



@jsmorley sorry if this one is one more from the inside of my small box . Don't expect a tree of a mustard seed.
User avatar
jsmorley
Developer
Posts: 19467
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Working with InputText

jsmorley » May 16th, 2019, 12:23 pm

You can add a Group option to the [Rainmeter] section of each of the skins, or alternatively add a Group option to the [ConfigName] section for each skin in Rainmeter.ini, and then use !RefreshGroup.
User avatar
Pul53dr1v3r
Posts: 211
Joined: July 30th, 2014, 10:30 am

Re: Working with InputText

Pul53dr1v3r » May 16th, 2019, 1:30 pm

jsmorley wrote:
May 16th, 2019, 12:23 pm
i was overlooked that even the skins can be grouped, apart from meters and measures. :great:
Last edited by Pul53dr1v3r on May 16th, 2019, 2:24 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 19467
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Working with InputText

jsmorley » May 16th, 2019, 1:38 pm

The difference between defining them in the [Rainmeter] section of the skin .ini file, and defining them in the [ConfigName] section in Rainmter.ini is that if it is in Rainmeter.ini, then it is based on the config name, and if you have more than one skin variant that shares that config name, they automatically all get the group attribute. If you define it in the skin .ini, then only that variant will be a member of the group. Having said that though, you also need to consider if you have multiple Layouts that contain your skins, as if you want this attribute to be available in any Layout, you would need to add it to the [ConfigName] option in each, where doing it in the skin .ini makes it specific to the skin / variant and nothing else would ever need to be done.

If you are going to be sharing your skins, and want this Group functionality to be a part of things for users who get your skins, I'd be tempted to put the Group option in the skin .ini file, as you have little or no control over how people manage their Layouts.

So which way you go is up to you, depending on how you intend to use the Group functionality.
User avatar
Pul53dr1v3r
Posts: 211
Joined: July 30th, 2014, 10:30 am

Re: Working with InputText

Pul53dr1v3r » May 16th, 2019, 2:24 pm

jsmorley wrote:
May 16th, 2019, 1:38 pm
i put it in the skins as a group because it will be widely shared and that way it does the job well. It also looks like a more familiar option to me. Firstly i wanted to cut short writing all the skin names in every refresh function. It would also be bringing a headache if one would change a skin's name etc.
Thanks for the thorough explanation of that!
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3543
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Working with InputText

eclectic-tech » May 16th, 2019, 4:48 pm

Just wanted to add the approach I have been using which groups all skins I create, and for any suite of skins, to a unique group.

I add the a line by default to the [Rainmeter] whenever I start to create a new skin.

Code: Select all

[Rainmeter]
Group=#RootConfig#
...
Becaue #RootConfig# is a unique name, using Group=#RootConfig# will add the current skin to a group of skins with the name of the Root Skin Folder where the skin is located.

This has several benefits, the main one being able to control every skin in your suite of skins specifically when you need to refresh all of them, but do not want to refresh every skin an end user has loaded, the way !RefreshApp would do.

Also, if the end user wants to change the Root Skin folder name, all of the skins will still be associated with that "new skin folder name" group.

Hopefully others may find this a useful technique.
User avatar
balala
Rainmeter Sage
Posts: 8630
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Working with InputText

balala » May 16th, 2019, 5:36 pm

eclectic-tech wrote:
May 16th, 2019, 4:48 pm
Hopefully others may find this a useful technique.
For sure. This is a damn good idea. Thanks for sharing it. Definitely will use it. :thumbup: :thumbup: :thumbup:
User avatar
Pul53dr1v3r
Posts: 211
Joined: July 30th, 2014, 10:30 am

Re: Working with InputText

Pul53dr1v3r » May 16th, 2019, 8:23 pm

eclectic-tech wrote:
May 16th, 2019, 4:48 pm
this encourages me to post "noobish" questions now and then.

Applied ur approach and there isn't care about the folder and subfolder names anymore.

:cake: