It is currently April 19th, 2024, 6:53 am

TEXT SKIN, want to change text with a popup rectangle/box instead of going into ini file to edit just to change name

Get help with creating, editing & fixing problems with skins
aihehe
Posts: 7
Joined: May 5th, 2017, 11:46 pm

TEXT SKIN, want to change text with a popup rectangle/box instead of going into ini file to edit just to change name

Post by aihehe »

hey guys, I'm having trouble doing something I believe can be solved really easily. So I just want my name displayed, that simple(text skin). Now instead of me going in to change it by going to edit/ini file I've tried to create an input place that popups a box for me to put in whatever text i want the skin to display. This is what I got but don't know how to associate it to the Postfix...can someone please assist me with this. I don't even know if I need a plugin or if that is even the correct one. Please help!!!
Kind regards in advance
Been working on this for a couple of hrs now and still cant work it out.

If you have a suggestion of achieving what I'm trying to do, I will appreciate your advice.

Code: Select all

[Name]
Meter=STRING
FontColor=#FontColor#
StringStyle=bold
FontSize=40
FontFace=Beastform 
Antialias=0
Postfix="insert txt here"

[Plug1]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName=#1#
FileFilter=#fFilter#
Subfolders=#subF#

[Comm1]
Meter=STRING
Meterstyle=comstyle
;Text="3G"
w=130
h=80
SolidColor=0,0,0,1
LeftMouseUpAction=!CommandMeasure Input1 "ExecuteBatch 1"
ToolTipText=Input Text


[Input1]
Measure=Plugin
Plugin=InputText.dll
SolidColor=255,255,255,255
W=100
H=40
X=110
Y=250
Command1=!Execute [!WriteKeyValue Variables 1 "$UserInput$" "#CURRENTPATH#Name.ini"] [!Refresh "#CURRENTCONFIG#"] DefaultValue="#1#"
FocusDismiss=1
Last edited by Brian on May 6th, 2017, 2:21 am, edited 1 time in total.
Reason: Please use [code] tags.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: TEXT SKIN, want to change text with a popup rectangle/box instead of going into ini file to edit just to change name

Post by eclectic-tech »

You do not need [Plug1] to use the Quote plugin to get user info.
I would activate the user input measure with a bang in the [Name] meter; you do not need a separate [Com1] meter.
You do not need to specify the file if !WriteKeyValue is writing to the active config.
I would add !SetVariable to the Command1 along with a meter update and redraw; this is better than a full skin refresh.
The !WriteKeyValue bang will permanently change the variable value so the new value will show if the skin is unloaded/re-loaded.
The !SetVariable bang will change the variable in the active code, and adding DynamicVariables=1 to the [Name] meter will allow it to update.

Code: Select all

[Variables]
1=input your text here...

[Name]
Meter=STRING
FontColor=#FontColor#
StringStyle=bold
FontSize=40
FontFace=Beastform
Antialias=0
Text=#1#
LeftMouseUpAction=!CommandMeasure Input1 "ExecuteBatch 1"
DynamicVariables=1
SolidColor=0,0,0,1

[Input1]
Measure=Plugin
Plugin=InputText.dll
SolidColor=255,255,255,255
W=100
H=80
X=110
Y=250
Command1=[!WriteKeyValue Variables 1 "$UserInput$"][!SetVariable 1 "[Input1]"][!UpdateMeter *][!Redraw] DefaultValue="#1#"
FocusDismiss=1

aihehe
Posts: 7
Joined: May 5th, 2017, 11:46 pm

Re: TEXT SKIN, want to change text with a popup rectangle/box instead of going into ini file to edit just to change name

Post by aihehe »

Thank you for the reply.

I don't know if it's just me but I copied and pasted your recommendation but it doesn't do anything when I click on it.
Am I missing something?

I'm left clicking on it and it's suppose to pop up a input text box in order for me to change the content correct?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: TEXT SKIN, want to change text with a popup rectangle/box instead of going into ini file to edit just to change name

Post by eclectic-tech »

aihehe wrote:Thank you for the reply.

I don't know if it's just me but I copied and pasted your recommendation but it doesn't do anything when I click on it.
Am I missing something?

I'm left clicking on it and it's suppose to pop up a input text box in order for me to change the content correct?
The code works, but I have some questions about what you are trying to achieve.

Do you want the result to be "Jimmy, input text here"? Where "'Jimmy' will be the "$UserInput$". Or do you want to replace "insert text here" with the "$UserInput$"? The posted code replaces "insert text here" with the "$UserInput$".

Are you saving the $UserInput$ in the same skin or in an included variables file; if an include file, what is the name and where is it saved?

Here's another version that writes the $UserInput$ to variable 0 in 'Name.inc" located in the @Resources folder of the skin.
Replaces "User" with the "$UserInput$".

Name.ini

Code: Select all

[Variables]
@include="#@#name.inc"

[Name]
Meter=STRING
FontColor=#FontColor#
StringStyle=bold
FontSize=40
FontFace=Beastform
Antialias=0
Text="#0#"
PostFix="#1#"
LeftMouseUpAction=!CommandMeasure Input1 "ExecuteBatch 1"
DynamicVariables=1
SolidColor=0,0,0,1

[Input1]
Measure=Plugin
Plugin=InputText.dll
SolidColor=255,255,255,255
W=100
H=80
X=110
Y=250
Command1=[!WriteKeyValue Variables 0 "$UserInput$" "#@#name.inc"][!SetVariable 0 "[Input1]"][!UpdateMeter *][!Redraw] DefaultValue="#0#"
FocusDismiss=1
@Resources\Name.inc

Code: Select all

[Variables]
0=User
1=, input text here
Both do the same thing, the only difference is where the variables are saved.
aihehe
Posts: 7
Joined: May 5th, 2017, 11:46 pm

Re: TEXT SKIN, want to change text with a popup rectangle/box instead of going into ini file to edit just to change name

Post by aihehe »

You my friend are a good guy, appreciate the patience.

So the idea is like this, text on the desktop, left click on it(the text) and it opens a input box and you can change the text to whatever and it just changes the text.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: TEXT SKIN, want to change text with a popup rectangle/box instead of going into ini file to edit just to change name

Post by eclectic-tech »

aihehe wrote:You my friend are a good guy, appreciate the patience.

So the idea is like this, text on the desktop, left click on it(the text) and it opens a input box and you can change the text to whatever and it just changes the text.
The first code I posted will do that (above post), if you are saving the variable in the same skin.

My second post will do it, if you save the variable in an included file.

Your initial code had a second string meter [Com1] at the same location as the [Name] text...
make sure nothing is interfering with the mouse action on the [Name] section and it should work for you. :x

Beyond that, I do not know why it didn't work, it is a straight forward simple code (only 2 sections)... :welcome: