It is currently May 3rd, 2024, 5:43 pm

need help with a dropdown menu

Get help with creating, editing & fixing problems with skins
PsychoW
Posts: 4
Joined: December 6th, 2012, 8:49 pm

need help with a dropdown menu

Post by PsychoW »

I'm trying to add dropdown menu's to this skin, however i can't seem to get the location of the new buttons to work. The dropdown menu should open under 8th launcher button.

I'm new to rainmeter coding so an example on how the new code should look like would be much appreciated.

Code: Select all

[Rainmeter]
Author=Media Maggot | Daelnz
Group=Avengers

[Metadata]
Name=Small Launchers
Information=6 buttons for launching programs | Change the icons, paths and labels in the Config.inc file
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=1.2.0

[Variables]
@include=#SKINSPATH#\Avengers\Config.inc

;Styles===============

[TextStyle]
Meter=string
Fontface= gliscor gothic
Fontcolor=255,255,255,255
Fontsize = 8
Antialias=1
Stringalign = left


;Launchers=============

[MeterLauncher]
Meter=BUTTON
ButtonImage=Launcher Small Button #Colour1#.png
ButtonCommand=!Execute ["#SLP1#"]
Antialias=1

[MeterLauncher1]
Meter=BUTTON
ButtonImage=Launcher Small Button #Colour1#.png
x=90r
ButtonCommand=!Execute ["#SLP2#"]
Antialias=1

[MeterLauncher2]
Meter=BUTTON
ButtonImage=Launcher Small Button #Colour1#.png
x=90r
ButtonCommand=!Execute ["#SLP3#"]
Antialias=1

[MeterLauncher3]
Meter=BUTTON
ButtonImage=Launcher Small Button #Colour1#.png
x=90r
ButtonCommand=!Execute ["#SLP4#"]
Antialias=1

[MeterLauncher4]
Meter=BUTTON
ButtonImage=Launcher Small Button #Colour1#.png
x=90r
ButtonCommand=!Execute ["#SLP5#"]
Antialias=1

[MeterLauncher5]
Meter=BUTTON
ButtonImage=Launcher Small Button #Colour1#.png
x=90r
ButtonCommand=!Execute ["#SLP6#"]
Antialias=1

[MeterLauncher6]
Meter=BUTTON
ButtonImage=Launcher Small Button #Colour1#.png
x=90r
ButtonCommand=!Execute ["#SLP7#"]
Antialias=1

[MeterLauncher7]
Meter=BUTTON
ButtonImage=Launcher Small Button #Colour1#.png
x=90r
ButtonCommand=!Execute ["#SLP8#"]
Antialias=1

[MeterLauncher8]
Meter=BUTTON
ButtonImage=Launcher Small Button #Colour1#.png
x=90r
ButtonCommand=!Execute ["#SLP9#"]
Antialias=1

;Launcher Text=============

[MeterLauncherText]
meter=string
meterstyle=textstyle
text="#SLT1#"
x = 39
y = 13

[MeterLauncherText2]
meter=string
meterstyle=textstyle
text="#SLT2#"
x = 90r
y = r

[MeterLauncherText3]
meter=string
meterstyle=textstyle
text="#SLT3#"
x = 90r
y = r

[MeterLauncherText4]
meter=string
meterstyle=textstyle
text="#SLT4#"
x = 90r
y = r

[MeterLauncherText5]
meter=string
meterstyle=textstyle
text="#SLT5#"
x = 90r
y = r

[MeterLauncherText6]
meter=string
meterstyle=textstyle
text="#SLT6#"
x = 90r
y = r

[MeterLauncherText7]
meter=string
meterstyle=textstyle
text="#SLT7#"
x = 90r
y = r

[MeterLauncherText8]
meter=string
meterstyle=textstyle
text="#SLT8#"
x = 90r
y = r

[MeterLauncherText9]
meter=string
meterstyle=textstyle
text="#SLT9#"
x = 90r
y = r

;Launchers Icons===========

[MeterLauncherIcon]
meter=image
imagename=#SLI1#
w=20
h=20
x=15
y=4
antialias = 1

[MeterLauncherIcon2]
meter=image
imagename=#SLI2#
w=20
h=20
x=90r
y=r
antialias = 1

[MeterLauncherIcon3]
meter=image
imagename=#SLI3#
w=20
h=20
x=90r
y=r
antialias = 1

[MeterLauncherIcon4]
meter=image
imagename=#SLI4#
w=20
h=20
x=90r
y=r
antialias = 1

[MeterLauncherIcon5]
meter=image
imagename=#SLI5#
w=20
h=20
x=90r
y=r
antialias = 1

[MeterLauncherIcon6]
meter=image
imagename=#SLI6#
w=20
h=20
x=90r
y=r
antialias = 1

[MeterLauncherIcon7]
meter=image
imagename=#SLI7#
w=20
h=20
x=90r
y=r
antialias = 1

[MeterLauncherIcon8]
meter=image
imagename=#SLI8#
w=20
h=20
x=90r
y=r
antialias = 1

[MeterLauncherIcon9]
meter=image
imagename=#SLI9#
w=20
h=20
x=90r
y=r
antialias = 1
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: need help with a dropdown menu

Post by MerlinTheRed »

You can get the position of a meter with Section Variables. Use them to position your dropdown menu.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
PsychoW
Posts: 4
Joined: December 6th, 2012, 8:49 pm

Re: need help with a dropdown menu

Post by PsychoW »

I still don't really understand how to do it. What does the r mean in de position code (e.g. x=90r) and is it possible to use something similar to code the buttons of the dropdown menu.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: need help with a dropdown menu

Post by MerlinTheRed »

Sorry, I thought you wrote the code you posted yourself.

The x=90r means that the x position of the meter is 90 pixels right of the x position of the previous meter in the code. If you have "R", it's relative to the right (or bottom) edge of the previous meter.

I suggested section variables because they enable you to use the position of a meter anywhere in the code. For example if you want to place a meter directly below the 8th launcher button, you could use this position on it:

Code: Select all

X=[MeterLauncher8:X]
Y=([MeterLauncher8:Y]+[MeterLauncher8:H])
You probably also need to use DynamicVariables=1 on the dropdown menu meters
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
PsychoW
Posts: 4
Joined: December 6th, 2012, 8:49 pm

Re: need help with a dropdown menu

Post by PsychoW »

I'm trying to write to hide the dropdown buttons when the show button is pressed a second time. While the dropdown menu appears after the button is pressed once, it doesn't disappear when pressed a second time.

Code: Select all

[MeterLauncher8a]
Meter=BUTTON
ButtonImage=Launcher Small Button #Colour1#.png
x=90r
ButtonCommand=!Execute [!RainmeterShowMeter Meterlauncher 8b][!RainmeterHidemeter Meterlauncher 8a][!RainmeterShowMeter dropbutton81]
Antialias=1
dynamicvariables=1
;["#SLP9#"]

[MeterLauncher8b]
Meter=button
Buttonimage=launcher Small Button #Colour2#.png
x=[MeterLauncher8a:X]
Buttoncommand=!Execute [!RainmeterShowMeter Meterlauncher 8a][!RainmeterHideMeter Meterlauncher 8b][!RainmeterHidemeter dropbutton81]
antialias=1
DynamicVariables=1
hidden=1
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: need help with a dropdown menu

Post by moshi »

check for typos.

[!RainmeterShowMeter Meterlauncher 8b] should be [!RainmeterShowMeter Meterlauncher8b], etc.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: need help with a dropdown menu

Post by MerlinTheRed »

Also with the new Rainmeter version, you can actually just write

Code: Select all

ButtonCommand=[!ShowMeter Meterlauncher8b][!HideMeter Meterlauncher8a][!ShowMeter dropbutton81]
instead of

Code: Select all

ButtonCommand=!Execute [!RainmeterShowMeter Meterlauncher8b][!RainmeterHideMeter Meterlauncher8a][!RainmeterShowMeter dropbutton81]
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!