It is currently April 19th, 2024, 8:32 am

Close a text box

Get help with creating, editing & fixing problems with skins
AdamWalker
Posts: 7
Joined: February 27th, 2019, 10:55 am

Close a text box

Post by AdamWalker »

Can i close a text box by click at anywhere outside the box?
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Close a text box

Post by balala »

AdamWalker wrote: April 23rd, 2019, 6:06 am Can i close a text box by click at anywhere outside the box?
Probably by "text box" you mean an InputText plugin measure, which can be used to enter a value to a skin. Am I right?
If I am, you can add an OnDismissAction option to the plugin measure. The bangs added in this option are executed
when an active InputText field is dismissed without hitting Enter to execute the plugin commands.
If you can't figure out what to do or how does a such option work, please post a sample code you have and a description of when and what would you like to do.
AdamWalker
Posts: 7
Joined: February 27th, 2019, 10:55 am

Re: Close a text box

Post by AdamWalker »

I was talking about closing a METER by click outside that meter. So sorry if you got it wrong
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Close a text box

Post by balala »

AdamWalker wrote: April 25th, 2019, 5:25 am I was talking about closing a METER by click outside that meter.
A meter can't be closed. Not sure what you mean by closing it, but I suppose you'd like to hide it instead. Am I right?
AdamWalker
Posts: 7
Joined: February 27th, 2019, 10:55 am

Re: Close a text box

Post by AdamWalker »

Yeah i just want to hide it
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Close a text box

Post by balala »

AdamWalker wrote: April 25th, 2019, 6:58 am Yeah i just want to hide it
Ok, then depends on what you want. There are more possibilities:
  • If want to hide it when you click ON THE SKIN, outside of the meter, add the following LeftMouseUpAction option to the [Rainmeter] section: LeftMouseUpAction=[!HideMeter "MeterToHide"][!Redraw].
  • If on the other hand you'd like to hide it when you click OUTSIDE OF THE SKIN, this also can be done, adding the following option to the same [Rainmeter] section: OnUnfocusAction=[!HideMeter "MeterToHide"][!Redraw].
  • You can add both above options, to get the meter hidden in both cases, when you click the skin or outside of it.
Obviously in all cases, [MeterToHide] is the meter which you want to hide. Use the appropriate name.
AdamWalker
Posts: 7
Joined: February 27th, 2019, 10:55 am

Re: Close a text box

Post by AdamWalker »

The OnUnFocusAction helps me alot! Thanks you!
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Close a text box

Post by balala »

AdamWalker wrote: April 25th, 2019, 3:22 pm The OnUnFocusAction helps me alot! Thanks you!
I'm glad if it did. Just in case you need, here is related help.
And in case you want to show up the hidden meter again when you're focusing onto the skin (eg clicking it), add a similar OnFocusAction option to the same [Rainmeter] section.