It is currently May 24th, 2024, 3:32 am

help for start menu list and submenu

General topics related to Rainmeter.
spcram
Posts: 6
Joined: March 15th, 2023, 4:40 pm

help for start menu list and submenu

Post by spcram »

Hello, just to know if you could direct me to create a menu list and submenu a bit like the skin fallout in very basic so that I learn I can not find in the tutorial

Liste 1 clic open and close
Text1=
LeftMouseUpAction1=
Text2=
LeftMouseUpAction2=

Liste 2 clic open and close
Text1=
LeftMouseUpAction1=
Text2=
LeftMouseUpAction2=

I am really a beginner and would like to understand

have a good date
User avatar
balala
Rainmeter Sage
Posts: 16260
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: help for start menu list and submenu

Post by balala »

spcram wrote: March 16th, 2023, 12:06 pm Hello, just to know if you could direct me to create a menu list and submenu a bit like the skin fallout in very basic so that I learn I can not find in the tutorial
I am not sure I completely understand your intention, but see bellow an example of a code of an extremely simple skin, having one single visible element (Menu). When you click it, it opens a menu, having two elements: the first one opens Notepad, while the second one opens a command line. When any of these is clicked, the appropriate app is launched and the menu closes. It closes also if you click the Menu text or click outside of the skin.

Code: Select all

[Rainmeter]
Update=-1
OnUnfocusAction=[!SetVariable OpenMenu "0"][!UpdateMeasure "MeasureOpenMenu"][!UpdateMeter "MeterMenu"]

[Variables]
OpenMenu=0

[MeasureOpenMenu]
Measure=Calc
Formula=#OpenMenu#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeterGroup "Menu"][!Redraw]
IfFalseAction=[!ShowMeterGroup "Menu"][!Redraw]
DynamicVariables=1

[MeterMenu]
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Menu
DynamicVariables=1
LeftMouseUpAction=[!SetVariable OpenMenu "(1-#OpenMenu#)"][!UpdateMeasure "MeasureOpenMenu"][!UpdateMeter #CURRENTSECTION#]

[MeterMenuElement1]
Meter=STRING
X=10r
Y=1R
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Notepad
Group=Menu
LeftMouseUpAction=[!SetVariable OpenMenu "0"]["Notepad.exe"][!UpdateMeasure "MeasureOpenMenu"][!UpdateMeter "MeterMenu"]

[MeterMenuElement2]
Meter=STRING
X=0r
Y=1R
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Commandline
Group=Menu
LeftMouseUpAction=[!SetVariable OpenMenu "0"]["cmd.exe"][!UpdateMeasure "MeasureOpenMenu"][!UpdateMeter "MeterMenu"]
The above code can be simplified, but for first please try it out and let me know if it looks like what you need.
spcram
Posts: 6
Joined: March 15th, 2023, 4:40 pm

Re: help for start menu list and submenu

Post by spcram »

Thank you. I could leave with a good foundation to learn and understand. Good luck to you and rainmeter :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 16260
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: help for start menu list and submenu

Post by balala »

spcram wrote: March 16th, 2023, 7:48 pm Thank you. I could leave with a good foundation to learn and understand. Good luck to you and rainmeter :thumbup:
If any question arises, please feel free to come back with it (them, if there are more). Good luck with Rainmeter coding.