It is currently May 4th, 2024, 1:59 am

Popup menues for Rainmeter

Share and get help with Plugins and Addons
bek88
Posts: 38
Joined: August 26th, 2009, 8:41 am

Popup menues for Rainmeter

Post by bek88 »

With the following addon (only 84k or 100k(64 bit)) you can have nice popup menues incl. nice configuration for rainmeter.
See: http://www.horstmuc.de/wpop.htm
The menu can be positioned exactly with x and y coordinates.
Popup menu 1.png
Menu can be called from skin with e.g.:

LeftMouseUpAction=["#@#PopSel\PopSel.exe" /N /P[MeterEditor:X],[MeterEditor:Y] "#@#PopSel\Editor.lst" "#PROGRAMPATH#"

Here the addon Popsel is placed in the @Resources folder.
/N means: no configuration Button
/P... : left upper edge of popup menu
"#@#PopSel\Editor.lst": menu configuration file

Also as a special parameter e.g. the path of rainmeter.exe can be passed to the program.
So you can create special rainmeter menu entries:
Popup menu 2.png
Here the popup variable %file% will be replaced with "#PROGRAMPATH#".
Also the menu is with stylish icons (use additional parameter /IS):
Popup menu 3.png
Menues without parameter /IS are only textmenues, but appear much faster.
You do not have the required permissions to view the files attached to this post.
amc242
Posts: 25
Joined: July 12th, 2012, 2:02 pm

Re: Popup menues for Rainmeter

Post by amc242 »

bek88
You write in help file for PopSel that:

Code: Select all

/Px,y menu position in pixel coordinates, for example /p800,200
So can I set parameter for position to make menu attached to skin's icon (so I can move icon or any Meter with proper "LeftMouseUpAction=" and menu will change it position automatically) or I must new set position for every time I want to move skin and it's popup menu?
bek88
Posts: 38
Joined: August 26th, 2009, 8:41 am

Re: Popup menues for Rainmeter

Post by bek88 »

to amc242
you can code the x and y coordinates as variables:
e.g.: /P[Meter1:X],[Meter1:Y] or
/P[Meter1:X],[Measure1:] (here you can compute dynamically the y coordinate in a separate measure.
If you use variables, add "DynamicVariables=1" for the meter!
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Popup menues for Rainmeter

Post by jsmorley »

This is actually pretty nice and a good fit with Rainmeter in a lot of ways.

If you need more power / flexibility than the ContextAction functionality in Rainmeter, this is worth a look.
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Popup menues for Rainmeter

Post by Brian »

bek88 wrote:to amc242
you can code the x and y coordinates as variables:
e.g.: /P[Meter1:X],[Meter1:Y] or
/P[Meter1:X],[Measure1:] (here you can compute dynamically the y coordinate in a separate measure.
If you use variables, add "DynamicVariables=1" for the meter!
I think it would be best to use a combination of #CURRENTCONFIGX# and [Meter:X]. Section variables will give you a position relative to your skins location on the screen. If you want to translate that to actual position you need to add the skins location to the section variable. The reason it works for your example above is because the skin is located in the upper left corner of the screen, so the meter position is the actual position.

So /P[Meter1:X],[Meter1:Y] should really be /P(#CURRENTCONFIGX#+[Meter1:X]),(#CURRENTCONFIGY#+[Meter1:Y])

-Brian
amc242
Posts: 25
Joined: July 12th, 2012, 2:02 pm

Re: Popup menues for Rainmeter

Post by amc242 »

bek88
I'm sorry for being heavy of thought, but I didn't understand some things about command parameters.
bek88 wrote:

Code: Select all

/P[Meter1:X],[Meter1:Y] or /P[Meter1:X],[Measure1:]
When I use these parameters into my skin .ini, menu stick to the upper left corner of desktop.

Code: Select all

LeftMouseUpAction=["#@#PopSel.exe" /N /P[Meter1:10],[Meter1:10] "#@#PopSel.lst"]
"/P[Meter1:10],[Meter1:10]" - not work.
Can you post here correct version of that parameter with numbers, cause I think I made a syntax mistake.
bek88 wrote:/Px,y menu position in pixel coordinates, for example /p800,200
Also, in your example in help file you don't use square brackets.

Also could you give an example of measure that compute a coordinate.
I'm not a programmer at all, but I try to understand some complicated Rainmeter features.
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Popup menues for Rainmeter

Post by Brian »

amc242 wrote:bek88
I'm sorry for being heavy of thought, but I didn't understand some things about command parameters. When I use these parameters into my skin .ini, menu stick to the upper left corner of desktop.

Code: Select all

LeftMouseUpAction=["#@#PopSel.exe" /N /P[Meter1:10],[Meter1:10] "#@#PopSel.lst"]
"/P[Meter1:10],[Meter1:10]" - not work.
Can you post here correct version of that parameter with numbers, cause I think I made a syntax mistake. Also, in your example in help file you don't use square brackets.

Also could you give an example of measure that compute a coordinate.
I'm not a programmer at all, but I try to understand some complicated Rainmeter features.
My previous post explains why Section Variables alone will not work (unless your skin starts in the upper-left hand corner of your screen). You need to include the #CURRENTCONFIGX# and #CURRENTCONFIGY# variables in your calculations.

Also, your syntax for Section Variables is a little off. You simply use [[i]MeterName[/i]:X] and [[i]MeterName[/i]:Y], where MeterName is the section name of the meter you want the menu to display.

So try something like this, only replacing MeterName with the section name of the meter you want the menu to display.

Code: Select all

LeftMouseUpAction=["#@#PopSel.exe" /N /P(#CURRENTCONFIGX#+[MeterName:X]),(#CURRENTCONFIGY#+[MeterName:Y]) "#@#PopSel.lst"]
-Brian
amc242
Posts: 25
Joined: July 12th, 2012, 2:02 pm

Re: Popup menues for Rainmeter

Post by amc242 »

Brian wrote:So try something like this, only replacing MeterName with the section name of the meter you want the menu to display.
Thanks, now I get it. I'm going to read Section Variables' part thoroughly.
amc242
Posts: 25
Joined: July 12th, 2012, 2:02 pm

Re: Popup menues for Rainmeter

Post by amc242 »

I read about Section Variables in manual, found topic Section Variables with examples, and all of these examples work correctly.
Then I made simle example skin with one button and one menu entry.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Meter1]
Meter=Image
ImageName=Foobar.png
X=0
Y=0
W=48
H=48
LeftMouseUpAction=["#@#PopSel.exe" /N /P[Meter1:X],[Meter1:Y] "#@#PopSel.lst"]
DynamicVariables=1
So, neither

Code: Select all

["#@#PopSel.exe" /N /P[Meter1:X],[Meter1:Y] "#@#PopSel.lst"]
nor

Code: Select all

["#@#PopSel.exe" /N /P(#CURRENTCONFIGX#+[MeterName:X]),(#CURRENTCONFIGY#+[MeterName:Y]) "#@#PopSel.lst"]

not work.

But

Code: Select all

["#@#PopSel.exe" /N /P#CURRENTCONFIGX#,#CURRENTCONFIGY# "#@#PopSel.lst"]
work partially - menu will appear only with X coordinates of skin. Y coordinates are ignored.

Update: I tried

Code: Select all

/P1000,50
and it works fine, but

Code: Select all

/P(1000),(50)
or

Code: Select all

/P[1000],[50]
not work. So I think that PopSel doesn't support () and [] in coordinates (and spaces within formula like ([Meter1:X]_+_)) - is it true or I just stupid?

Please help me to find mistake in me code, I really interested in this useful addon.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Popup menues for Rainmeter

Post by eclectic-tech »

It looks like you found the answer: popsel does not accept calculations in the /P parameter.

All you need to do is add calc measures to set the X and Y positions, and add your adjustment values (I used 4 and 26), then reference the calc measures in the launch command.

Add these measures:

Code: Select all

[MenuPosX]
Measure=Calc
Formula=(#CURRENTCONFIGX#+4)

[MenuPosY]
Measure=Calc
Formula=(#CURRENTCONFIGY#+26)
And the launch command to the meter:

Code: Select all

LeftMouseUpAction=["#@#PopSel.exe" /N /P[MenuPosX],[MenuPosY] "#@#PopSel.lst"]
You may need to add DynamicVariables=1 to the measures and meter if the variables you use will change.
This worked for me... hopefully it will for you.