It is currently April 27th, 2024, 7:56 pm

Custom Context Menu

Get help with creating, editing & fixing problems with skins
BaconCR
Posts: 5
Joined: January 11th, 2024, 2:22 pm

Custom Context Menu

Post by BaconCR »

Hi! I'm trying to create a Custom Context Menu, and I want to add the option for Variants. I have this:

ContextTitle11=Variants
ContextAction11=[!SkinMenu]

The thing is I have the bang to open the skin menu which is great, but I don't want it to open that menu with all the options I wanted to show just the variants the other .ini options for that instead of opening the whole menu. I want it to open just that section. Any ideas on how to do that?
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Custom Context Menu

Post by Yincognito »

BaconCR wrote: January 11th, 2024, 2:33 pm Hi! I'm trying to create a Custom Context Menu, and I want to add the option for Variants. I have this:

ContextTitle11=Variants
ContextAction11=[!SkinMenu]

The thing is I have the bang to open the skin menu which is great, but I don't want it to open that menu with all the options I wanted to show just the variants the other .ini options for that instead of opening the whole menu. I want it to open just that section. Any ideas on how to do that?
If I understand correctly what you want, displaying only a specific submenu from the skin's context menu (in this case, only the Variants submenu) is not possible, but you could reproduce it by creating the said menu choices and actions yourself... :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
BaconCR
Posts: 5
Joined: January 11th, 2024, 2:22 pm

Re: Custom Context Menu

Post by BaconCR »

Yincognito wrote: January 11th, 2024, 6:07 pm If I understand correctly what you want, displaying only a specific submenu from the skin's context menu (in this case, only the Variants submenu) is not possible, but you could reproduce it by creating the said menu choices and actions yourself... :???:
Yes, that's what I want, but I have no knowledge on how to do it. I kind of understand a bit certain things in the code, but I have no idea how to write to create that menu, by any chance you have some experience with it?
Aryx
Posts: 34
Joined: December 20th, 2023, 9:18 am

Re: Custom Context Menu

Post by Aryx »

I know this one 8-) :

Write:RightMouseUpAction=[!SkinCustomMenu] in [Rainmeter]. If this is skipped, then the regular context-menu appears and you can click "Custom Skin Action" to use the custom-menu.

Code: Select all

ContextTitle=Something1
ContextAction=<Something1>

ContextTitle2=Something2
ContextAction2=<Something2>
Doing the above will open the custom menu directly and replace "SomethingX" with suitable heading and <SomethingX> with action like [!SkinMenu] or whatever you like.
Example:

Code: Select all

[Rainmeter]
RightMouseUpAction=[!SkinCustomMenu]
ContextTitle=Run Notepad
ContextAction=["Notepad.exe"]
Reference: 1. https://forum.rainmeter.net/viewtopic.php?t=13674 for Actions.
Edit: 2. https://forum.rainmeter.net/viewtopic.php?t=43139 for Right-Click Action.
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Custom Context Menu

Post by Yincognito »

BaconCR wrote: January 11th, 2024, 7:08 pm Yes, that's what I want, but I have no knowledge on how to do it. I kind of understand a bit certain things in the code, but I have no idea how to write to create that menu, by any chance you have some experience with it?
Not as much experience as others in this particular case, but I manage. :D Anyway, if you have difficulties with it, here are some descriptions and examples that might help:
https://docs.rainmeter.net/manual/skins/rainmeter-section/#Context
https://forum.rainmeter.net/viewtopic.php?t=20050

Basically, to do what you want you'd probably use those context menu options from [Rainmeter], and load the desired variant via a suited !ActivateConfig bang (scroll down a bit to find it):
https://docs.rainmeter.net/manual/bangs/#Skin

EDIT: Well, Aryx already provided a very good example of one way of doing it. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Custom Context Menu

Post by Yincognito »

Aryx wrote: January 11th, 2024, 7:31 pm I know this one 8-) :
Off topic - in case you didn't receive it yet (you disabled receiving PMs?):
https://forum.rainmeter.net/viewtopic.php?t=31790
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Aryx
Posts: 34
Joined: December 20th, 2023, 9:18 am

Re: Custom Context Menu

Post by Aryx »

Ahhhh! Changed that now..
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Custom Context Menu

Post by eclectic-tech »

BaconCR wrote: January 11th, 2024, 7:08 pm Yes, that's what I want, but I have no knowledge on how to do it. I kind of understand a bit certain things in the code, but I have no idea how to write to create that menu, by any chance you have some experience with it?
You may eventually create a Context Menu to do what you want following the tips and documentation, but alternately, there is also a 'trick' that will step through any number of skin variants.

Use a Mouse Action Bang, for example:
LeftMouseDoubleClickAction=[!ActivateConfig #CURRENTCONFIG#] (note there is no INI file specified).
Add this to the [Rainmeter] section of each skin variant.

With that code, when you double-left-click the skin, the currently loaded variant will be unloaded, and the next variant will be loaded. This works since only 1 variant in the same folder can be active at any time.

Have fun! :welcome:
BaconCR
Posts: 5
Joined: January 11th, 2024, 2:22 pm

Re: Custom Context Menu

Post by BaconCR »

eclectic-tech wrote: January 12th, 2024, 1:10 am You may eventually create a Context Menu to do what you want following the tips and documentation, but alternately, there is also a 'trick' that will step through any number of skin variants.

Use a Mouse Action Bang, for example:
LeftMouseDoubleClickAction=[!ActivateConfig #CURRENTCONFIG#] (note there is no INI file specified).
Add this to the [Rainmeter] section of each skin variant.

With that code, when you double-left-click the skin, the currently loaded variant will be unloaded, and the next variant will be loaded. This works since only 1 variant in the same folder can be active at any time.

Have fun! :welcome:
Hi, I tried that option but it's not working. When I double click it opens the program instead of loading the next variant. Here's the code I have.

Code: Select all

[Rainmeter]
DragGroup=BigSur
Group=Widget | BigSur
Author=Xyrfo and fediaFedia
OnRefreshAction=[!SetTransparency "#opacity#"]
MouseActionCursor=0
MiddleMouseUpAction=!DeactivateConfig
LefttMouseDoubleClickAction=[!ActivateConfig #CURRENTCONFIG#]
Update=-1

Blur=#globalblurenable#
BlurRegion=2,(10-#Padding#),(10-#Padding#),161*#scaledpi#,161*#scaledpi#,#blurcornerradius#

RightMouseUpAction=[!SkinCustomMenu]
ContextTitle=#Settings#
ContextAction=["#@#Config.exe" #Type# "#CURRENTCONFIG#" "#CURRENTFILE#" "#SETTINGSPATH#" "#SKINSPATH#" "#PROGRAMPATH#" "#scaledpi#"]
ContextTitle2=Variants
ContextAction2=[!SkinMenu]
ContextTitle3=#Close#
ContextAction3=[!DeactivateConfig]
ContextTitle4=----
ContextAction4=[]
ContextTitle5=#AddItems#
ContextAction5=[!ActivateConfig "BigSur\Gallery" "Gallery.ini"]
ContextTitle6=----
ContextAction6=[]
ContextTitle7=Refresh Skin
ContextAction7=[!Refresh "#CURRENTCONFIG#"]
ContextTitle8=Refresh All
ContextAction8=[!Refresh "*"]
ContextTitle9=Refresh Rainmeter
ContextAction9=[!RefreshApp]
ContextTitle10=----
ContextAction10=[]
ContextTitle11=#MoreActions#
ContextAction11=[!SkinMenu]

[Metadata]
Version=1.0
Information=BigSur for Rainmeter
License=Creative Commons Attribution-Noncommercial-Share Alike 3.0 License

[Variables]
Type=Mini
@include=#@#Global.inc
@include1=#@#Languages\#MainLanguage#.inc
@include2=#@#\Structure\#Type#\Type.inc
@include3=UserVariables.inc
Name=#PanelName#


[bgEe]
Meter=Image
ImageName=#IconLocation#
LeftMouseUpAction=!execute ["#PanelAction#"]
MeterStyle=Full
x=(22)*#scaledpi#
y=(20)*#scaledpi#
w=(40)*#scaledpi#
h=(40)*#scaledpi#



[bgEe]
Meter=Image
ImageName=#IconLocation#
LeftMouseUpAction=!execute ["#PanelAction#"]
MeterStyle=Full
x=(22)*#scaledpi#
y=(20)*#scaledpi#
w=(40)*#scaledpi#
h=(40)*#scaledpi#
So, this is how the manu looks like.

Image

As you can see the second option is called "Variants" the idea is to have the variants that are show on the SkinMenu shown on the Custom Context Menu.

Image

So, the idea is to have it look something like this

Image

If not to have a way to switch variables in an easy way without having to go on the Custom Context Menu to "More actions", then "Variants" ant then select the one I want. But I don't know how to do it. I know the bang I need to use is !SkinMenu but the things is how do I go about just showing the variants rather thatn the whole menu, because for that I already have "More Actions". The LeftMouse is a good option only thing is it did not work and it opens the program. What I want in the end is to be able to switch between variants in just to clicks and not having to go to multiple menus.
Aryx
Posts: 34
Joined: December 20th, 2023, 9:18 am

Re: Custom Context Menu

Post by Aryx »

Edit: I accidently read "What I want in the end is to be able to switch between variants in just to clicks and not having to go to multiple menus." In short, opposite of what you asked. I just got that after @Yincognito posted the solution.
Just to be clear, you want a sub-context menu?
As far as I know, it's not possible. But, I can think of a workaround -
Parent Skin:
Normal Right-Click-Action in Parent-Skin with Option (Copy the snippet) "Variants >" that will load Child-Skin.
Child Skin:
1. Child-Skin with Context-Menu Options "Item 1", "Item 2" and "Item 3".
2. Now, write this to activate the Faux-Variants-Sub-Context-Menu:

Code: Select all

[MeasureOnLoad]
Measure=Calc
Formula=Counter
IfEqualValue=1
IfEqualAction=[!SkinCustomMenu]
IfAboveValue=1
IfAboveAction=[!DeactivateConfig]
UpdateDivider=-1
This is merely an assumption - untested.
If you want the real deal, check this out (It is a skin, but can be modified easily): https://forum.rainmeter.net/viewtopic.php?t=34438

Reference: https://forum.rainmeter.net/viewtopic.php?p=100888 : Action on skin load.
Last edited by Aryx on January 12th, 2024, 2:08 pm, edited 1 time in total.