It is currently May 17th, 2024, 5:15 am

confirmation for buttons possible??

Get help with creating, editing & fixing problems with skins
hmmka
Posts: 4
Joined: March 18th, 2010, 1:40 pm

confirmation for buttons possible??

Post by hmmka »

hi

my skins contains a shutodwn, a restart and a standbybutton.
is there any possibility to get a confirmation dialogue before the shutdown/restart/standby is going to be executed??

would help against accidental clicking it ;)



Code: Select all

[MeterShutdown]
Meter=STRING
X=23
Y=71
FontColor=#WhiteColor#
FontSize=#Size2#
FontFace=#Font2#
StringAlign=Left
StringStyle=italic
AntiAlias=1
Postfix="Shutdown"
Hidden=0
MouseOverAction=!Execute [!RainmeterShowMeter MeterShutdownH][!RainmeterRedraw]
MouseLeaveAction=!Execute [!RainmeterHideMeter MeterShutdownH][!RainmeterRedraw]

[MeterShutdownH]
Meter=STRING
X=r
Y=r
FontColor=#TurquoiseColor#
FontSize=#Size2#
FontFace=#Font2#
StringAlign=Left
StringStyle=italic
AntiAlias=1
Postfix="Shutdown"
Hidden=1
MouseLeaveAction=!Execute [!RainmeterHideMeter MeterShutdownH][!RainmeterRedraw]
LeftMouseDownAction=!Execute [#Shutdown#]
User avatar
Dave_W
Posts: 37
Joined: April 20th, 2009, 10:58 am

Re: confirmation for buttons possible??

Post by Dave_W »

There might be a neater way to do it, but the obvious idea to me is instead of having the button execute the shutdown, have it launch another config that is (basically) an "Are you sure?" textbox - if you click THAT then it shuts down. If you wanted to get flash, you could put a button on that meter to click.

So like this:

Code: Select all

[MeterShutdown]
Meter=STRING
X=23
Y=71
FontColor=#WhiteColor#
FontSize=#Size2#
FontFace=#Font2#
StringAlign=Left
StringStyle=italic
AntiAlias=1
Postfix="Shutdown"
Hidden=0
MouseOverAction=!Execute [!RainmeterShowMeter MeterShutdownH][!RainmeterRedraw]
MouseLeaveAction=!Execute [!RainmeterHideMeter MeterShutdownH][!RainmeterRedraw]

[MeterShutdownH]
Meter=STRING
X=r
Y=r
FontColor=#TurquoiseColor#
FontSize=#Size2#
FontFace=#Font2#
StringAlign=Left
StringStyle=italic
AntiAlias=1
Postfix="Shutdown"
Hidden=1
MouseLeaveAction=!Execute [!RainmeterHideMeter MeterShutdownH][!RainmeterRedraw]
LeftMouseDownAction=!Execute [!RainmeterShowMeter MeterShutdownConfirm][!RainmeterRedraw]

[MeterShutdownConfirm]
Meter=STRING
X=r
Y=r
FontColor=#TurquoiseColor#
FontSize=#Size2#
FontFace=#Font2#
StringAlign=Left
StringStyle=italic
AntiAlias=1
Text="Are you sure you want to shut down?"
Solidcolor=0,0,0,2
Hidden=1
RightMouseDoubleClickAction=!Execute [!RainmeterHideMeter MeterShutdownConfirm][!RainmeterRedraw]
LeftMouseDownAction=!Execute [#Shutdown#]
hmmka
Posts: 4
Joined: March 18th, 2010, 1:40 pm

Re: confirmation for buttons possible??

Post by hmmka »

yeah very nice idea!

i'll try to implement this tonight :D
hmmka
Posts: 4
Joined: March 18th, 2010, 1:40 pm

Re: confirmation for buttons possible??

Post by hmmka »

it works very nice now :D

made even one more meter to confirmation:

Code: Select all

[MeterShutdown]
Meter=STRING
X=23
Y=71
FontColor=#WhiteColor#
FontSize=#Size2#
FontFace=#Font2#
StringAlign=Left
StringStyle=italic
AntiAlias=1
Postfix="Shutdown"
Hidden=0
MouseOverAction=!Execute [!RainmeterShowMeter MeterShutdownH][!RainmeterRedraw]
MouseLeaveAction=!Execute [!RainmeterHideMeter MeterShutdownH][!RainmeterRedraw]

[MeterShutdownH]
Meter=STRING
X=r
Y=r
FontColor=#TurquoiseColor#
FontSize=#Size2#
FontFace=#Font2#
StringAlign=Left
StringStyle=italic
AntiAlias=1
Postfix="Shutdown"
Hidden=1
MouseLeaveAction=!Execute [!RainmeterHideMeter MeterShutdownH][!RainmeterRedraw]
LeftMouseDownAction=!Execute [!RainmeterShowMeter MeterShutdownConfirm][!RainmeterHideMeter Metersd][!RainmeterHideMeter Metershutdown][!RainmeterHideMeter Meterrestart][!RainmeterHideMeter Meterstandby][!RainmeterHideMeter Meterrs][!RainmeterHideMeter Metersb][!RainmeterRedraw]


[MeterShutdownConfirm]
Meter=STRING
X=45
Y=30
FontColor=#WhiteColor#
FontSize=#Size4#
FontFace=#Font2#
StringAlign=Left
StringStyle=italic
AntiAlias=1
Text="Are you sure?"
Solidcolor=0,0,0,2
Hidden=1
MouseOverAction=!Execute [!RainmeterShowMeter MeterShutdownConfirm2][!RainmeterRedraw]
MouseLeaveAction=!Execute [!RainmeterHideMeter MeterShutdownConfirm2][!RainmeterRedraw]


[MeterShutdownConfirm2]
Meter=STRING
X=45
Y=30
FontColor=#TurquoiseColor#
FontSize=#Size4#
FontFace=#Font2#
StringAlign=Left
StringStyle=italic
AntiAlias=1
Text="Are you sure?"
Solidcolor=0,0,0,2
Hidden=1
RightMouseDoubleClickAction=!Execute [!RainmeterHideMeter MeterShutdownConfirm][!RainmeterShowMeter MeterSd][!RainmeterShowMeter Meterrs][!RainmeterShowMeter MeterSb][!RainmeterShowMeter Metershutdown][!RainmeterShowMeter Meterrestart][!RainmeterShowMeter Meterstandby][!RainmeterRedraw]
LeftMouseDownAction=!Execute [#Shutdown#]
MouseOverAction=!Execute [!RainmeterShowMeter MeterShutdownConfirm2][!RainmeterRedraw]
MouseLeaveAction=!Execute [!RainmeterHideMeter MeterShutdownConfirm2][!RainmeterRedraw]
User avatar
Dave_W
Posts: 37
Joined: April 20th, 2009, 10:58 am

Re: confirmation for buttons possible??

Post by Dave_W »

Nice, man.

So the idea with the third/fourth meter is that you get a highlight on mouseover, essentially? That's pretty cool.

Glad to help.
hmmka
Posts: 4
Joined: March 18th, 2010, 1:40 pm

Re: confirmation for buttons possible??

Post by hmmka »

Dave_W wrote:Nice, man.

thx :D

Dave_W wrote: So the idea with the third/fourth meter is that you get a highlight on mouseover, essentially? That's pretty cool.

Glad to help.

yep thats all what it is supposed to do.

here are some screenshots (shutdown meter in bottom right corner) :


1. [MeterShutdown]
Image
2. [MeterShutdownH] (makes the mouseover effect for shutdown/restart/standby
Image]

3. [MeterShutdownConfirm] (shows the "are you sure?" question)
Image

4. [MeterShutdownConfirm2] (makes the mouseover effect for the "are you sure?" question
Image