Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

RADIAL MENU scripts - migrated to new forum


  • Please log in to reply
1310 replies to this topic
Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009
@Edd: No, modifying RMApp lib.ahk library is not the only way. It's up to you to make your own function/class/script, which will do exactly what you want. ;)
@Wickster: Interesting skin, thanks for sharing. I'll add a link to it in a list of additional skins in RM help ;)
@beeski: You're welcome. I'm glad you figured out how to adjust item size yourself ;)

is there a way to colour-tag an individual menu entry to have an instant visual cue about its function?

Yes. See SpecItemBack and SpecItemFore attributes in Item attributes in details heading in RM help.
Example: SpecItemFore= C:\Special foreground.png

... executing functions in RM...

Read Executing functions in Item Action possibilities heading in RM help.
Example1: Action = fun Demo1
Example2: Action = fun Demo2|param1|param2|param3

I tried to #Include this functions' .ahk in the auto-execute section of Radial menu.ahk

I suggest you to include functions in "not auto-execute section". See ; you can put or include your functions here comment in Radial menu.ahk

My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


beeski
  • Members
  • 158 posts
  • Last active: Mar 06 2016 08:21 PM
  • Joined: 22 Sep 2011

 



beeski
  • Members
  • 158 posts
  • Last active: Mar 06 2016 08:21 PM
  • Joined: 22 Sep 2011

@Edd: No, modifying RMApp lib.ahk library is not the only way. It's up to you to make your own function/class/script, which will do exactly what you want. ;)
@Wickster: Interesting skin, thanks for sharing. I'll add a link to it in a list of additional skins in RM help ;)
@beeski: You're welcome. I'm glad you figured out how to adjust item size yourself ;)
Yes. See SpecItemBack and SpecItemFore attributes in Item attributes in details heading in RM help.
Example: SpecItemFore= C:\Special foreground.png
Read Executing functions in Item Action possibilities heading in RM help.
Example1: Action = fun Demo1
Example2: Action = fun Demo2|param1|param2|param3
I suggest you to include functions in "not auto-execute section". See ; you can put or include your functions here comment in Radial menu.ahk

 

great, thank you very much! i have now completed my first ad hoc RM for my editing software and it's working great.

 

again, i am sorry for what is possibly an obvious thing for seasoned users of RM / ahk-- the RM helpfile mentions one can try to call functions that determine not only the active winow's text, class and ID (basically the info I was used to seeing using AHK's window spy), but also possibly retrieving information about a control the mouse cursor is hovering over, and more. are these functions written specifically for RM, or is this something that has always been part of ahk, but the window spy program simply does not display?

 

(i had been long thinking of a solution to determine what the mouse cursor may be hovering over myself, unware that there may be functions written to do this, and thought the only solution may be some sort of OCR, which I really did not want to get into due to its complexity.)



Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009

AU3 spy has Now Under Mouse Cursor section which displays ClassNN and Text. RM collects some useful info in the moment you press RMShowHotkey by using the following AHK commands;

CoordMode, mouse, screen
ActiveWinID := WinExist("A")
MouseGetPos, mx1, my1, WinUMID, ControlUMClass
MouseGetPos,,,, ControlUMID, 2
ControlGetFocus, ControlFocClass , ahk_id %ActiveWinID%

And there's a description how to get that info in My functions.ahk and some other files in My codes folder;

When you press RMShowHotkey, RM stores some useful info:
- unique ID number (hwnd) of window under the mouse cursor. To get it, call: WinUMID := RMApp_Reg("WinUMID") ; "UM" means "under mouse".
- unique ID number (hwnd) of active window. To get it, call: ActiveWinID := RMApp_Reg("ActiveWinID")
- class of the control under the mouse cursor. To get it, call: ControlUMClass := RMApp_Reg("ControlUMClass")
- unique ID number (hwnd) of the control under the mouse cursor. To get it, call: ControlUMID := RMApp_Reg("ControlUMID")
- class of control that has input focus in active window. To get it, call ControlFocClass := RMApp_Reg("ControlFocClass")
- x coordinate relative to screen. To get it, call: x := RMApp_Reg("x")
- y coordinate relative to screen. To get it, call: y := RMApp_Reg("y")


My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


beeski
  • Members
  • 158 posts
  • Last active: Mar 06 2016 08:21 PM
  • Joined: 22 Sep 2011

AU3 spy has Now Under Mouse Cursor section which displays ClassNN and Text. RM collects some useful info in the moment you press RMShowHotkey by using the following AHK commands;

CoordMode, mouse, screen
ActiveWinID := WinExist("A")
MouseGetPos, mx1, my1, WinUMID, ControlUMClass
MouseGetPos,,,, ControlUMID, 2
ControlGetFocus, ControlFocClass , ahk_id %ActiveWinID%

And there's a description how to get that info in My functions.ahk and some other files in My codes folder;

 

Thank you, I will study this.



beeski
  • Members
  • 158 posts
  • Last active: Mar 06 2016 08:21 PM
  • Joined: 22 Sep 2011

I have concluded using a keyboard shortcut as RMShowhotkey suits my workflow better. However, as other hotkeys (combinations of keys) are using my intended RMShowhotkey, I am wondering if it is possible to define RMShowhotkey so that it only works when no other keys are being held down.

 

This is what I mean, I hope this is making some sense: say RMShowhotkey = Esc; however another hotkey in the system is sensitive to a Shift+Esc combination. In this case, RM comes up regardless whether Shift is pressed alongside Esc or not, thus interfering with the other script.

 

edit: I think I found the relevant information... "RMApp_OnRMShowHotkey" :)



Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009

beeski, there's something better which is coming in next RM4 update (My RMShowHotkey conditions.ahk). It will allow you to to regulate RMShowHotkey's context-sensitivity much more and better than now. Just wait a few days or even hours - updates will be released very soon... ;)


My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


beeski
  • Members
  • 158 posts
  • Last active: Mar 06 2016 08:21 PM
  • Joined: 22 Sep 2011

beeski, there's something better which is coming in next RM4 update (My RMShowHotkey conditions.ahk). It will allow you to to regulate RMShowHotkey's context-sensitivity much more and better than now. Just wait a few days or even hours - updates will be released very soon... ;)

 

Great news, you may have saved me a good deal of time.



Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009

Radial menu application updated to v4.40

What's new?

  • Upgraded RMShowHotkey's context-sensitivity; Black list.ahk is replaced with My RMShowHotkey conditions.ahk, which gives user much more control over RMShowHotkey's context-sensitivity. More info in My RMShowHotkey conditions.ahk comments, in this post, and in RM help
  • Added possibility to have both single and multiple directions as RMShowMethod; see this post.
  • Gdip_All - as I recently obtained necessary permissions from Rseding91 and fincs, Tic's Gdip.ahk is replaced with Gdip_All.ahk
  • Rseding91 and fincs added to thank you section
  • some little changes in RM license; added link to AHKscript forum, added notes about Rseding91's and Fincs permissions, etc.
  • updated RM help, added link to Wickster's Squares skin
  • includes newest AutoHotkey, RM2module and Radial menu designer (RMD)

 

RM2module updated to v2.21
What's new?

  • added RM2_IsMenuUnderMouse() and RM2_GetMenusHwndList() functions

 

Radial menu designer (RMD) updated to v1.00
What's new?

  • Gdip_All - as I recently obtained necessary permissions from Rseding91 and fincs, Tic's Gdip.ahk is replaced with Gdip_All.ahk
  • Rseding91 and fincs added to thank you section

My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


beeski
  • Members
  • 158 posts
  • Last active: Mar 06 2016 08:21 PM
  • Joined: 22 Sep 2011

After updating, RM reports too many parameters passed to function, specifically RMApp_NavControlHandler (ItemAction, RMApp_NavReg("ActiveWinID"),  RMApp_Reg("ControlFocClass")) (line 2372)

 

(It may very likely be something related to my setup, I am sure.)

 

fixed.



Edd
  • Members
  • 212 posts
  • Last active: Jan 06 2016 07:36 AM
  • Joined: 24 Dec 2011

Hello L1, how you been?
This is the most closely that I get to adapt it for my needs:
 

#Include, RM2module v2.21\RM2module.ahk
#Include, RM2module v2.21\gdip.ahk

#If RM2_IsMenuUnderMouse()
Hotkey, Numpad5, ShowMenu

GoSub, CreateMenu

return

CreateMenu:
;===========================================================================
RM2_On(A_ScriptDir "\Resources\Images","RadiusSizeFactor.1.3")
MenuA := RM2_CreateMenu(1,"UP>Show","nb","nf","","")
MenuB := RM2_CreateMenu(2,"DN>Hide||||||3>3|4>4|5>5||||||||1>1|2>2|||||||||||||||||||||||||||||||","","","","")
RM2_Off()	; unloads skin
MenuToShow := MenuA

SysGet, MonitorWorkArea, MonitorWorkArea, 1
yPos := MonitorWorkAreaBottom-cmToInches(-1)*A_ScreenDPI

cmToInches(cm)
{
	return cm*0.3937
}

A_Y=%yPos%
B_Y=%yPos%

RM2_Show(MenuToShow,A_ScreenWidth/2,A_Y)
return


#If RM2_IsMenuUnderMouse()
*LButton::
SelectedItem := RM2_GetSelectedItem2(MenuToShow, "", "bc.1 bs.50")
if (SelectedItem != "") {
	if (SelectedItem = "Up") {
	MenuToShow := MenuB
	RM2_Hide(MenuA)
	RM2_Show(MenuToShow,A_ScreenWidth/2,B_Y)
	}
	else if (SelectedItem = "Dn") {
	MenuToShow := MenuA
	RM2_Hide(MenuB)
	RM2_Show(MenuToShow,A_ScreenWidth/2,A_Y)
	}
}
return

ShowMenu:
SelectedItem := RM2_GetSelectedItem2(MenuToShow, "Numpad5", "bc.1 bs.50")
if (SelectedItem != "") {
	if (SelectedItem = "Up") {
	MenuToShow := MenuB
	RM2_Hide(MenuA)
	RM2_Show(MenuToShow,A_ScreenWidth/2,B_Y)
	}
	else if (SelectedItem = "Dn") {
	MenuToShow := MenuA
	RM2_Hide(MenuB)
	RM2_Show(MenuToShow,A_ScreenWidth/2,A_Y)
	}
}
return
#If


RM2_GetSelectedItem2(GuiNum, key="", options="", StartX="", StartY="") {
;Thread, NoTimers	
if (RM2_DoesExist(GuiNum) != 1)	
return
CoordMode, mouse, screen
if (StartX = "") {
LastShowCoords := RM2_Reg("M" GuiNum "#LastShowCoords")
StringSplit, lsc, LastShowCoords, |
StartX := lsc1, StartY := lsc2
}
else if (StartX = "Center" or StartX = "c")
StartX := A_ScreenWidth/2, StartY := A_ScreenHeight/2
if (options != "") {
Loop, Parse, options, %A_Space%
{
Field := A_LoopField
DotPos := InStr(Field, ".")
if (DotPos = 0) {	
if Field in ntt,gn,rc,pos	
%Field% := 1
}
else {				
var := SubStr(Field, 1, DotPos-1)
val := SubStr(Field, DotPos+1)
if var in bc,bs,iicr,foh	
%var% := val
}
}	
}
ItemGlowGuiNum := RM2_Reg("ItemGlowGuiNum"), ItemGlowHWND := RM2_Reg("ItemGlowHWND")
ItemSize := RM2_Reg("ItemSize"), IsOneRinger := RM2_Reg("M" GuiNum "#IsOneRinger")
if (foh != "") {		
StringSplit, v, foh, .
foh := v1, param1 := v2, param2 := v3
}

key := RegExReplace(A_ThisHotkey, (A_IsUnicode = 1) ? "(*UCP)^(\w* & |\W*)" : "^(\w* & |\W*)")	

if (SelectMethod = "c") {	
;KeyWait, %key%
state := 0
}
else 
state := 1

While, (GetKeyState(key,"p") = state) {
Sleep, 20
MouseGetPos, EndX, EndY
if IsOneRinger 
SelectedItemNumber := RM2_GetSelectedItemNumberOR(StartX, StartY, EndX, EndY, GuiNum)
else
SelectedItemNumber := RM2_GetSelectedItemNumber(StartX, StartY, EndX, EndY, GuiNum)
if !(RM2_RegTOI("M" GuiNum "#" "I" SelectedItemNumber))	
{
SelectedItem := "", LastItemUM := ""
RM2_ToolTipFM()
Gui %ItemGlowGuiNum%: hide
}
else 
{
SelectedItem := SelectedItemNumber
if !(ntt = 1)	
{
CurTT := RM2_RegTT("M" GuiNum "#I" SelectedItem)
if (CurTT = "")
RM2_ToolTipFM()
else
RM2_ToolTipFM(CurTT)
}
if (SelectedItem = LastItemUM)	
continue
if IsOneRinger
CurOffset := RM2_RegOR("M" GuiNum "#I" SelectedItem  "#Offset")
else
CurOffset := RM2_Reg("Offset" SelectedItem)
StringSplit, co, CurOffset, :
CurItemGlowX := Round(StartX+co1), CurItemGlowY := Round(StartY+co2)
if foh
%foh%(param1,param2)
Gui %ItemGlowGuiNum%:Show, x%CurItemGlowX% y%CurItemGlowY% NA
LastItemUM := SelectedItem
}
}

RM2_ToolTipFM()
if (SelectedItem = "")	
{
if (iicr != "") {	
RadiusSizeFactor := RM2_Reg("RadiusSizeFactor")
IsInCircle := RM2_IsInCircle(StartX, StartY, EndX, EndY, (ItemSize*RadiusSizeFactor)/2)
if IsInCircle
{
Gui %ItemGlowGuiNum%: hide
return iicr	
}
}
Gui %ItemGlowGuiNum%: hide
return
}
else	
{
if (bc = "" or bs = "")	
Gui %ItemGlowGuiNum%:hide
else
RM2_ItemGlowBlink(ItemGlowGuiNum,bc,bs)
if rc
MouseMove, %StartX%, %StartY%
if !pos	
SelectedItem := RM2_RegTOI("M" GuiNum "#I" SelectedItem)
if gn
SelectedItem .= "|" GuiNum
}
return SelectedItem
}


ESC::ExitApp

finally I get the menu opening by "LButton" and "NumpadClear" witth a single press but now the tooltips aren't showing properly, only shows when user clicks an item, then it dissapears, also I noticed for example if user opens and then close the menu with "NumpadClear" and then user wants to open it again but now by "LButton" it needs to click twice, it seems I need to free the "RM2_IsMenuUnderMouse" function somehow, because If after closing the menu with "NumpadClear" I move the cursor out of the item and then hover the item and press the "LButton" the menu is opened correctly with a single click..
 



Moderated
  • Members
  • 124 posts
  • Last active: Aug 27 2015 04:01 PM
  • Joined: 28 May 2012

In the next update, can you make so you can have multiple rmbuttons just by saying

"RMShowHotkey=F5,X,B" etc?

Also can you make so that RMD reads the skin definition and changes to match it? So for example if you  changed the itemlayoutperring, it would change there?



Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009

... Without my written permission, you (user) are not allowed to (re)distribute ...


According to our previous correspondence, I'm giving the following statement;

I, Boris Mudrinić (Learning one) am giving permission to David Bradford (tinypig) to upload modified Radial menu v4 to Github, which will include his settings and will be available for free, with full credit to me, and starting off with a link to the software's homepage on the AHK forum.


My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


tinypig
  • Members
  • 16 posts
  • Last active: Aug 29 2014 12:36 AM
  • Joined: 12 Mar 2005

According to our previous correspondence, I'm giving the following statement;

I, Boris Mudrinić (Learning one) am giving permission to David Bradford (tinypig) to upload modified Radial menu v4 to Github, which will include his settings and will be available for free, with full credit to me, and starting off with a link to the software's homepage on the AHK forum.

Thanks! I'll post back here with progress on these tasks.



Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009

@Edd: I'm glad to see you are making a progress in improving your script. I'm not happy to say this, but as I helped you more than enough till now, you'll have to work on your script without me and my help. I can't spoon feed you for free any more - I volunteered much more than I wanted, and now I'm starting to feel you're abusing my good will to help somebody for free. If you want paid support, that's something different.
@Moderated: Good suggestions, I'll think about implementing them.
@tinypig:You're welcome. I'm looking forward to see your progress.


My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy