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
@doyle Thanks. I implemented some of yours ideas in v2.1 beta


RADIAL MENU v2.1 beta
I did this very quickly, so there might be some mistakes. If you want, test it.
First manually download and place in %A_scriptdir% this two .png-s:
<!-- m -->http://www.autohotke... ... wizard.png<!-- m -->
<!-- m -->http://www.autohotke... ... onitor.png<!-- m -->

;===Description=========================================================================
/*
RADIAL MENU v2.1 beta        by Learning one
AHK forum location: http://www.autohotkey.com/forum/viewtopic.php?p=308352#308352

Draws radial menu when you press & hold RButton. Touch items with mouse to select them. Release RButton to hide menu.
After each selection, mouse will bounce back to center. You can easily select multiple items at once, just with one mouse click!

When I was writing this script, my goals were (sorted by priority):
1. minimize mouse clicks
2. minimize mouse movements
3. minimize eye movements
4. support longer item names than in RADIAL MENU v1
5. not too big, practical, and nice looking menu
6. preserve normal RButton click function
7. write script in tidy, neat style to ease studying and modifying job for all members of AHK community
8. add some special effects

HOW DOES IT WORK? It simply draws 8 carefully positioned & shaped GUIs. See comments in script.
IMPORTANT: Menu items are identified by GUI's title, not by item's text. As GUI's titles are Item1, Item2 etc., we can say that items are identified by position.
I was using high GUI numbers, so you can easily implant Radial menu in your script.

SOME THOUGHTS: Don't think that 8 items are the limit of this menu! One item can be submenu that will open new radial menu! Or, selecting one "special" item
may also have effect like pressing modyfiers on you keyboard (Ctrl, Alt, etc.)! There are almost no limits! Such "special" items may have different
color or may be slightly transparent. Also try to create context sensitive radial menu (menu items are different for different active windows).
That's what I did (my private version). Add icons instead of item's text. Change item's background picture (try to use 70x70 images).
Add some sounds. Create different menu build effect. There are plenty of "make-up" and functional possibilities.

LICENCE:
Free for non-commercial use.
For commercial use, e-mail me please.
If you will use Radial menu in your free software,
mention author's name and contact.
Author:		Boris Mudrinic (Learning one on AHK forum)
Contact:	boris-mudrinic@net.hr

HOTKEYS:
RButton		; Press & hold to show menu. Touch items with mouse to select them. Release RButton to hide menu.
Escape		; ExitApp
Pause		; Pauses the script's current thread and suspends RButton Hotkey, but not Escape Hotkey!

CODE STRUCTURE:
Settings
Auto-execute
Hotkey
Subroutines
   GetSelectedItem
   RadialMenuClose
   ItemBounceOnSel
My standard ExitApp and Suspend+Pause hotkeys

You can change button's action in GetSelectedItem subroutine
*/


;===Basic settings====================================================================
TotalButtons = 7            ; Total number of buttons in menu  (8 max!)
ButtonBack = Button3.png	; Button's background (in %A_scriptdir%)

;Item names                 ; Use `n if you need. Text will be above icon.
Item1 = Calc
Item2 = NotePad
Item3 = Explorer
Item4 = About
Item5 = Thanks`ndoyle
Item6 =
Item7 = Text is`nabove       ; Note! this one has different placement. See below,     ;======Set item names======
Item8 =

;Button's icons (in %A_scriptdir%)  ; Use .png format!
Icon1 = 
Icon2 = 
Icon3 = 
Icon4 = 
Icon5 = 
Icon6 = wizard.png
Icon7 = monitor.png
Icon8 =

;You can change button's action in GetSelectedItem subroutine

;===Advanced settings=================================================================
TextSize = 9		; Item's text size      Once when you get used to your radial menu, you will remember item's positions, and text size won't be so important to you. So you will select items by position in your mind, not by reading item's text.
TextColor = white	; Item's text color
Font = Arial		; Item's font
BuildDelay = 190	; menu will start to show itself after %BuildDelay% miliseconds. To show it instantly, set 0. This delay gives you opportunity to send normal RButton click without annoying menu showing. THE BEST THING TO DO is to change hotkey to XButton1 or XButton1 (if you have them - I don't) and use BuildDelay = 0. MButton is also good idea.
BuildEffect = 30	; menu items will show themself, one by one, in interval of %BuildEffect% ms. To show them all instantly, set 0.
ItemBounce = 1      ; 1 means: items will bounce when you select them. 0 means: items will not bounce.
SoundOnSelect = 1	; 1 means: play sound when item is selected. 0 means: don't play sound. Of course, you can change sound...
; SoundOnShow		; Play with effects: you can easily add this by slightly modifying script...
; SoundOnDestroy	
Color = Black		; this is alternative background color, if script can't load picture (button picture).


;===Auto-execute======================================================================
IfNotExist, %A_scriptdir%\%ButtonBack%
{
   URLDownloadToFile, http://www.autohotkey.net/~Learning one/Radial Menu/%ButtonBack%, %A_scriptdir%\%ButtonBack%
   Sleep, 500
}

StringTrimRight, Sname, A_ScriptName, 4
Menu, Tray, Tip, %Sname%

;===Set button's background, altenative background and font===
Loop, %TotalButtons%  
{
   ; If you want to change item's background, try to use 70x70 images. Some other backgrounds are available on:
   ; http://www.autohotkey.net/~Learning one/Radial Menu
   
   ; Play with effects: small deviations in Add, Picture options have interesting effect:
   ; x0 y-1 w69 h69     ; small shadow
   ; x0 y-1 w71 h71     ; no shadow
   Gui 9%A_Index%:Add, Picture, x0 y-1 w69 h69 , %A_scriptdir%\%ButtonBack%
   Gui 9%A_Index%:Font,  s%TextSize%, %Font%
   Gui 9%A_Index%: Color, %Color%
}

;======Set icons======
Loop, %TotalButtons%
{
   CurrentIcon := Icon%A_Index%
   if (CurrentIcon = "")
   Continue
   Gui 9%A_Index%:Add, Picture, x3 y3 w64 h64 BackgroundTrans, %A_scriptdir%\%CurrentIcon%
}

;======Set item names======     ; text has precedence over icons!
; Play with effects: Remove BackgroundTrans in GuiTextOptions and set Color = 757500 (GUI's color)
GuiTextOptions = x7 y10 w56 h50 c%TextColor% BackgroundTrans    ; principle

Loop, %TotalButtons%
{
   if A_index = 7       ; exception
   Gui 97:Add, Text, x7 y14 w56 h50 c%TextColor% center BackgroundTrans , %Item7%
   else                 ; principle
   CurrentItem := Item%A_Index%
   Gui 9%A_Index%:Add, Text, %GuiTextOptions% , %CurrentItem%	; Build items
}



;===Hotkey==============================================================================
RButton::   ; Press & hold to show menu. Touch items with mouse to select them. Release RButton to hide menu. THE BEST THING TO DO is to change hotkey to XButton1 or XButton1 if you have them ( I don't :( )
PressedTime = 0
CoordMode, mouse, Screen
MouseGetPos, mx1, my1
SetTimer, RadialMenuClose, 35

Loop, %TotalButtons%      ; Draw items (GUIs) at exact positions
{
   if A_index = 1
   {
     RMx := mx1-35
     RMy := my1-135
      if BuildDelay
      {
         Sleep , %BuildDelay%      ; menu will start to show itself after %BuildDelay% ms
         if not (GetKeyState("RButton","p"))
         Return
      }
   }
   Else if A_index = 2
   {
      RMx := mx1+33
      RMy := my1-103
   }
   Else if A_index = 3
   {
      RMx := mx1+65
      RMy := my1-35
   }
   Else if A_index = 4
   {
      RMx := mx1+33
      RMy := my1+33
   }
   Else if A_index = 5
   {
      RMx := mx1-35
      RMy := my1+65
   }
   Else if A_index = 6
   {
      RMx := mx1-103
      RMy := my1+33
   }
   Else if A_index = 7
   {
      RMx := mx1-135
      RMy := my1-35
   }
   Else if A_index = 8
   {
      RMx := mx1-103
      RMy := my1-103
   }

   Gui 9%A_Index%: +AlwaysOnTop +ToolWindow -caption +LastFound
   WinSet, Region, 1-0 W70 H70 R25-25
   Gui 9%A_Index%: Show, x%RMx% y%RMy% h70 w70, Item%A_Index%   
   WinSet, Transparent, 255, Item%A_Index%
   
   Sleep, %BuildEffect%
   if not (GetKeyState("RButton","p"))
   Return
}

SetTimer, GetSelectedItem, 15
Return


;===Subroutines=========================================================================
;===Change button's action here===
GetSelectedItem:            ; menu items are identified by GUI's title!
MouseGetPos, , , WinID
WinGetTitle, Item, ahk_id %WinID%

if Item contains Item      ; This is just example. Build your own menu!
{
   CoordMode, mouse, Screen
   MouseMove, %mx1%, %my1%
   if Item = Item4         ; About Radial menu
   {
      if ItemBounce = 1
	  Gosub, ItemBounceOnSel
	  MsgBox, 64, About, Title:%A_Tab%Radial menu v2.1 beta`nAuthor:%A_Tab%Boris Mudrinic (Learning one on AHK forum)`nContact:%A_Tab%boris-mudrinic@net.hr`n`nLicence:`nFree for non-commercial use.`nFor commercial use, e-mail me please.`n`nIf you will use Radial menu in your free software,`nmention author's name and contact.
      Return
   }
   else if Item = Item3   ; Runs Windows Explorer
   {
      if SoundOnSelect = 1
      SoundPlay, *-1    ; plays simple beep.
      Run, %A_WinDir%\explorer.exe
	  if ItemBounce = 1
	  Gosub, ItemBounceOnSel
      Return
   }
   else if Item = Item2   ; Runs Notepad
   {
      if SoundOnSelect = 1
      SoundPlay, *-1    ; plays simple beep.
      Run, notepad
	  if ItemBounce = 1
	  Gosub, ItemBounceOnSel
      Return
   }
   else if Item = Item1   ; Runs Calculator
   {
      if SoundOnSelect = 1
      SoundPlay, *-1    ; plays simple beep.
      Run, %A_WinDir%\system32\calc.exe
	  if ItemBounce = 1
	  Gosub, ItemBounceOnSel
      Return
   }
   else
   {
      if ItemBounce = 1
      Gosub, ItemBounceOnSel
      MsgBox,, You selected:, %Item%,1
	}
}
Return
   
RadialMenuClose:
PressedTime++
if not (GetKeyState("RButton","p"))
{
   if (PressedTime < 7)   ; if user holded RButton for less than 210ms ...
   SendInput, {RButton}   ; ... script will send normal RButton click
   
   SetTimer, GetSelectedItem, off
   SetTimer, RadialMenuClose, off
   
	; Fade out effect
	InitialTrans = 255 
	Loop, 17
	{
		Loop, 8
		WinSet, Transparent, %InitialTrans%, Item%A_Index%
		InitialTrans -= 15
		Sleep, 25			; change fade out speed if you wish
	}
	Loop, %TotalButtons%
	Gui 9%A_index%: Hide
	Return
}
Return

ItemBounceOnSel:        ; bounce effect
Critical
WinGetPos, XBounce, YBounce,,, %Item%
SetTimer, RadialMenuClose, off
SetTimer, GetSelectedItem, off
SetWinDelay, 5          ; bounce speed

if Item = Item1
{
   Loop, 8 
   {
      if A_Index <= 4
      YBounce -= 4      ; bounce lenght
      Else
      YBounce += 4
      WinMove, %Item%, , %XBounce%, %YBounce%
   }
}
else if Item = Item2
{
   Loop, 8 
   {
      if A_Index <= 4
      {
         XBounce += 4 
         YBounce -= 4
      }
      Else
      {
         XBounce -= 4 
         YBounce += 4
      }
      WinMove, %Item%, , %XBounce%, %YBounce%
   }
}
else if Item = Item3
{
   Loop, 8 
   {
      if A_Index <= 4
      XBounce += 4 
      Else
      XBounce -= 4 
     WinMove, %Item%, , %XBounce%, %YBounce%
   }
}
else if Item = Item4
{
   Loop, 8 
   {
      if A_Index <= 4
      {
         XBounce += 4 
         YBounce += 4
      }
      Else
      {
         XBounce -= 4 
         YBounce -= 4
      }
      WinMove, %Item%, , %XBounce%, %YBounce%
   }
}
else if Item = Item5
{
   Loop, 8 
   {
      if A_Index <= 4
      YBounce += 4
      Else
      YBounce -= 4
      WinMove, %Item%, , %XBounce%, %YBounce%
   }
}
else if Item = Item6
{
   Loop, 8 
   {
      if A_Index <= 4
      {
         XBounce -= 4 
         YBounce += 4
      }
      Else
      {
         XBounce += 4 
         YBounce -= 4
      }
      WinMove, %Item%, , %XBounce%, %YBounce%
   }
}
else if Item = Item7
{
   Loop, 8 
   {
      if A_Index <= 4
      XBounce -= 4 
      Else
      XBounce += 4
      WinMove, %Item%, , %XBounce%, %YBounce%
   }
}
else if Item = Item8
{
   Loop, 8 
   {
      if A_Index <= 4
      {
         XBounce -= 4 
         YBounce -= 4
      }
      Else
      {
         XBounce += 4 
         YBounce += 4
      }
      WinMove, %Item%, , %XBounce%, %YBounce%
   }
}

SetWinDelay, 100    ; default
SetTimer, GetSelectedItem, on
SetTimer, RadialMenuClose, on
Return


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ExitApp
Pause::
Suspend
Pause,,1
return

Escape::
Suspend
ExitApp
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


doyle
  • Members
  • 335 posts
  • Last active: Mar 02 2012 04:47 PM
  • Joined: 14 Nov 2007
Good work LO.

I'll test it, and report back later.

doyle
  • Members
  • 335 posts
  • Last active: Mar 02 2012 04:47 PM
  • Joined: 14 Nov 2007
I was thinking that the script would look sleeker if each item faded in individually. (And fade out individually too.)

Would it be worth creating a fade function?

i.e when a we loop through and create each item, we send it to the fade function so that it fades in.

Something like:
fade(item,speed)
{
	
	fade = 0
	Loop, 25
	{
		WinSet, Transparent, %fade%, %item%
		fade := fade + 10
		Sleep, %speed%
		
	}
	
	WinSet, Transparent, 255, %item%
}


Then when the script fades out the window it fades them out one after the other by sending them to a fadeout function. (Or the same function but tweeked to accept an in or out arguement.)

We start a loop that creates each item seperately after a small delay, but if we triggered the function for each item within the loop, then the should fade in individually.

netfun81
  • Members
  • 58 posts
  • Last active: Feb 21 2010 09:32 AM
  • Joined: 28 Oct 2006
I liked the concept so I decided to make my own *even simpler* radial menu. This one uses the middle mouse button and disappears in a couple seconds or when launching an app. Maybe someone will like it.
screenshot: Posted Image

#NoEnv  
SendMode Input
SetWorkingDir %A_ScriptDir%

CoordMode, Mouse, Screen  
Gui +ToolWindow +AlwaysOnTop -Caption
Gui, Color, EEAA99
Gui +LastFound  
WinSet, TransColor, EEAA99

Gui, Add, Button, x40 y5 w20 h20 , F
Gui, Add, Button, x20 y15 w20 h20 , E
Gui, Add, Button, x60 y15 w20 h20 , I
Gui, Add, Button, x10 y35 w20 h20 , C
Gui, Add, Button, x70 y35 w20 h20 , T
Gui, Add, Button, x20 y55 w20 h20 , L
Gui, Add, Button, x60 y55 w20 h20 , G
Gui, Add, Button, x40 y65 w20 h20 , S
Gui, show, w100 h90
Gui, hide
return

ButtonC:
Run, C:\program files\ccleaner\ccleaner.exe
gui, hide
return

ButtonE:
Run, explorer.exe c:\program files
gui, hide
return

ButtonF:
Run, c:\program files\mozilla firefox\firefox.exe
gui, hide
return

ButtonG:
Run, c:\windows\system32\spider.exe
gui, hide
return

ButtonI:
Run, c:\program files\internet explorer\iexplore.exe
gui, hide
return

ButtonL:
gui, hide
MsgBox, 4, , Do you want to Logoff?
IfMsgBox No
return
else
shutdown, 0
return

ButtonS:
gui, hide
MsgBox, 4, , Do you want to Shutdown?
IfMsgBox No
return
else
shutdown, 1
return

ButtonT:
Run, c:\windows\system32\taskmgr.exe
gui, hide
return

mbutton::
MouseGetPos, x, y
mgx:=x-50
mgy:=y-40
Gui Show, x%mgx% y%mgy% 
Sleep 3000
gui, hide
return

mbutton & rbutton::
Send, !+{ESC}
WinRestore, A
return


TomXIII
  • Members
  • 182 posts
  • Last active: Feb 28 2011 11:42 PM
  • Joined: 14 Apr 2009
@Learning one: Thx!!! I really like the concept!

Here is my version of Radial Menu

Main changes:
-Ability to create multiple items during the script running
-Other method to verify the time since the hotkey triggering (more accurate for me)
-Other method to run selected item (tooltips added)
-Settings GUI

Update (20h45 GMT): I added a centered item called Close GUI to cancel launching instead of pressing LButton

/* ===Description=========================================================================
Original script : RADIAL MENU v2        by Learning one
Find it at AHK forum location: http://www.autohotkey.com/forum/viewtopic.php?p=308352#308352

Remixed by TomXIII (not finished!!!!!!)
*/

;#### Start: Settings and GUI creation
CoordMode, Mouse, Screen

BitmapExist()

If FileExist(A_ScriptDir "\Settings.ini") ;<Read/verify settings values and create them if none>
{
	IniRead, wheelRadius, %A_ScriptDir%\Settings.ini, Settings, wheelRadius, NULL
	If wheelRadius is not digit
		wheelRadius := 50
	IniRead, itemsNbr, %A_ScriptDir%\Settings.ini, Settings, itemsNbr, NULL
	If itemsNbr is not digit
		itemsNbr := 5
	IniRead, buildDelay, %A_ScriptDir%\Settings.ini, Settings, buildDelay, NULL
	If buildDelay is not digit
		buildDelay := 200
	If wheelRadius not between 50 and 200
		wheelRadius := 100
	If itemsNbr not between 1 and 24
		itemsNbr := 12
	If buildDelay not between 150 and 1000
		buildDelay := 200
}
Else
{
	wheelRadius := 100
	itemsNbr := 12
	buildDelay := 200
}
picSize := 48
picRadius := picSize/2

Gosub, CreateItems ;<Create items before for a quick display>

;<Close GUI>
Gui, 98:Add, Picture, x0 y0 w%picSize% h%picSize%, %A_ScriptDir%\bitmap.png
Gui, 98:+AlwaysOnTop +ToolWindow -Caption +LastFound
Gui, 98:Color, White

;<Settings GUI creation>
Gui, 99:Add, Text,, Wheel's Radius : 
Gui, 99:Add, Edit, xp+120 yp-3 w35 vRadiusEdit Number, %wheelRadius%
Gui, 99:Add, Slider, xp+35 h20 Range50-200 ToolTip vWRSlider gGetWheelRadius, %wheelRadius%
Gui, 99:Add, Text, xm, Number of items : 
Gui, 99:Add, Edit, xp+120 yp-3 w35 vItemsEdit Number, %itemsNbr%
Gui, 99:Add, Slider, xp+35 h20 Range1-24 ToolTip vINSlider gGetItemsNbr, %itemsNbr%
Gui, 99:Add, Text, xm, Building delay (msec) : 
Gui, 99:Add, Edit, xp+120 yp-3 w35 vDelayEdit Number, %buildDelay%
Gui, 99:Add, Slider, xp+35 h20 Range150-1000 ToolTip vBDSlider gGetBuildDelay, %buildDelay%
Gui, 99:Add, Button, vBt gGetSettings default, Default
Gui, 99:+AlwaysOnTop +ToolWindow +LastFound

;<Tray context menu creation>
Menu, Tray, Add, Settings, ShowSettingsGUI
Menu, tray, Add,
Menu, tray, Add, Exit, Exit
Menu, tray, NoStandard
Menu, tray, Click, 1
Menu, tray, Default, Settings
Return

CreateItems: ;<Lets create items during the script running>
BitmapExist()
Loop, %itemsNbr%
{
	itemNumber := itemsNbr<10 ? "0" . A_Index : A_Index
	Gui, %itemNumber%:Add, Picture, x0 y0 w%picSize% h%picSize%, %A_ScriptDir%\bitmap.png
	Gui, %itemNumber%: +AlwaysOnTop +ToolWindow -Caption +LastFound
	Gui, %itemNumber%:Color, White
}
Return

BitmapExist()
{
	IfNotExist, %A_ScriptDir%\bitmap.png
	{
		TrayTip, Downloading bitmap:, Please wait!
		URLDownloadToFile, http://www.autohotkey.net/~TomXIII/bitmap.png, %A_ScriptDir%\bitmap.png
		Loop
		{
			Sleep, 10
			IfExist, %A_ScriptDir%\bitmap.png
				Break
		}
		TrayTip
	}
}
;########## End: Settings and GUI creation ##########

;########## Hotkey(s) ##########
!g::
GuiControlGet, var,, Pic2
MsgBox, %var%
Return

RButton::
Loop
{
	If not GetKeyState("RButton", "P") OR (A_TimeSinceThisHotkey > buildDelay)
		Break
}
If (A_TimeSinceThisHotkey < buildDelay)
	SendInput, {RButton}
Else
{
	MouseGetPos, mouseX, mouseY
	deg := 0
	Loop, %itemsNbr%
	{
		SetTimer, RadialMenuClose, 35
		deg := deg ? deg+(360/itemsNbr): (360/itemsNbr)+90
		pi :=4*Atan(1)
		rad := deg*(pi/180)
		xOffset := wheelRadius*(-1*Cos(rad))-picRadius
		yOffset := wheelRadius*(-1*Sin(rad))-picRadius
		itemX := mouseX + xOffset
		itemY := mouseY + yOffset
		itemNumber := itemsNbr<10 ? "0" . A_Index : A_Index
		Gui, %itemNumber%: Show, x%itemX% y%itemY% h%picSize% w%picSize%, Item%A_Index%
		WinSet, Transcolor, White 255, Item%A_Index%
	}
	SetTimer, GetSelectedItem, 15
}
Return
;########## End: Hotkey(s) ##########

;########## Start: Main labels ##########
RadialMenuClose:
If not (GetKeyState("RButton","P"))
{
	SetTimer, GetSelectedItem, off
	SetTimer, RadialMenuClose, off
	Loop, %itemsNbr%
	{
		itemNumber := itemsNbr<10 ? "0" . A_Index : A_Index
		Gui %itemNumber%:Hide
	}
	Gui 98:Hide
}
Return

GetSelectedItem:
Loop 
{
	If not GetKeyState("RButton", "P")
		Break
	MouseGetPos,,, WinID
	WinGetTitle, item, ahk_id %WinID%
	If InStr(item, "Item")
	{
		IniRead, itemToLaunch, %A_ScriptDir%\Settings.ini, Items, %item%, NULL
		itemToLaunch := (item=="Item98") ? "Cancel" : itemToLaunch
		ToolTip, %itemToLaunch%
		lastItem :=  item
		closeGuiX := mouseX-picRadius
		closeGuiY := mouseY-picRadius
		Gui, 98: Show, x%closeGuiX% y%closeGuiY% h%picSize% w%picSize%, Item98 ;Display the close item to cancel launching
		WinSet, Transcolor, White 255, Item98
	}
	Else
	{
		ToolTip
		item := ""
	}
}
ToolTip
item := lastItem
If (lastItem and itemToLaunch<>"NULL")
{
	If (item="Item98") ;Place mouse over the centered item to cancel launching
	{
		lastItem := ""
		Gui 98:Hide
		Exit
	}
	Run, %itemToLaunch%,, UseErrorLevel
	If	ErrorLevel
		MsgBox, Launching problem for :`n%itemToLaunch%
}
lastItem := ""
Return
;######## End: Main labels ##########

;######## Start: Settings labels ########
ShowSettingsGUI:
lastWheelRadius := wheelRadius ;Stores settings to get them back if they aren't in good ranges
lastItemsNbr := itemsNbr
lastBuildDelay := buildDelay
Gui, 99:Show, h75
Return

GetWheelRadius:
GuiControlGet, wheelRadius,, WRSlider
GuiControl,, RadiusEdit, %wheelRadius%
Gosub, CreateItems
Return

GetItemsNbr:
GuiControlGet, itemsNbr,, INSlider
GuiControl,, ItemsEdit, %itemsNbr%
Gosub, CreateItems
Return

GetBuildDelay:
GuiControlGet, buildDelay,, BDSlider
GuiControl,, DelayEdit, %buildDelay%
Return

GetSettings: ;<Set sliders positions if "Edits" are set manually and verify values>
GuiControlGet, wheelRadius,, RadiusEdit
GuiControlGet, itemsNbr,, ItemsEdit
GuiControlGet, buildDelay,, DelayEdit
If wheelRadius not between 50 and 200
	wheelRadius := lastWheelRadius
If itemsNbr not between 1 and 24
	itemsNbr := lastItemsNbr
If buildDelay not between 150 and 1000
	buildDelay := lastBuildDelay
GuiControl,, WRSlider, %wheelRadius%
GuiControl,, INSlider, %itemsNbr%
GuiControl,, BDSlider, %buildDelay%
GuiControl,, RadiusEdit, %wheelRadius%
GuiControl,, ItemsEdit, %itemsNbr%
GuiControl,, DelayEdit, %buildDelay%
Return

SaveSettings:
IniWrite, %wheelRadius%,% A_ScriptDir "\Settings.ini", Settings, wheelRadius
IniWrite, %itemsNbr%,% A_ScriptDir "\Settings.ini", Settings, itemsNbr
IniWrite, %buildDelay%,% A_ScriptDir "\Settings.ini", Settings, buildDelay
Return

99GuiClose:
Gosub, GetSettings
Sleep, 500
Gui, 99:Submit
Return
;######## End: Settings labels ########

Exit:
Gosub, SaveSettings
ExitApp
Return

The script is not complete but I think/hope it will help someone!

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

@doyle

Would it be worth creating a fade function?

Yes.

@netfun81
Nice mini radial :wink:

@TomXIII
:D :shock: :D I'm impressed with your work!
Gui placement depending on wheel radius and number of items is a must have for all further versions!
I totaly forgot those math functions Atan() Cos() Sin() :oops:

I was not using round buttons because you can generally put less text in them. However, i also created one version with round buttons. See link below.

Thx!!! I really like the concept!

Thank you!

Declaration

Unfortunately, I must say that that I won't be able to develop Radial menu scripts for a longer time (few weeks) :cry:
Now, it's up to you (AHK community) to continue development. Don't stop!
Remember, the ultimate goal is to make nice and functional radial menu in function form.
Check out TomXIII work (one post above); Gui placement depending on wheel radius and number of items. It is a must have for all further versions! Also check his .ini solution, etc...

I will share my last 2 experiments (emphasis was on aesthetics). They are coded quickly; bugs possible, some comments don't match...
http://www.autohotke...1beta 50x50.ahk
http://www.autohotke...50x50 round.ahk

:idea: Continue developing radial menu scripts and share your work! :idea:

.

TomXIII
  • Members
  • 182 posts
  • Last active: Feb 28 2011 11:42 PM
  • Joined: 14 Apr 2009
@Learning one : Thx for your last comment. Do you mind if I create a new post for the script remix (with a new script name)?!

I won't be able to develop Radial menu scripts for a longer time (few weeks)

Will you definitely stop scripting or just a pause?!


Update (00h53 GMT):
- Now you can use defined labels for items to launch
Ex: Google for <!-- m -->http://www.google.fr<!-- m --> (Item# wasn't really explicit)
- Maximum items number is automatically set to maximum lines in Ini file but minimum can be modified
- New bitmap for items

I also added my IniFunctions for ini files on my page, so please take a look at AutoHotkey.net/~TomXIII

@AHK Community: Keep scripting!

Please, visit my blog: TomXIII.wordpress

doyle
  • Members
  • 335 posts
  • Last active: Mar 02 2012 04:47 PM
  • Joined: 14 Nov 2007
I'd be happy to continue developing the script in the meantime LO, if you are ok with it.

I have a few ideas i'd like to try which I think would carry the script forward.

doyle
  • Members
  • 335 posts
  • Last active: Mar 02 2012 04:47 PM
  • Joined: 14 Nov 2007
@TOMXIII

I really like your version Tom.

Although I do like Learning Ones bounce effect. That really makes the app feel good.

Good work!

yourmumisone
  • Guests
  • Last active:
  • Joined: --
seriously, this script is amazing. such good programming. i have looked at others and can bearly understand them. this has good naming, good spacing and i cant find any faults with it. i didnt know such a basic program could be extended so far. i do hope you create alot more scripts for this program

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

Will you definitely stop scripting or just a pause?!

Just pause. Once when you are in, you can't stop. :wink:

@doyle
I'm glad to hear that! Continue developing the script!
I also like bounce effect - it makes the app feel good.

@yourmumisone
Thank you for kind words. (Here I speak in my and others name)

@ALL
I encourage everybody to continue developing the script(s).
I suggest you to post all your works in this topic (not to create special topic for your own Radial menu version)
In that way, we will:
- gain productivity and cooperation - everything connected with radial menu is here, in one place. You don't need to monitor multiple Radial menu topics...
- keep this topic near top of Scripts & Functions topic list, so more people will see it, and hopefully, more people will get involved in developing Radial menu


There is a statement in the 1. post of this topic:
You can also find some nice modifications and experiments from other AHK members here.
Just scroll this topic down...

netfun81
  • Members
  • 58 posts
  • Last active: Feb 21 2010 09:32 AM
  • Joined: 28 Oct 2006
I added some graphics to my "mini Radial" to make it look nicer. Its still as simple as ever.
Screenshot: Posted Image

You will need this graphic: http://www.autohotke...81/greenorb.png Copy it to the same folder as the script

#NoEnv 
SendMode Input
SetWorkingDir %A_ScriptDir%

CoordMode, Mouse, Screen 
Gui +ToolWindow +AlwaysOnTop -Caption
Gui, Color, EEAA99
Gui +LastFound 
WinSet, TransColor, EEAA99
pic:="greenorb.png"
color:="cGreen"
gui, font, s12, Arial bold

Gui  Add, Picture, gFirefox x80 y3 BackgroundTrans, %pic% 
Gui, Add, Text, %color% x92 y10 BackgroundTrans, F
Gui  Add, Picture, gSpider x45 y20 BackgroundTrans, %pic% 
Gui, Add, Text, %color% x55 y27 BackgroundTrans, G
Gui  Add, Picture, gExplorer x115 y20 BackgroundTrans, %pic% 
Gui, Add, Text, %color% x125 y27 BackgroundTrans, E
Gui  Add, Picture, gShtdown x28 y55 BackgroundTrans, %pic%
Gui, Add, Text, %color% x37 y62 BackgroundTrans, S
Gui  Add, Picture, gIE x132 y55 BackgroundTrans, %pic% 
Gui, Add, Text, %color% x146 y62 BackgroundTrans, I
Gui  Add, Picture, gLogoff x45 y90 BackgroundTrans, %pic% 
Gui, Add, Text, %color% x57 y97 BackgroundTrans, L
Gui  Add, Picture, gCcleaner x115 y90 BackgroundTrans, %pic% 
Gui, Add, Text, %color% x125 y97 BackgroundTrans, C
Gui  Add, Picture, gTaskmgr x80 y107 BackgroundTrans, %pic% 
Gui, Add, Text, %color% x90 y115 BackgroundTrans, T
Gui, show, w170 h150
Gui, hide
return

Ccleaner:
Run, C:\program files\ccleaner\ccleaner.exe
gui, hide
return

Explorer:
Run, explorer.exe c:\program files
gui, hide
return

Firefox:
Run, c:\program files\mozilla firefox\firefox.exe
gui, hide
return

Spider:
Run, c:\program files\microsoft games\spidersolitaire\spidersolitaire.exe
gui, hide
return

IE:
Run, c:\program files\internet explorer\iexplore.exe
gui, hide
return

Logoff:
gui, hide
MsgBox, 4, , Do you want to Logoff?
IfMsgBox No
return
else
shutdown, 0
return

Shtdown:
gui, hide
MsgBox, 4, , Do you want to Shutdown?
IfMsgBox No
return
else
shutdown, 1
return

Taskmgr:
Run, c:\windows\system32\taskmgr.exe
gui, hide
return

mbutton::
MouseGetPos, x, y
mgx:=x-95
mgy:=y-70
Gui Show, x%mgx% y%mgy%
Sleep 3000
gui, hide
return

mbutton & rbutton::
Send, !+{ESC}
WinRestore, A
return


notalone
  • Guests
  • Last active:
  • Joined: --
@netfun - nice new look to your mini radial. I like it, simple and works! I might try my hand at adding to the radial scripts.

Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009
I managed to catch some free time... :)
Two things are sure; Radial menu v3 will use:
- GDI+ (thanks tic and Lexikos)
- "Release to select" --> 1. click defined mouse button to show menu, 2. drag mouse on menu item 3. release mouse button to select item

I captured various Radial menu v3 skins over various backgrounds
and put them together in .png file. Here are the results:

Radial menu v3 preview
Radial menu v3 preview2
What do you think?

:wink:

horntail
  • Members
  • 69 posts
  • Last active: Jul 19 2010 06:20 PM
  • Joined: 03 Aug 2009
Looking good, cant wait for version 3 :D