It is currently March 28th, 2024, 7:20 pm

Working with InputText

Our most popular Tips and Tricks from the Rainmeter Team and others
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Working with InputText

Post by fonpaolo »

While I was sure you know it, I prefer to not give anything for granted. ;-)
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: Working with InputText

Post by rbriddickk84 »

fonpaolo wrote:While I was sure you know it, I prefer to not give anything for granted. ;-)
Yes, yes! :D And i appretiate it! :)
You never know, when you will realise some obvious thing, what you missed, and you took granted. :) :thumbup:

But yeah, i write in here, when i am absolutely clueless, and checked my things over and over thousand time. :) (even that i miss some obvious, basic things sometime :D ). Also i'm not a pro titled forumer here :) but i am working with Rainmeter more than 3 years now. I can focus really on one thing at a time to be good at, and i choose Rainmeter, but i would gladly help in here too. :D
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Working with InputText

Post by jsmorley »

rbriddickk84 wrote:i'm not a pro titled forumer here :) but i am working with Rainmeter more than 3 years now. I can focus really on one thing at a time to be good at, and i choose Rainmeter, but i would gladly help in here too. :D
Raise your right hand and repeat after me...
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: Working with InputText

Post by rbriddickk84 »

jsmorley wrote:Raise your right hand and repeat after me...
:great: (<- right hand raised...sort of :) )

OnCheckAction=[PlayLoop "rbriddickk84_oath.wav"] (<- repeat section :D )
J-Mo
Posts: 3
Joined: February 13th, 2019, 8:18 pm

Re: Working with InputText

Post by J-Mo »

Hello,

I'm working on a countdown timer that starts from a date/time input by the user rather than starting from the current time.
When I enter a time string such as "10:00", I get a popup that indicates windows is attempting to open an unknown file type. But when I enter a date (mm/dd/yy) or just a number, the popup doesn't happen. Any idea what's going on?


Here's the popup:
Capture.png

And here's some code:

Code: Select all

[MeterSetTimeLabel]
Meter=String
FontFace=System
FontSize=12
FontColor=255,255,100,255
Text="Chamber Start Time"
x=150
y=5
Hidden=1
Group=SetTimer

[MeterSetTimeValue]
Meter=String
FontFace=System
FontSize=12
FontColor=255,255,100,255
Text=hh:mm
x=150
y=25
Hidden=1
Group=SetTimer
LeftMouseUpAction= [!HideMeter MeterSetTimeValue][!CommandMeasure MeasureTimeInput "ExecuteBatch 1"]

[MeasureTimeInput]
Measure=Plugin
Plugin=InputText
x=150
y=45
SolidColor=200,200,200,200
StringAlign=CenterCenter
W=100
H=50
FontFace=System
FontSize=18
FontColor=0,0,0,255
AntiAlias=1
Hidden=1
Command1=["$UserInput$"][!ShowMeter MeterTimeInput]

[MeterTimeInput]
Meter=string
FontFace=System
FontSize=12
FontColor=255,255,100,255
MeasureName=MeasureTimeInput
x=150
y=25
Hidden=1
Group=Values
LeftMouseUpAction= [!HideMeter MeterTimeInput][!CommandMeasure MeasureTimeInput "ExecuteBatch 1"]
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Working with InputText

Post by balala »

J-Mo wrote: February 22nd, 2019, 9:56 pm When I enter a time string such as "10:00", I get a popup that indicates windows is attempting to open an unknown file type. But when I enter a date (mm/dd/yy) or just a number, the popup doesn't happen. Any idea what's going on?
Not exactly sure, but even if you enter a time, if you enter one with one single digit before the colon, this isn't going on, but if you're using two digits, it does.
However, there is a small mistake in the Command1 option of the [MeasureTimeInput] measure. Usually you don't have to execute what you've entered through the InputText plugin. In most cases you have to assign it / write it as a variable. Not having the whole code (because I think this isn't the whole code, probably there are some not posted parts of it), it is hard to tell what you should have to do, but probably something like: Command1=[!ShowMeter MeterTimeInput][!SetVariable SomeVariable "$UserInput$"], or Command1=[!ShowMeter MeterTimeInput][!WriteKeyValue Variables SomeVariable "$UserInput$"].
So, what's your intention with the entered value, how do you want to use it?
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: Working with InputText

Post by pul53dr1v3r »

is there a way to, when for instance InputLimit=4 keep a dot "." after first digit (example: "2.00") so the max possible number to enter is 9.99 and in that way to prevent input of higher ones than 9.99?
Once, by mistake i entered 1111 for the skin scale instead of 1.11 and almost faced with system restore/reinstall/repair only using Windos 10 CD. Neither the safe mode,taskmgr, opening any program-document was possible. Most of the graphics went off.
So this would be a very safety useful solution.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Working with InputText

Post by balala »

Pul53dr1v3r wrote: May 14th, 2019, 6:41 pm is there a way to, when for instance InputLimit=4 keep a dot "." after first digit (example: "2.00") so the max possible number to enter is 9.99 and in that way to prevent input of higher ones than 9.99?
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).
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: Working with InputText

Post by pul53dr1v3r »

balala wrote: May 14th, 2019, 7:08 pm

Pretty good alternative. :great:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Working with InputText

Post by balala »

Pul53dr1v3r wrote: May 14th, 2019, 7:33 pm Pretty good alternative. :great:
Yep, I think. :thumbup: