It is currently April 27th, 2024, 11:49 am

Help with MouseLeaveAction

Get help with creating, editing & fixing problems with skins
shahrukh1337
Posts: 3
Joined: December 16th, 2011, 6:31 am

Help with MouseLeaveAction

Post by shahrukh1337 »

I have it so where I go over a button is pops up a menu and then when I leave the menu it closes. I want it so it detects if the cursor is outside the dock is self and not on the menu and then closes the menu. Is there a command which can do this?

Ex. MouseLeaveAction=!Execute if [Menu or Background] [!RainmeterHideMeter Menu]

Thanks for the help!
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Help with MouseLeaveAction

Post by MerlinTheRed »

You could perhaps achieve this by adding that MouseLeaveAction to the dock rather than the menu. That way when you leave the menu itself, nothing will happen, but when you leave the dock, the menu closes. This could result in weird behavior in some cases though.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
shahrukh1337
Posts: 3
Joined: December 16th, 2011, 6:31 am

Re: Help with MouseLeaveAction

Post by shahrukh1337 »

MerlinTheRed wrote:You could perhaps achieve this by adding that MouseLeaveAction to the dock rather than the menu. That way when you leave the menu itself, nothing will happen, but when you leave the dock, the menu closes. This could result in weird behavior in some cases though.
My menu is outside the dock. Please help.
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Help with MouseLeaveAction

Post by Mordasius »

I think you had better post the complete code for the skin you are working with.
shahrukh1337
Posts: 3
Joined: December 16th, 2011, 6:31 am

Re: Help with MouseLeaveAction

Post by shahrukh1337 »

Code: Select all

;Mangotsfield
;Rainmeter configuration file
[Rainmeter]
Author=hubert
Contact=spike0887@hotmail.com

[Rainmeter]
Update=50

[Metadata]
Name=
Config=
Description=
Instructions=
Version=
Tags=
License=
Variant=
[Rainmeter]
Update=1000

-----------------------------------------------------------------------------------------------------

[Variables]

[BG]
Meter=IMAGE
ImageName=#SKINSPATH#Mangotsfield/Images/dock.png

[Shortcut1]
Meter=IMAGE
ImageName=vb_dock.png
X=24
Y=15
LeftMouseDownAction=!Execute ["C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe"]

[Shortcut3]
Meter=IMAGE
ImageName=down_dock.png
X=150
Y=12
LeftMouseDownAction=!Execute [C:\Users\Shahrukh\Downloads\standalonestack2\StandaloneStack2.exe "Downloads"]

-----------------------------------------------------------------------------------------------------


[BGcom]
Meter=IMAGE
ImageName=adobe_dock.png
X=84
Y=15
H=32
W=32
MouseOverAction=!Execute [!RainmeterHideMeter BGcom][!RainmeterShowMeter BGcom1][!RainmeterShowMeter 

Backcom2][!RainmeterShowMeter TextC4][!RainmeterShowMeter Button1][!RainmeterShowMeter Button2][!

RainmeterShowMeter Button3][!RainmeterShowMeter Text][!RainmeterRedraw]

[BGcom1]
Meter=IMAGE
imageName=adobe_dock.png
X=84
Y=13
H=30
W=30
Hidden=1
LeftMouseDownAction=!Execute [!RainmeterHideMeter BGcom1][!RainmeterShowMeter BGcom][!RainmeterHideMeter 

Backcom2][!RainmeterHideMeter TextC4][!RainmeterHideMeter Button1][!RainmeterHideMeter Button2][!

RainmeterHideMeter Button3][!RainmeterHideMeter Text][!RainmeterRedraw]

[Backcom2]
Meter=IMAGE
imageName=square.png
X=48
Y=48
Hidden=1
MouseLeaveAction=!Execute [!RainmeterShowMeter BGcom][!RainmeterHideMeter BGcom1][!RainmeterHideMeter 

Backcom2][!RainmeterHideMeter TextC4][!RainmeterHideMeter Button1][!RainmeterHideMeter Button2][!

RainmeterHideMeter Button3][!RainmeterHideMeter Text][!RainmeterRedraw]

[Hover1]
Meter=IMAGE
ImageName=hover.png
X=48
Y=64
Hidden=1

[Hover2]
Meter=IMAGE
ImageName=hover.png
X=48
Y=79
Hidden=1

[Hover3]
Meter=IMAGE
ImageName=hover.png
X=48
Y=94
Hidden=1
-------------------------------------------------------------------------------------

[Button1]
Meter=STRING
Text=Photoshop
x=60
y=62
FontSize=10
FontFace=Calibri
antialias=1
Hidden=1
LeftMouseDownAction=!Execute ["WRITE THE PATH"]
MouseOverAction=!Execute [!RainmeterShowMeter Hover1]
MouseLeaveAction=!Execute [!RainmeterHideMeter Hover1]

[Button2]
Meter=STRING
Text=Illustrator
x=r
y=15r
FontSize=10
FontFace=Calibri
antialias=1
Hidden=1
LeftMouseDownAction=!Execute ["WRITE THE PATH"]
MouseOverAction=!Execute [!RainmeterShowMeter Hover2]
MouseLeaveAction=!Execute [!RainmeterHideMeter Hover2]

[Button3]
Meter=STRING
Text=Dreamweaver
x=r
y=15r
FontSize=10
FontFace=Calibri
antialias=1
Hidden=1
LeftMouseDownAction=!Execute ["WRITE THE PATH"]
MouseOverAction=!Execute [!RainmeterShowMeter Hover3]
MouseLeaveAction=!Execute [!RainmeterHideMeter Hover3]

[Text]
Meter=STRING
Text=Creative Suit
x=64
y=114
FontSize=10
FontFace=Calibri
antialias=1
Hidden=1

User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Help with MouseLeaveAction

Post by smurfier »

After looking at your code, and simplifying it a bit, I believe this is what you are looking for. Note the use of MeterStyles, Groups, and the !HideMeterGroup bang.

Code: Select all

;Mangotsfield
;Rainmeter configuration file
[Rainmeter]
Author=hubert|spike0887@hotmail.com
Update=1000

[Metadata]
Name=
Description=
Instructions=
Version=
License=

;-----------------------------------------------------------------------------------------------------
[MenuAllStyle]
Group=MenuAll
MouseLeaveAction=!HideMeterGroup MenuAll
MouseOverAction=!ShowMeterGroup Menu

[MenuStyle]
Group=Menu

[BG]
Meter=IMAGE
ImageName=#SKINSPATH#Mangotsfield/Images/dock.png

[Shortcut1]
Meter=IMAGE
ImageName=vb_dock.png
X=24
Y=15
LeftMouseDownAction=!Execute ["C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe"]

[Shortcut3]
Meter=IMAGE
ImageName=down_dock.png
X=150
Y=12
LeftMouseDownAction=!Execute [C:\Users\Shahrukh\Downloads\standalonestack2\StandaloneStack2.exe "Downloads"]

;-----------------------------------------------------------------------------------------------------

[BGcom]
Meter=IMAGE
ImageName=adobe_dock.png
X=84
Y=15
H=32
W=32
MouseOverAction=!Execute [!HideMeter BGcom][!ShowMeter BGcom1][!ShowMeter Backcom2][!ShowMeter TextC4][!ShowMeter Button1][!ShowMeter Button2][!ShowMeter Button3][!ShowMeter Text][!Redraw]

[BGcom1]
Meter=IMAGE
imageName=adobe_dock.png
X=84
Y=13
H=30
W=30
Hidden=1
LeftMouseDownAction=!Execute [!HideMeter BGcom1][!ShowMeter BGcom][!HideMeter Backcom2][!HideMeter TextC4][!HideMeter Button1][!HideMeter Button2][!HideMeter Button3][!HideMeter Text][!Redraw]

[Backcom2]
Meter=IMAGE
imageName=square.png
X=48
Y=48
Hidden=1
MouseLeaveAction=!Execute [!ShowMeter BGcom][!HideMeter BGcom1][!HideMeter Backcom2][!HideMeter TextC4][!HideMeter Button1][!HideMeter Button2][!HideMeter Button3][!HideMeter Text][!Redraw]

[Hover1]
Meter=IMAGE
MeterStyle=MenuAllStyle
ImageName=hover.png
X=48
Y=64
Hidden=1

[Hover2]
Meter=IMAGE
MeterStyle=Hover1|MenuAllStyle
X=48
Y=79

[Hover3]
Meter=IMAGE
MeterStyle=Hover1|MenuAllStyle
X=48
Y=94
;-------------------------------------------------------------------------------------

[ButtonStyle]
x=r
y=15r
FontSize=10
FontFace=Calibri
antialias=1
Hidden=1

[Button1]
Meter=STRING
MeterStyle=ButtonStyle|MenuAllStyle|MenuStyle
Text=Photoshop
x=60
y=62
LeftMouseDownAction=!Execute ["WRITE THE PATH"]
MouseOverAction=!ShowMeter Hover1
MouseLeaveAction=!HideMeter Hover1

[Button2]
Meter=STRING
MeterStyle=ButtonStyle|MenuAllStyle|MenuStyle
Text=Illustrator
LeftMouseDownAction=!Execute ["WRITE THE PATH"]
MouseOverAction=!ShowMeter Hover2
MouseLeaveAction=!HideMeter Hover2

[Button3]
Meter=STRING
MeterStyle=ButtonStyle|MenuAllStyle|MenuStyle
Text=Dreamweaver
LeftMouseDownAction=!Execute ["WRITE THE PATH"]
MouseOverAction=!ShowMeter Hover3
MouseLeaveAction=!HideMeter Hover3

[Text]
Meter=STRING
Text=Creative Suit
x=64
y=114
FontSize=10
FontFace=Calibri
antialias=1
Hidden=1
Group=Menu
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .