User Input Skin

Tips and Tricks from the Rainmeter Community
User avatar

User Input Skin

December 14th, 2017, 8:00 pm
eclectic-tech
Rainmeter Sage   [2608 posts]

Creating a skin is not all that difficult, but then to create a skin so your end users can set a few variables can be a chore.

Being naturally lazy :D , I decided to take one of my settings skins and use it to create a Easily Modified User Settings skin.

White Text on Black Background

It can be used with any skin to set from 1 to 16 user variables by copying the 'Settings' folder to your skin and setting a few variables. It has 2 column, a few options for text and background colors, and settings descriptions with pre-positioned input boxes.

Skin With 7 Variables
usersettings2.png

The main advantage is not needing to create the end user inputs measure(s) or mess with positioning the input boxes properly.

Instructions are in the skin file, but here is a quick overview of how to use it:
User Settings
Rainmeter Settings skin with ability to write up to 16 variable values to a variables file in your skin. Copy the 'Settings folder to your skin folder. Open that skin and modify the [Variables] section below. Set the path to your variables file. Set the 'NumberOfVariables' (1 to 16); this will size the skin and hide unnecessary items. Then add your setting description (Col..Title), name of your variable (Col..Input), and your 'hashed' variable (Col..Value) in the [Variables] section below.

** NOTES:
The 'Col..Title' describes your variable setting; replaces Setting#.
The 'Col..Input' value MUST be the name of your variable that you want to write.
The 'Col..Value' value MUST be the name of your variable between hash marks #.
Save, and refresh your skin to test.


Black Text on White Background
usersettings1.png

Here is the skin code (or you can download an RMSkin package below)

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#

ContextTitle="Open Variables File"
ContextAction=["#@#Variables.inc"]

; ========= Metadata ==========
[Metadata]
Name=UserInput Settings Skin Sample
Author=Eclectic Tech
Information=Rainmeter Settings skin with ability to write up to 16 variable values to a variables file in your skin. Copy the 'Settings folder to your skin folder. Open that skin and modify the [Variables] section below. Set the path to your variables file. Set the 'NumberOfVariables' (1 to 16); this will size the skin and hide unnecessary items. Then add your setting description (Col..Title), name of your variable (Col..Input), and your 'hashed' variable (Col..Value) in the [Variables] section below.
 
** NOTES:
The 'Col..Title' describes your variable setting; replaces Setting#.
The 'Col..Input' value MUST be the name of your variable that you want to write.
The 'Col..Value' value MUST be the name of your variable between hash marks #.
Save, and refresh your skin to test.
License=Creative Commons Share-Alike NC 4
Version=1.2017.12.14

; ========= Variables ==========
[Variables]
VariablesFileLocation=#@#Variables.inc

; Include your variables file.
@include=#VariablesFileLocation#

NumberOfVariables=7

; 'Col..Title' describes the variable setting
; ** NOTE: 'Col..Input' MUST BE THE NAME OF THE VARIABLE BEING WRITTEN TO THE FILE! **
; ** NOTE: 'Col..Value' MUST BE THE NAME OF THE VARIABLE ENCLOSED IN BETWEEN # MARKS! **

; Left Column
Col1ATitle=Setting1
Col1AInput=Variable1
Col1AValue=#Variable1#
; Right Column
Col2ATitle=Setting2
Col2AInput=Variable2
Col2AValue=#Variable2#
; Left Column
Col1BTitle=Setting3
Col1BInput=Variable3
Col1BValue=#Variable3#
; Right Column
Col2BTitle=Setting4
Col2BInput=Variable4
Col2BValue=#Variable4#
; Left Column
Col1CTitle=Setting5
Col1CInput=Variable5
Col1CValue=#Variable5#
; Right Column
Col2CTitle=Setting6
Col2CInput=Variable6
Col2CValue=#Variable6#
; Left Column
Col1DTitle=Setting7
Col1DInput=Variable7
Col1DValue=#Variable7#
; Right Column
Col2DTitle=Setting8
Col2DInput=Variable8
Col2DValue=#Variable8#
; Left Column
Col1ETitle=Setting9
Col1EInput=Variable9
Col1EValue=#Variable9#
; Right Column
Col2ETitle=Setting10
Col2EInput=Variable10
Col2EValue=#Variable10#
; Left Column
Col1FTitle=Setting11
Col1FInput=Variable11
Col1FValue=#Variable11#
; Right Column
Col2FTitle=Setting12
Col2FInput=Variable12
Col2FValue=#Variable12#
; Left Column
Col1GTitle=Setting13
Col1GInput=Variable13
Col1GValue=#Variable13#
; Right Column
Col2GTitle=Setting14
Col2GInput=Variable14
Col2GValue=#Variable14#
; Left Column
Col1HTitle=Setting15
Col1HInput=Variable15
Col1HValue=#Variable15#
; Right Column
Col2HTitle=Setting16
Col2HInput=Variable16
Col2HValue=#Variable16#

; General skin settings
BackgroundColor=255,255,255
TextColor=0,0,0
; ** NOTE: Changing the 'TextFont' or 'TextSizeS' variables will change the location of user input boxes and will require changing the 'Spacing' variable below or manually editing the 'Y=' values in both [EndUserInputs] sections to properly place user input boxes **
TextFont=ArialBold
TextSizeS=12
; Positioning variables
TitleX1=20
InputX1=240
TitleX2=290
InputX2=495
Spacing=28
NumberOfLines=Ceil(#NumberOfVariables#/2)


; ========= Measures ==========

[EndUserInput1]
Measure=Plugin
Plugin=InputText
X=(#TitleX2#-165)
W=115
H=21
SolidColor=#BackgroundColor#
FontColor=#TextColor#
FontSize=#TextSizeS#
FontFace=#TextFont#
AntiAlias=1
FocusDismiss=1
Command1=[!WriteKeyValue Variables #Col1AInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#][!Refresh #CURRENTCONFIG#] Y=49 DefaultValue="#Col1AValue#" StringAlign=Right
Command2=[!WriteKeyValue Variables #Col1BInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#] Y=(49+#Spacing#) DefaultValue="#Col1BValue#" StringAlign=Right
Command3=[!WriteKeyValue Variables #Col1CInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#] Y=(49+#Spacing#*2) DefaultValue="#Col1CValue#" StringAlign=Right
Command4=[!WriteKeyValue Variables #Col1DInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#] Y=(49+#Spacing#*3) DefaultValue="#Col1DValue#" StringAlign=Right
Command5=[!WriteKeyValue Variables #Col1EInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#] Y=(49+#Spacing#*4) DefaultValue="#Col1EValue#" StringAlign=Right
Command6=[!WriteKeyValue Variables #Col1FInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#] Y=(49+#Spacing#*5) DefaultValue="#Col1FValue#" StringAlign=Right
Command7=[!WriteKeyValue Variables #Col1GInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#] Y=(49+#Spacing#*6) DefaultValue="#Col1GValue#" StringAlign=Right
Command8=[!WriteKeyValue Variables #Col1HInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#] Y=(49+#Spacing#*7) DefaultValue="#Col1HValue#" StringAlign=Right
DynamicVariables=1

[EndUserInput2]
Measure=Plugin
Plugin=InputText
X=(#InputX2#-115)
W=115
H=21
SolidColor=#BackgroundColor#
FontColor=#TextColor#
FontSize=#TextSizeS#
FontFace=#TextFont#
AntiAlias=1
FocusDismiss=1
Command1=[!WriteKeyValue Variables #Col2AInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#] X=(#InputX2#-95) Y=49 W=95 DefaultValue="#Col2AValue#" StringAlign=Right
Command2=[!WriteKeyValue Variables #Col2BInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#] Y=(49+#Spacing#) DefaultValue="#Col2BValue#" StringAlign=Right
Command3=[!WriteKeyValue Variables #Col2CInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#] Y=(49+#Spacing#*2) DefaultValue="#Col2CValue#" StringAlign=Right
Command4=[!WriteKeyValue Variables #Col2DInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#] Y=(49+#Spacing#*3) DefaultValue="#Col2DValue#" StringAlign=Right
Command5=[!WriteKeyValue Variables #Col2EInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#] Y=(49+#Spacing#*4) DefaultValue="#Col2EValue#" StringAlign=Right
Command6=[!WriteKeyValue Variables #Col2FInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#] Y=(49+#Spacing#*5) DefaultValue="#Col2FValue#" StringAlign=Right
Command7=[!WriteKeyValue Variables #Col2GInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#] Y=(49+#Spacing#*6) DefaultValue="#Col2GValue#" StringAlign=Right
Command8=[!WriteKeyValue Variables #Col2HInput# "$UserInput$" "#VariablesFileLocation#"][!RefreshGroup #RootConfig#] Y=(49+#Spacing#*7) DefaultValue="#Col2HValue#" StringAlign=Right
DynamicVariables=1


; ========= Meter Styles ==========

[TextStyleT1]
X=#TitleX1#
Y=8R
InLineSetting=Size | #TextSizeS#
InLineSetting2= Face | #TextFont#
InLineSetting3=Color | #TextColor#
AntiAlias=1
ClipString=1
W=108
H=25

[TextStyleT2]
X=#TitleX2#
Y=r
InLineSetting=Size | #TextSizeS#
InLineSetting2= Face | #TextFont#
InLineSetting3=Color | #TextColor#
AntiAlias=1
H=25

[TextStyleI1]
X=#InputX1#
Y=r
W=115
InLineSetting=Size | #TextSizeS#
InLineSetting2= Face | #TextFont#
InLineSetting3=Color | #TextColor#
AntiAlias=1
StringAlign=Right
DynamicVariables=1

[TextStyleI2]
X=#InputX2#
Y=r
W=105
InLineSetting=Size | #TextSizeS#
InLineSetting2= Face | #TextFont#
InLineSetting3=Color | #TextColor#
AntiAlias=1
StringAlign=Right
DynamicVariables=1

; ========= Meters ==========

[Background]
Meter=Shape
Shape=Rectangle 1,1,520,((#NumberOfLines#*29)+48),8 | StrokeWidth 1 | Fill Color #BackgroundColor#

[Divider]
Meter=Shape
Shape=Line 266,50,266,([Background:H]-10) | StrokeWidth 1 | StrokeColor #TextColor#

[SettingsTitle]
Meter=String
X=260
Y=8
Text="#CurrentConfig#"
StringAlign=Center
InLineSetting=Size | 14
InLineSetting2= Face | #TextFont#
InLineSetting3=Color | #TextColor#
InLineSetting4=Weight | 600
InLineSetting5=Shadow | 1.5 | 1.5 | 3 | C8C8C8
AntiAlias=1

[CloseMe]
Meter=Shape
Shape=Rectangle 500,13,10,10,5 | StrokeWidth 1 | Fill Color 220,220,220
LeftMouseUpAction=[!DeactivateConfig]

[Col1ATitle]
Meter=String
MeterStyle=TextStyleT1
Y=48
Text="#Col1ATitle#"

[Col1AInput]
Meter=String
MeterStyle=TextStyleI1
Text=#Col1AValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput1" "ExecuteBatch 1"]

[Col2ATitle]
Meter=String
MeterStyle=TextStyleT2
Text="#Col2ATitle#"
Hidden=(#NumberOfVariables#<2?)

[Col2AInput]
Meter=String
MeterStyle=TextStyleI2
Text=#Col2AValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput2" "ExecuteBatch 1"]
Hidden=(#NumberOfVariables#<2?)

[Col1BTitle]
Meter=String
MeterStyle=TextStyleT1
Text="#Col1BTitle#"
Hidden=(#NumberOfVariables#<3?)

[Col1BInput]
Meter=String
MeterStyle=TextStyleI1
Text=#Col1BValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput1" "ExecuteBatch 2"]
Hidden=(#NumberOfVariables#<3?)

[Col2BTitle]
Meter=String
MeterStyle=TextStyleT2
Text="#Col2BTitle#"
Hidden=(#NumberOfVariables#<4?)

[Col2BInput]
Meter=String
MeterStyle=TextStyleI2
Text=#Col2BValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput2" "ExecuteBatch 2"]
Hidden=(#NumberOfVariables#<4?)

[Col1CTitle]
Meter=String
MeterStyle=TextStyleT1
Text="#Col1CTitle#"
Hidden=(#NumberOfVariables#<5?)

[Col1CInput]
Meter=String
MeterStyle=TextStyleI1
Text=#Col1CValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput1" "ExecuteBatch 3"]
Hidden=(#NumberOfVariables#<5?)

[Col2CTitle]
Meter=String
MeterStyle=TextStyleT2
Text="#Col2CTitle#"
Hidden=(#NumberOfVariables#<6?)

[Col2CInput]
Meter=String
MeterStyle=TextStyleI2
Text=#Col2CValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput2" "ExecuteBatch 3"]
Hidden=(#NumberOfVariables#<6?)

[Col1DTitle]
Meter=String
MeterStyle=TextStyleT1
Text="#Col1DTitle#"
Hidden=(#NumberOfVariables#<7?)

[Col1DInput]
Meter=String
MeterStyle=TextStyleI1
Text=#Col1DValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput1" "ExecuteBatch 4"]
Hidden=(#NumberOfVariables#<7?)

[Col2DTitle]
Meter=String
MeterStyle=TextStyleT2
Text="#Col2DTitle#"
Hidden=(#NumberOfVariables#<8?)

[Col2DInput]
Meter=String
MeterStyle=TextStyleI2
Text=#Col2DValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput2" "ExecuteBatch 4"]
Hidden=(#NumberOfVariables#<8?)

[Col1ETitle]
Meter=String
MeterStyle=TextStyleT1
W=120
Text="#Col1ETitle#"
Hidden=(#NumberOfVariables#<9?)

[Col1EInput]
Meter=String
MeterStyle=TextStyleI1
Text=#Col1EValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput1" "ExecuteBatch 5"]
Hidden=(#NumberOfVariables#<9?)

[Col2ETitle]
Meter=String
MeterStyle=TextStyleT2
Text="#Col2ETitle#"
Hidden=(#NumberOfVariables#<10?)

[Col2EInput]
Meter=String
MeterStyle=TextStyleI2
Text=#Col2EValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput2" "ExecuteBatch 5"]
Hidden=(#NumberOfVariables#<10?)

[Col1FTitle]
Meter=String
MeterStyle=TextStyleT1
Text="#Col1FTitle#"
Hidden=(#NumberOfVariables#<11?)

[Col1FInput]
Meter=String
MeterStyle=TextStyleI1
Text=#Col1FValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput1" "ExecuteBatch 6"]
Hidden=(#NumberOfVariables#<11?)

[Col2FTitle]
Meter=String
MeterStyle=TextStyleT2
Text="#Col2FTitle#"
Hidden=(#NumberOfVariables#<12?)

[Col2FInput]
Meter=String
MeterStyle=TextStyleI2
Text=#Col2FValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput2" "ExecuteBatch 6"]
Hidden=(#NumberOfVariables#<12?)

[Col1GTitle]
Meter=String
MeterStyle=TextStyleT1
Text="#Col1GTitle#"
Hidden=(#NumberOfVariables#<13?)

[Col1GInput]
Meter=String
MeterStyle=TextStyleI1
Text=#Col1GValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput1" "ExecuteBatch 7"]
Hidden=(#NumberOfVariables#<13?)

[Col2GTitle]
Meter=String
MeterStyle=TextStyleT2
Text="#Col2GTitle#"
Hidden=(#NumberOfVariables#<14?)

[Col2GInput]
Meter=String
MeterStyle=TextStyleI2
Text=#Col2GValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput2" "ExecuteBatch 7"]
Hidden=(#NumberOfVariables#<14?)

[Col1HTitle]
Meter=String
MeterStyle=TextStyleT1
Text="#Col1HTitle#"
Hidden=(#NumberOfVariables#<15?)

[Col1HInput]
Meter=String
MeterStyle=TextStyleI1
Text=#Col1HValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput1" "ExecuteBatch 8"]
Hidden=(#NumberOfVariables#<15?)

[Col2HTitle]
Meter=String
MeterStyle=TextStyleT2
Text="#Col2HTitle#"
Hidden=(#NumberOfVariables#<16?)

[Col2HInput]
Meter=String
MeterStyle=TextStyleI2
Text=#Col2HValue#
LeftMouseUpAction=[!CommandMeasure "EndUserInput2" "ExecuteBatch 8"]
Hidden=(#NumberOfVariables#<16?)


** NOTE: Changing the 'TextFont' or 'TextSizeS' variables will change the location of user input boxes and will require changing the 'Spacing' variable below or manually editing the 'Y=' values in both [EndUserInputs] sections to properly place user input boxes

RMSkin Package will install 'UserSettings' folder with a 'Settings' folder in your skin library.
Attachments
UserSettings_1.2017.12.14.rmskin
(3.46 KiB) Downloaded 19 times
User avatar

Re: User Input Skin

January 22nd, 2018, 10:14 pm
eclectic-tech
Rainmeter Sage   [2608 posts]

As an alternative, I modified the original Configure skin by fediaFedia (nla) and host it on my DA site.
My mod allows re-sizing and a few other options :welcome:

Image

Direct Link: Configure Skin

Return to “Community Tips and Tricks”



Who is online

Users browsing this forum: No registered users and 1 guest