It is currently May 2nd, 2024, 1:27 am

Need help coding mouse-over 'drop down' menu.

Get help with creating, editing & fixing problems with skins
TenchiRyokoMuyo
Posts: 5
Joined: September 14th, 2012, 4:23 am

Need help coding mouse-over 'drop down' menu.

Post by TenchiRyokoMuyo »

Hi there, just installed Rainmeter last night, and I've been tinkering around with it a lot. I've got a decent set of Skins going, and I know a little lua, but not enough for any advanced coding. I want to make it so that my skin when I mouse-over a button, brings a menu out to the side, with sub-options, for example, I want it so that when I mouse over my games button, several options appear with links to my Steam games.

If a mouse-over option is too difficult to code, clicking to make the menu appear is acceptable. I have another part of the skin, that does something similar, that I tried to reverse engineer, but my knowledge of lua is not advanced enough to do so.

http://pastebin.com/3JkQ7CV9

Don't worry about image or background colors, I can handle that much, but if someone would be kind enough to show me how to code this, I would be able to understand how to do it in the future.
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: Need help coding mouse-over 'drop down' menu.

Post by UnforgivenRevival »

You should take a look at this program. Its called StandaloneStack. You could just use MouseOverAction=["PathToCustomStack"], to open. The better way would be with a click. LeftMouseUpAction=["PathToCustomStack"]

EDIT: With StandaloneStack, It seems the "fan view" can only be opened if you put it on the bottom of the screen. The "grid view" however, will open in any direction you want it.

If your wanting to do this with your own custom Rainmeter skin, Its a bit more complicated, But very do-able. You wouldnt need any sort of .lua to do it.
TenchiRyokoMuyo
Posts: 5
Joined: September 14th, 2012, 4:23 am

Re: Need help coding mouse-over 'drop down' menu.

Post by TenchiRyokoMuyo »

UnforgivenRevival wrote:You should take a look at this program. Its called StandaloneStack. You could just use MouseOverAction=["PathToCustomStack"], to open. The better way would be with a click. LeftMouseUpAction=["PathToCustomStack"]

EDIT: With StandaloneStack, It seems the "fan view" can only be opened if you put it on the bottom of the screen. The "grid view" however, will open in any direction you want it.

If your wanting to do this with your own custom Rainmeter skin, Its a bit more complicated, But very do-able. You wouldnt need any sort of .lua to do it.
The same skin pack has an icon on the side, for live-streaming music, that does what I'm looking for, without a program. I just don't understand enough of the programming to understand how they did it yet.
http://pastebin.com/fKTiiA1n <---- This is the live streaming .ini
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: Need help coding mouse-over 'drop down' menu.

Post by UnforgivenRevival »

To do this in Rainmeter, You will need to read up on hiding/showing meter groups.

A basic skin would be something like this:

Code: Select all


[Rainmeter]


[Variables]


[DockImage1]
Meter=Image
ImageName=#@#DockImage1.png
x=5
y=0
LeftMouseActionUp=[!ShowMeterGroup Dock1]

[SubDock1Background]
Meter=Image
ImageName=#@#SubDock1.png
x=10
y=0
Hidden=1
Group=Dock1

[SubDock1Image1]
Meter=Image
ImageName=#@#SubDock1Image1.png
x=5
y=5
LeftMouseActionUp=["PathToProgram"][!HideMeterGroup Dock1]
Group=Dock1
Hidden=1

[DockImage2]
Meter=Image
Imagename=#@#DockImage2.png
x=10
y=0

[SubDock1Image2]
Meter=Image
ImageName=#@#SubDock1Image2.png
x=5
y=10
LeftMouseActionUp=["PathToProgram"][!HideMeterGroup Dock1]
Group=Dock1
Hidden=1

[DockImage2]
Meter=Image
ImageName=#@#DockImage2.png
x=5
y=0
LeftMouseActionUp=[!ShowMeterGroup Dock2]

[SubDock2Background]
Meter=Image
ImageName=#@#SubDock2.png
x=10
y=0
Hidden=1
Group=Dock2

[SubDock2Image1]
Meter=Image
ImageName=#@#SubDock2Image1.png
x=10
y=5
LeftMouseActionUp=["PathToProgram"][!HideMeterGroup Dock2]
Group=Dock2
Hidden=1

[SubDock2Image2]
Meter=Image
ImageName=#@#SubDock2Image2.png
x=10
y=10
LeftMouseActionUp=["PathToProgram"][!HideMeterGroup Dock2]
Group=Dock2
Hidden=1





Notice that the "SubDock Images" are hidden? That tells Rainmeter to hide them Images when the skin is first loaded. Clicking on one of the dock images with the bang "[!ShowMeterGroup "Group"]" will show the meter group that is linked to that dock Icon. Its all a matter of linking the correct groups to the images. You have to make sure you use the bang to hide meter groups after, Or they will stay open with no way to close them.

EDIT: I forgot about !ToggleGroup. You can simply use that under the "Dock Images" to toggle the groups between hidden and shown. [!ToggleGroup Dock1], For example.

EDIT2: To do this properly with the mouse hovering, Like you requested, For each and every Dock Image you would have to do this instead of LeftMouseUpAction :

Code: Select all

MouseOverAction=[!ShowGroup Dock1]
MouseLeaveAction=[!HideGroup Dock1]

TenchiRyokoMuyo
Posts: 5
Joined: September 14th, 2012, 4:23 am

Re: Need help coding mouse-over 'drop down' menu.

Post by TenchiRyokoMuyo »

Okay, so, DockImage1, is my main icon, that would be labeled 'Games'...

Subdock1, would be a specific game, for example, Minecraft. Subdock2, would be a specific game, for example, Civilization V.

I would create DockImage1, and on left click, show subdock 1 and 2. Then when subdock 1, or 2, is clicked, it hides subdock 1, and 2, then executes the .exe of that game.

But let's say I click the 'games' dockimage by accident...how do I make the button check to see whether or not subdock 1 and 2 are showing already? I would need a boolean value that turns on/off, but what type of commands would I use for that?
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: Need help coding mouse-over 'drop down' menu.

Post by UnforgivenRevival »

TenchiRyokoMuyo wrote:Okay, so, DockImage1, is my main icon, that would be labeled 'Games'...

Subdock1, would be a specific game, for example, Minecraft. Subdock2, would be a specific game, for example, Civilization V.

I would create DockImage1, and on left click, show subdock 1 and 2. Then when subdock 1, or 2, is clicked, it hides subdock 1, and 2, then executes the .exe of that game.

But let's say I click the 'games' dockimage by accident...how do I make the button check to see whether or not subdock 1 and 2 are showing already? I would need a boolean value that turns on/off, but what type of commands would I use for that?

There would be no way of telling if the "Subdock" would be open already or not. You would simply just have to reclick the icon.

EDIT TO MY LAST POST: Doing this with hover actions would actually be a little more trickier than doing it the way I stated. You may have to rely on clicking the main dock Icon.
TenchiRyokoMuyo
Posts: 5
Joined: September 14th, 2012, 4:23 am

Re: Need help coding mouse-over 'drop down' menu.

Post by TenchiRyokoMuyo »

Alright, but, I mean, if I accidentally click it, the only way to make it hide again, is by executing a program. Maybe I could make a final subdock that is 'close'... The stream icon I had as the second pastebin though, it somehow detects it. It knows that it's open, and closes it when you click the maindock again.
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: Need help coding mouse-over 'drop down' menu.

Post by UnforgivenRevival »

TenchiRyokoMuyo wrote:Alright, but, I mean, if I accidentally click it, the only way to make it hide again, is by executing a program. Maybe I could make a final subdock that is 'close'... The stream icon I had as the second pastebin though, it somehow detects it. It knows that it's open, and closes it when you click the maindock again.

You could use the [!toggleGroup Dock1] bang I edited in one of my posts, For the main dock Icon. That way you can click it to hide AND show the subdock. You could also create a "Close button", If you preferred. Just use all [!HideMeterGroup "Group"] bangs for close.

I am unsure how that skin works, So I cannot help with the "checking to see if subdock is open" part of it all. This is a good start to learn and you can always go back and intertwine it to this when you learn about how that works.
TenchiRyokoMuyo
Posts: 5
Joined: September 14th, 2012, 4:23 am

Re: Need help coding mouse-over 'drop down' menu.

Post by TenchiRyokoMuyo »

Alright, thank you so much for the help! I think with this, I can start coding it tomorrow, I think the toggle is what they did most likely. Thanks again!
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: Need help coding mouse-over 'drop down' menu.

Post by UnforgivenRevival »

No problem. If you have any other questions, We are here to help!