Radial Menu V2 - beta.3

Post your working scripts, libraries and tools.
AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Radial Menu V2 - beta.3

Post by AHK_user » 31 Jan 2022, 14:42

Because Gdip_all is converted to v2, I was able to convert of my radial menu script to V2.
This class creates a pie menu that is easy to customize in amount of sections, images...

V1 version: viewtopic.php?f=6&t=67803&hilit=radial
2022-01-31 20_25_44-Radial menu.png
2022-01-31 20_25_44-Radial menu.png (13.7 KiB) Viewed 4281 times
Github: Radial menu

Edited:
- Moved code to Github
- Added optional Callback functionality
- Added variables to modify the colors
- Added SetMode to switch to dark of light
- Added Setting to set the font of the menu

Code: Select all

; This scripts creates a radial menu / pie menu
; The selected menu item is returned as a string.
; mbutton is used in this example to trigger the menu

#SingleInstance Force
#Requires AutoHotkey v2.0-beta.3
;#NoEnv


#Include Radial_Menu.ahk

mButton::
{
    GMenu := Radial_Menu()

    ; Settings for dark mode
    GMenu.SetMode("Dark")

    GMenu.SetSections("8")
    GMenu.Add("Save", "Images/analysis_meas_distance16.gif", 1, (*)=> (MsgBox("Callbacktest")))
    GMenu.Add("Save2", "Images/smt_flat_wall_mt.gif", 2)
    GMenu.Add2("Save2special", "Images/analysis_meas_distance16.gif", 2, (*)=> (MsgBox("Callbacktest2")))
    GMenu.SetKey("mbutton")
    GMenu.SetKeySpecial("Ctrl")
    GMenu.Add("Save3", "", 3)
    GMenu.Add("Save4", "Images/smt_flat_wall_mt.gif", 4)
    GMenu.Add("Save5", "Images/smt_flat_wall_mt.gif", 5)
    GMenu.Add2("Save5se", "Images/fbcp_asm_image.gif", 5)
    GMenu.Add("Save6", "Images/smt_flat_wall_mt.gif", 6)
    GMenu.Add("", "", 7)
    GMenu.Add("Save8", "Images/smt_flat_wall_mt.gif", 8)
    Result := GMenu.Show()

    ; This Result string can be used in if else statements, in this demo i just use a message box.
    MsgBox(Result)
}
Last edited by AHK_user on 28 Feb 2023, 15:53, edited 4 times in total.

stretch65
Posts: 21
Joined: 16 Jun 2015, 23:49

Re: Radial Menu V2 - beta.3

Post by stretch65 » 15 Feb 2022, 00:19

I'm getting the following error when I click the middle mouse button:

Error: This value of type "Map" has no property named "0" (on line 201)

LAPIII
Posts: 671
Joined: 01 Aug 2021, 06:01

Re: Radial Menu V2 - beta.3

Post by LAPIII » 18 Feb 2023, 06:27

I'm getting this error for line number 2265:

Error: This variable has not been assigned a value.

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: Radial Menu V2 - beta.3

Post by AHK_user » 24 Feb 2023, 14:03

Dit you tested out my posted code? This version seems to work fine.

I created a Github to manage it easier.

Foxsayy
Posts: 8
Joined: 16 Jul 2022, 19:27

Re: Radial Menu V2 - beta.3

Post by Foxsayy » 24 Feb 2023, 15:40

excuse my ignorance, but do I have to compile the code in any way Or can I just stick it all the folder and run the AHK?

I also definitely have to check out your VBAtoAHK! have you ever heard of a program that goes in the opposite direction?

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: Radial Menu V2 - beta.3

Post by AHK_user » 25 Feb 2023, 04:09

Foxsayy wrote:
24 Feb 2023, 15:40
excuse my ignorance, but do I have to compile the code in any way Or can I just stick it all the folder and run the AHK?

I also definitely have to check out your VBAtoAHK! have you ever heard of a program that goes in the opposite direction?
Just copy the files in a folder and run, that should work.

Regarding VBAto AHK: Not that I know of, AHK has a lot different functions, so It does not seems logically to do it that way. That Tool was specifically made to convert recorded Excel VBA macro`s.

viv
Posts: 219
Joined: 09 Dec 2020, 17:48

Re: Radial Menu V2 - beta.3

Post by viv » 28 Feb 2023, 15:29

Thank you for your work
There is an error reported when running the example on my end
I don't know the exact purpose of the code
20230301042059.jpeg
20230301042059.jpeg (29.87 KiB) Viewed 3146 times
I added a check here in line 199

Code: Select all

If This.Sect.HasProp(Section_Mouse)
I wonder if this check will damage the function

If possible I would like you to add a function to set the font
In my language, the default font is hard to read

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: Radial Menu V2 - beta.3

Post by AHK_user » 28 Feb 2023, 15:52

viv wrote:
28 Feb 2023, 15:29
Thank you for your work
There is an error reported when running the example on my end
I don't know the exact purpose of the code
20230301042059.jpeg
I added a check here in line 199

Code: Select all

If This.Sect.HasProp(Section_Mouse)
I wonder if this check will damage the function

If possible I would like you to add a function to set the font
In my language, the default font is hard to read
Glad that you like it.

I have added the check.

The Font can now be set by stetting the property Font:
GMenu.Font := "Calibri"

I hope the font that you want to use will work. It will depend on the GDIP.

viv
Posts: 219
Joined: 09 Dec 2020, 17:48

Re: Radial Menu V2 - beta.3

Post by viv » 01 Mar 2023, 01:16

@AHK_user

Thank you very much for the quick fix!
It looks much better after setting the font

There is a small problem
Add Add2 is set with one picture and one without
They both have their names set
When Add2 is activated, there will be an overlap

20230301141703.jpeg
20230301141703.jpeg (34.44 KiB) Viewed 3092 times

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: Radial Menu V2 - beta.3

Post by AHK_user » 01 Mar 2023, 16:50

viv wrote:
01 Mar 2023, 01:16
@AHK_user

Thank you very much for the quick fix!
It looks much better after setting the font

There is a small problem
Add Add2 is set with one picture and one without
They both have their names set
When Add2 is activated, there will be an overlap


20230301141703.jpeg
Thanks for the testing, this should be fixed, please test it out :D

User avatar
iilabs
Posts: 296
Joined: 07 Jun 2020, 16:57

Re: Radial Menu V2 - beta.3

Post by iilabs » 03 May 2023, 20:44

Hello and great script. Does this new version have the ability to load from ini the various images, colors, etc. Thank you!

User avatar
iilabs
Posts: 296
Joined: 07 Jun 2020, 16:57

Re: Radial Menu V2 - beta.3

Post by iilabs » 05 May 2023, 15:54

Hi,
Wonder if there is a bug here:

I am using the example script on Github.


One using the special key "CTRL" if a user goes to the outside circle trigger it displays the alternative option i.e. "Save5se" however when a user clicks in the main circle while still holding "CTRL" to trigger, it displays "Save5" as if not using "CTRL"

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: Radial Menu V2 - beta.3

Post by AHK_user » 06 May 2023, 13:40

iilabs wrote:
05 May 2023, 15:54
Hi,
Wonder if there is a bug here:

I am using the example script on Github.


One using the special key "CTRL" if a user goes to the outside circle trigger it displays the alternative option i.e. "Save5se" however when a user clicks in the main circle while still holding "CTRL" to trigger, it displays "Save5" as if not using "CTRL"
Thanks for reporting, this is now fixed.

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: Radial Menu V2 - beta.3

Post by AHK_user » 06 May 2023, 14:10

iilabs wrote:
03 May 2023, 20:44
Hello and great script. Does this new version have the ability to load from ini the various images, colors, etc. Thank you!
Not yet, but if I have time, I will probably add it.

I also plan to provide a gui to modify the menu by a normal user, else there is no point to create it...

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: Radial Menu V2 - beta.3

Post by AHK_user » 22 May 2023, 13:04

I tried to create a gui to let the user set up their own menu, but I get a GDIP error when I use the menu twice (hotkey F1) and afterwards click on the pie button of the gui.

Radial Menu_Example2.ahk

Can anybody tell me what I do wrong and how I can fix it? Then I can complete it.
JFGukzKVFp.png
JFGukzKVFp.png (21.34 KiB) Viewed 2178 times

Post Reply

Return to “Scripts and Functions (v2)”