Jump to content

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

Menu Editor


  • Please log in to reply
6 replies to this topic
Landvermesser
  • Members
  • 51 posts
  • Last active: Aug 12 2008 09:02 AM
  • Joined: 03 Nov 2004
Hi All,

here is a simply AHK Menu Editor.

;
; AutoHotkey Version: 1.0.23
; Language:       English
; Platform:       Win9x/XP
; Author:         Sven Karsten <[email protected]>
;
; Script Function:
;	Menu Editor script.
;

FileCopy,  %A_SCRIPTDIR%\menu.ini, %A_SCRIPTDIR%\menu.bak, 1
Flag = 0

Gui, Font, S8 CDefault, Arial
Gui, Add, Button, x596 y465 w100 h30 gGuiClose, Close%A_Space%
Gui, Add, ListBox, x16 y45 w600 h360, 
Gui, Add, Button, x636 y45 w60 h30 gUp, Up%A_Space%
Gui, Add, Button, x636 y85 w60 h30 gDown, Down%A_Space%
Gui, Add, Button, x16 y415 w100 h30 gAddNew, Add%A_Space%
Gui, Add, Button, x136 y415 w100 h30 gEditItem, Edit%A_Space%
Gui, Add, Button, x256 y415 w100 h30 gDeleteItem, Delete%A_Space%
Gui, Add, Button, x596 y415 w100 h30 gSaveTab, Save%A_Space%
Gui, Add, Button, x476 y465 w100 h30 gTest, Test%A_Space%
Gui, Font,, Courier
Gui, Add, Text, x16 y15 w60 h20 Disabled gMenu1, Menu1
Gui, Add, Text, x76 y15 w60 h20 Disabled gMenu2, Menu2
Gui, Add, Text, x136 y15 w60 h20 Disabled gMenu3, Menu3
Gui, Add, Text, x196 y15 w60 h20 Disabled gMenu4, Menu4
Gui, Add, Text, x256 y15 w60 h20 Disabled gMenu5, Menu5
Gui, Add, Text, x316 y15 w60 h20 Disabled gMenu6, Menu6
Gui, Add, Text, x376 y15 w60 h20 Disabled gMenu7, Menu7
Gui, Add, Text, x436 y15 w60 h20 Disabled gMenu8, Menu8
Gui, Add, Text, x496 y15 w60 h20 Disabled gMenu9, Menu9
Gui, Add, Text, x556 y15 w60 h20 Disabled gMenu10, Menu10
Gui, Show, Center h515 w715, Menu Editor

Gosub, MenuReading
Return

GuiEscape:
GuiClose:
ExitApp

MenuReading:
	SetEnv, ItemsList, µ
	IniRead, MenusCount, %A_WorkingDir%\menu.ini, Menus, MenusCount
	SetFormat, float, 03.0
	StringNum += 00.0
	IfEqual, MenusCount, ERROR
		{
		FileAppend,%StringNum% New Item|, %A_WorkingDir%\ItemsList.tmp
		StringReplace, ItemsList, ItemsList, µ, %StringNum% New Item|µ
		GuiControl, , ListBox1, %StringNum% New Item|
		StringReplace, ItemsList, ItemsList, µ,
		Return
		}
	SetFormat, float, 03.0
	StringNum += 00.0
	Loop, %MenusCount%
		{
		IniRead, ItemsCount, %A_WorkingDir%\menu.ini, Menu%A_Index%, ItemsCount
		IniRead, MenuName, %A_WorkingDir%\menu.ini, Menu%A_Index%, Menu%A_Index%Name
		IniRead, MenuAlias, %A_WorkingDir%\menu.ini, Menu%A_Index%, Menu%A_Index%Alias
		StringNum += 01.0
		StringReplace, ItemsList, ItemsList, µ, %StringNum% %MenuAlias% (%MenuName%)|µ
		MenuNum = %A_Index%
		Loop, %ItemsCount%
			{
			IniRead, Item%A_Index%Name, %A_WorkingDir%\menu.ini, Menu%MenuNum%, Item%A_Index%Name
			IniRead, Item%A_Index%Label, %A_WorkingDir%\menu.ini, Menu%MenuNum%, Item%A_Index%Label
			StringNum += 1.0
			IfEqual, Item%A_Index%Name, Separator
				{
				StringReplace, ItemsList, ItemsList, µ, %StringNum%     ------------|µ
				}
			Else
				{
				StringTrimRight, ItemName,  Item%A_Index%Name, 0
				StringReplace, ItemName, ItemName, %A_Tab%%A_Tab%, %A_Tab%, all
				StringReplace, ItemName, ItemName, %A_Tab%, ->, all
				StringTrimRight, ItemLabel,  Item%A_Index%Label, 0
				IfEqual, ItemLabel, 0, SetEnv, ItemLabel, Disable
				IniRead, ItemHotkey, %A_WorkingDir%\menu.ini, Menu%MenuNum%, Item%A_Index%Hotkey
				StringReplace, ItemsList, ItemsList, µ, %StringNum%     %ItemName%`, Label`: %ItemLabel%`, Hotkey`: %ItemHotkey%|µ
				}
			}
		}
	StringReplace, ItemsList, ItemsList, µ,
	GuiControl, , ListBox1, %ItemsList%
	StringSplit, MenuArray, ItemsList, |
	Return
	
Up:
	GuiControlGet, CurrentString, , ListBox1
	IfEqual, CurrentString,
		{
		MsgBox, 0, Menu Editor, No items selected! Please select any item and retry...
		Return
		}
	IfEqual, CurrentString, %MenuArray1%
		{
		MsgBox, 0, Menu Editor, Impossible move up! Command aborted...
		Return
		}
	Loop, %MenuArray0%
		{
		IfEqual, MenuArray%A_Index%, %CurrentString%
			{
			SetEnv, Index, %A_Index%
			Index--
			StringTrimLeft, MenuArrayIndex,  MenuArray%Index%, 0
			SetEnv, TempString, %MenuArrayIndex%
			SetEnv, MenuArray%Index%, %CurrentString%
			Index++
			SetEnv, MenuArray%Index%, %TempString%
			GuiControl, , ListBox1, |
			SetEnv, ItemsList, µ
			Loop, %MenuArray0%
				{
				StringTrimLeft, MenuArrayA_Index,  MenuArray%A_Index%, 0
				GuiControl, , ListBox1, %MenuArrayA_Index%
				StringReplace, ItemsList, ItemsList, µ, %MenuArrayA_Index%|µ
				}
			StringReplace, ItemsList, ItemsList, µ,
			GuiControl, ChooseString, ListBox1, %CurrentString%
			Return
			}
		}
	Return
	
Down:
	GuiControlGet, CurrentString, , ListBox1
	IfEqual, CurrentString,
		{
		MsgBox, 0, Menu Editor, No items selected! Please select any item and retry...
		Return
		}
	StringTrimLeft, MenuArrayLast,  MenuArray%MenuArray0%, 0
	IfEqual, CurrentString, %MenuArrayLast%
		{
		MsgBox, 0, Menu Editor, Impossible move down! Command aborted...
		Return
		}
	Loop, %MenuArray0%
		{
		IfEqual, MenuArray%A_Index%, %CurrentString%
			{
			SetEnv, Index, %A_Index%
			Index++
			StringTrimLeft, MenuArrayIndex,  MenuArray%Index%, 0
			SetEnv, TempString, %MenuArrayIndex%
			SetEnv, MenuArray%Index%, %CurrentString%
			Index--
			SetEnv, MenuArray%Index%, %TempString%
			GuiControl, , ListBox1, |
			SetEnv, ItemsList, µ
			Loop, %MenuArray0%
				{
				StringTrimLeft, MenuArrayA_Index,  MenuArray%A_Index%, 0
				GuiControl, , ListBox1, %MenuArrayA_Index%
				StringReplace, ItemsList, ItemsList, µ, %MenuArrayA_Index%|µ
				}
			StringReplace, ItemsList, ItemsList, µ,
			GuiControl, ChooseString, ListBox1, %CurrentString%
			Return
			}
		}
	Return
	
AddNew:
	GuiControlGet, CurrentString, , ListBox1
	IfEqual, CurrentString,
		{
		MsgBox, 0, Menu Editor, No items selected! Please select desire place to add new item and retry...
		Return
		}
	StringReplace, ItemsList, ItemsList, ||, |, all
	StringNum += 01.0
	StringReplace, ItemsList, ItemsList, %CurrentString%|, %CurrentString%|%StringNum%     New Item|
	GuiControl, , ListBox1, |
	GuiControl, , ListBox1, %ItemsList%
	StringSplit, MenuArray, ItemsList, |
	GuiControl, ChooseString, ListBox1, %StringNum%     New Item
	Return

DeleteItem:
	GuiControlGet, CurrentString, , ListBox1
	IfEqual, CurrentString,
		{
		MsgBox, 0, Menu Editor, No items selected! Please select item to delete and retry...
		Return
		}
	StringReplace, ItemsList, ItemsList, ||, |, all
	StringReplace, ItemsList, ItemsList, %CurrentString%|,
	GuiControl, 1:, ListBox1, |
	GuiControl, 1:, ListBox1, %ItemsList%
	StringSplit, MenuArray, ItemsList, |
	Return
	
EditWindow:
	Gui, 2:Font,  S8 CDefault, Arial
	Gui, 2:Add, Text, x16 y18 w70 h20, Items Typ:
	Gui, 2:Add, DropDownList, x96 y15 w280 h20 gSelArt, Separator||Main Menu|Menu Item
	Gui, 2:Add, Text, x16 y58 w70 h20, Label:	 
	Gui, 2:Add, Text, x16 y98 w70 h20, Items Name:
	Gui, 2:Add, Edit, x96 y95 w180 h20,
	Gui, 2:Add, Edit, x296 y95 w80 h20,
	Gui, 2:Add, Edit, x96 y155 w280 h20 Hidden, 
	Gui, 2:Font,  S10 CDefault, Wingdings
	Gui, 2:Add, Text, Center x276 y98 w20 h20, ð
	Gui, 2:Font,  S8 CDefault, Arial
	Gui, 2:Add, Text, x16 y198 w70 h20, Hotkey:
	Gui, 2:Add, Checkbox, x96 y191 w60 h30, Shift
	Gui, 2:Add, Checkbox, x156 y191 w50 h30, Ctrl
	Gui, 2:Add, Checkbox, x206 y191 w50 h30, Alt
	Gui, 2:Add, Checkbox, x256 y191 w60 h30, Win
	Gui, 2:Add, Edit, x316 y195 w60 h20,
	Gui, 2:Add, Checkbox, x96 y215 w280 h30, Check to replace Windows standart hotkey
	Gui, 2:Add, Edit, x96 y55 w280 h20,
	Gui, 2:Add, Button, x396 y15 w100 h30 gOKButton2, OK%A_Space%
	Gui, 2:Add, Button, x396 y55 w100 h30 gCancelButton2, Cancel%A_Space%
	Gui, 2:Show, Center h240 w515, Edit Menu Item
	Return

SelArt:
	GuiControlGet, CurrentSelect, , ComboBox1
	IfEqual, CurrentSelect, Separator
		{
		Control, Disable,, Edit5, Edit Menu Item
		Control, Disable,, Edit1, Edit Menu Item
		Gosub, Disabling
		}
	IfEqual, CurrentSelect, Main Menu
		{
		Control, Disable,, Edit5, Edit Menu Item
		Control, Enable,, Edit1, Edit Menu Item
		Gosub, Disabling
		}
	IfEqual, CurrentSelect, Menu Item
		{
		Control, Enable,, Edit5, Edit Menu Item
		Control, Enable,, Edit1, Edit Menu Item
		Control, Enable,, Edit2, Edit Menu Item
		Control, Enable,, Edit3, Edit Menu Item
		Control, Enable,, Button1, Edit Menu Item
		Control, Enable,, Button2, Edit Menu Item
		Control, Enable,, Button3, Edit Menu Item
		Control, Enable,, Button4, Edit Menu Item
		Control, Enable,, Edit4, Edit Menu Item
		Control, Enable,, Button5, Edit Menu Item
		}
	Return

CancelButton2:
2GuiClose:
	Gui, 2:Destroy
	Return
	
EditItem:
	GuiControlGet, CurrentString, , ListBox1
	IfEqual, CurrentString,
		{
		MsgBox, 0, Menu Editor, No items selected! Please select item to edit and retry...
		Return
		}
	Gosub, EditWindow
	Gosub, Initialize
	Return
	
Initialize:
	IfInString, CurrentString, ------------
		{
		Control, ChooseString, Separator, ComboBox1, Edit Menu Item
		Control, Disable,, Edit5, Edit Menu Item
		Control, Disable,, Edit1, Edit Menu Item
		Gosub, Disabling
		Return
		}
	IfInString, CurrentString, %A_Space%%A_Space%%A_Space%%A_Space%%A_Space%
		{
		Control, ChooseString, Menu Item, ComboBox1, Edit Menu Item
		StringSplit, IterA, CurrentString, `,
		StringSplit, IterB, IterA2, %A_Space%
		ControlSetText, Edit5, %IterB3%, Edit Menu Item
		StringReplace, IterA1, IterA1, %A_Space%%A_Space%%A_Space%%A_Space%%A_Space%, µ
		StringReplace, IterA1, IterA1, ->, µ
		IterC3 =
		StringSplit, IterC, IterA1, µ
		ControlSetText, Edit1, %IterC2%, Edit Menu Item
		ControlSetText, Edit2, %IterC3%, Edit Menu Item
		IfInString, IterA3, Shift, Control, Check,, Button1, Edit Menu Item
		IfInString, IterA3, Ctrl, Control, Check,, Button2, Edit Menu Item
		IfInString, IterA3, Alt, Control, Check,, Button3, Edit Menu Item
		IfInString, IterA3, Win, Control, Check,, Button4, Edit Menu Item
		IfInString, IterA3, $, Control, Check,, Button5, Edit Menu Item
		StringRight, Letter, IterA3, 4
		If Letter = None
			Return
		StringRight, Letter, IterA3, 1
		ControlSetText, Edit4, %Letter%, Edit Menu Item
		Return
		}
	IfInString, CurrentString, %A_Space%(Menu
		{
		Control, ChooseString, Main Menu, ComboBox1, Edit Menu Item
		Control, Disable,, Edit5, Edit Menu Item
		Gosub, Disabling
		StringSplit, CurrentStringArray, CurrentString, %A_Space%
		ControlSetText, Edit1, %CurrentStringArray2%, Edit Menu Item
		Return
		}
	Return
	
Disabling:
	Control, Disable,, Edit2, Edit Menu Item
	Control, Disable,, Edit3, Edit Menu Item
	Control, Disable,, Button1, Edit Menu Item
	Control, Disable,, Button2, Edit Menu Item
	Control, Disable,, Button3, Edit Menu Item
	Control, Disable,, Button4, Edit Menu Item
	Control, Disable,, Edit4, Edit Menu Item
	Control, Disable,, Button5, Edit Menu Item
	Return
	
OKButton2:
	StringLeft, CurrentNum, CurrentString, 3
	ControlGet, ActiveSelect, Choice,, ComboBox1, Edit Menu Item
	IfEqual, ActiveSelect, Separator
		{
		OutputString = %CurrentNum%     ------------
		}
	IfEqual, ActiveSelect, Main Menu
		{
		MenusCount++
		ControlGetText, OutputName, Edit1, Edit Menu Item
		StringSplit, NameArray, OutputName, %A_Space%
		OutputString = %CurrentNum% %NameArray1% (Menu%MenusCount%)
		}
	IfEqual, ActiveSelect, Menu Item
		{
		ControlGetText, OutputName, Edit1, Edit Menu Item
		ControlGetText, OutputExt, Edit2, Edit Menu Item
		ControlGettext, OutputLabel, Edit5, Edit Menu Item
		IfEqual, OutputLabel,, SetEnv, OutputLabel, Disable
		ControlGetText, OutputLetter, Edit4, Edit Menu Item
		IfNotEqual, OutputLetter,
			{
			ControlGet, CheckShift, Checked, , Button1, Edit Menu Item
			OutputShift =
			IfEqual, CheckShift, 1, SetEnv, OutputShift, Shift+
			ControlGet, CheckCtrl, Checked, , Button2, Edit Menu Item
			OutputCtrl =
			IfEqual, CheckCtrl, 1, SetEnv, OutputCtrl, Ctrl+
			ControlGet, CheckAlt, Checked, , Button3, Edit Menu Item
			OutputAlt =
			IfEqual, CheckAlt, 1, SetEnv, OutputAlt, Alt+
			ControlGet, CheckWin, Checked, , Button4, Edit Menu Item
			OutputWin =
			IfEqual, CheckWin, 1, SetEnv, OutputWin, Win+
			ControlGet, Check$, Checked, , Button5, Edit Menu Item
			Output$ =
			IfEqual, Check$, 1, SetEnv, Output$, $
			}
		else
			{
			OutputLetter = None
			}
		OutputString = %CurrentNum%     %OutputName%->%OutputExt%`, Label`: %OutputLabel%`, Hotkey`: %Output$%%OutputCtrl%%OutputShift%%OutputAlt%%OutputWin%%OutputLetter%
		IfEqual, OutputExt,,	StringReplace, OutputString, OutputString, ->,, all
		}
	StringReplace, ItemsList, ItemsList, ||, |, all
	StringReplace, ItemsList, ItemsList, %CurrentString%|, %OutputString%|
	GuiControl, 1:, ListBox1, |
	GuiControl, 1:, ListBox1, %ItemsList%
	StringSplit, MenuArray, ItemsList, |
	GuiControl, 1:ChooseString, ListBox1, %OutputString%
	Gosub, 2GuiClose
	Return
	
SaveTab:
	MenusTempCount = 0
	Loop, %MenuArray0%
		{
		IfInString, MenuArray%A_Index%, %A_Space%(Menu
			{
			StringTrimLeft, MenuArrayA_Index,  MenuArray%A_Index%, 0
			StringSplit, TempArray, MenuArrayA_Index, %A_Space%
			MenusTempCount++
			ItemsTempCount = 0
			IniWrite, %TempArray2%, %A_WorkingDir%\Menu.ini, Menu%MenusTempCount%, Menu%MenusTempCount%Alias
			IniWrite, Menu%MenusTempCount%, %A_WorkingDir%\Menu.ini, Menu%MenusTempCount%, Menu%MenusTempCount%Name
			}
		IfInString, MenuArray%A_Index%, ------------
			{
			ItemsTempCount++
			IniWrite, Separator, %A_WorkingDir%\Menu.ini, Menu%MenusTempCount%, Item%ItemsTempCount%Name
			IniWrite, None, %A_WorkingDir%\Menu.ini, Menu%MenusTempCount%, Item%ItemsTempCount%Label
			IniWrite, None, %A_WorkingDir%\Menu.ini, Menu%MenusTempCount%, Item%ItemsTempCount%Hotkey			
			}
		IfInString, MenuArray%A_Index%, Label`:
			{
			ItemsTempCount++
			StringTrimLeft, MenuArrayA_Index,  MenuArray%A_Index%, 8
			StringReplace, MenuArrayA_Index, MenuArrayA_Index, `,%A_Space%, µ, all
			StringReplace, MenuArrayA_Index, MenuArrayA_Index, `:%A_Space%, µ, all
			StringReplace, MenuArrayA_Index, MenuArrayA_Index, ->, %A_Tab%
			StringSplit, TempArray, MenuArrayA_Index, µ
			IniWrite, %TempArray1%, %A_WorkingDir%\Menu.ini, Menu%MenusTempCount%, Item%ItemsTempCount%Name
			IniWrite, %TempArray3%, %A_WorkingDir%\Menu.ini, Menu%MenusTempCount%, Item%ItemsTempCount%Label
			IfInString, TempArray3, Disable, IniWrite, 0, %A_WorkingDir%\Menu.ini, Menu%MenusTempCount%, Item%ItemsTempCount%Label
			IniWrite, %TempArray5%, %A_WorkingDir%\Menu.ini, Menu%MenusTempCount%, Item%ItemsTempCount%Hotkey	
			}
		IniWrite, %ItemsTempCount%, %A_WorkingDir%\Menu.ini, Menu%MenusTempCount%, ItemsCount
		}
	IniWrite, %MenusTempCount%, %A_WorkingDir%\Menu.ini, Menus, MenusCount
	Return
	
Test:
	IfEqual, Flag, 0, Gosub, SaveTab
	IfEqual, Flag, 0, Gosub, MenuDrawing
	Gosub, DrawTestMenu
	Return
	
; Copy/Paste marked code to your script to get menus.
; ====== Start cut here ======

MenuDrawing:
	IniRead, MenusCount, %A_WorkingDir%\menu.ini, Menus, MenusCount
	Loop, %MenusCount%
		{
		IniRead, ItemsCount, %A_WorkingDir%\menu.ini, Menu%A_Index%, ItemsCount
		IniRead, MenuName, %A_WorkingDir%\menu.ini, Menu%A_Index%, Menu%A_Index%Name
		MenuNum = %A_Index%
		Loop, %ItemsCount%
			{
			IniRead, Item%A_Index%Name, %A_WorkingDir%\menu.ini, Menu%MenuNum%, Item%A_Index%Name
			IniRead, Item%A_Index%Label, %A_WorkingDir%\menu.ini, Menu%MenuNum%, Item%A_Index%Label
			IfEqual, Item%A_Index%Name, Separator
				{
				Menu, %MenuName%, Add
				}
			Else
				{
				StringTrimRight, ItemName,  Item%A_Index%Name, 0
				StringTrimRight, ItemLabel,  Item%A_Index%Label, 0
				Menu, %MenuName%, Add, %ItemName%, Label ;		Change the word "Label" to %ItemLabel% 
				IfInString, %ItemLabel%, 0, Menu, %MenuName%, Disable, %ItemName%
				IniRead, Item%A_Index%Hotkey, %A_WorkingDir%\menu.ini, Menu%MenuNum%, Item%A_Index%Hotkey
				IfNotEqual, Item%A_Index%Hotkey, None
					{
					StringReplace, Item%A_Index%Hotkey, Item%A_Index%Hotkey, Ctrl+, `^
					StringReplace, Item%A_Index%Hotkey, Item%A_Index%Hotkey, Shift+, `+
					StringReplace, Item%A_Index%Hotkey, Item%A_Index%Hotkey, Alt+, `!
					StringReplace, ItemHotkey, Item%A_Index%Hotkey, Win+, `#
					HotKey, %ItemHotkey%, Label ;		Change the word "Label" to %ItemLabel%
					}
				}
			}
		}
	Return

; ====== End cut here ======

Label:
	Return
	
DrawTestMenu:
	ControlGetPos, Sum,,,, Static1, Menu Editor
	Loop, 10
		{
		ControlSetText, Static%A_Index%, Menu%A_Index%, Menu Editor
		Control, Disable,, Static%A_Index%, Menu Editor
		IfEqual, Flag, 0
			IniRead, MenuAlias, %A_WorkingDir%\menu.ini, Menu%A_Index%, Menu%A_Index%Alias, Menu%A_Index%
		Else
			MenuAlias = Menu%A_Index%
		StringLen, AliasLength, MenuAlias
		AliasLength *= 9
		AliasLength += 15
		ControlMove, Static%A_Index%, %Sum%,,%AliasLength%,, Menu Editor
		PosArray%A_Index% = %Sum%
		Sum += %AliasLength%
		ControlSetText, Static%A_Index%, %MenuAlias%, Menu Editor
		IfEqual, Flag, 0
			IfLessOrEqual, A_Index, %MenusCount%, Control, Enable,, Static%A_Index%, Menu Editor
		Else
			Control, Disable,, Static%A_Index%, Menu Editor
		}
	Flag++
	ControlSetText, Button8, Stop%A_Space%, Menu Editor
	Control, Disable,, ListBox1
	Control, Disable,, Button2, Menu Editor
	Control, Disable,, Button3, Menu Editor
	Control, Disable,, Button4, Menu Editor
	Control, Disable,, Button5, Menu Editor
	Control, Disable,, Button6, Menu Editor
	IfEqual, Flag, 2
		{
		SetEnv, Flag, 0
		ControlSetText, Button8, Test%A_Space%, Menu Editor
		Loop, %MenusCount%
			{
			Menu, Menu%A_Index%, DeleteAll
			}
		Control, Enable,, ListBox1, Menu Editor
		Control, Enable,, Button2, Menu Editor
		Control, Enable,, Button3, Menu Editor
		Control, Enable,, Button4, Menu Editor
		Control, Enable,, Button5, Menu Editor
		Control, Enable,, Button6, Menu Editor
		}
	Return
	
Menu1:
	Menu, Menu1, Show, %PosArray1%, 53
	Return
	
Menu2:
	Menu, Menu2, Show, %PosArray2%, 53
	Return
	
Menu3:
	Menu, Menu3, Show, %PosArray3%, 53
	Return
	
Menu4:
	Menu, Menu4, Show, %PosArray4%, 53
	Return
	
Menu5:
	Menu, Menu5, Show, %PosArray5%, 53
	Return
	
Menu6:
	Menu, Menu6, Show, %PosArray6%, 53
	Return
	
Menu7:
	Menu, Menu6, Show, %PosArray7%, 53
	Return
	
Menu8:
	Menu, Menu6, Show, %PosArray8%, 53
	Return
	
Menu9:
	Menu, Menu6, Show, %PosArray9%, 53
	Return
	
Menu10:
	Menu, Menu6, Show, %PosArray10%, 53
	Return

and a example of the ini-file (menu.ini)

[Menus]
MenusCount=6

[Menu1]
Menu1Alias=File
Menu1Name=Menu1
ItemsCount=19
Item1Name=New Finder Window	Ctrl+N
Item1Label=NewFinderWindow
Item1Hotkey=Ctrl+n
Item2Name=New Folder	Shift+Ctrl+N
Item2Label=NewFolder
Item2Hotkey=Ctrl+Shift+n
Item3Name=Open	Ctrl+O
Item3Label=Open
Item3Hotkey=Ctrl+o
Item4Name=Close Window	Ctrl+W
Item4Label=CloseWindow
Item4Hotkey=Ctrl+w
Item5Name=Separator
Item5Label=None
Item5Hotkey=None
Item6Name=Show Info	Ctrl+I
Item6Label=ShowInfo
Item6Hotkey=Ctrl+i
Item7Name=Separator
Item7Label=None
Item7Hotkey=None
Item8Name=Duplicate	Ctrl+D
Item8Label=Duplicate
Item8Hotkey=Ctrl+d
Item9Name=Make Alias	Ctrl+L
Item9Label=MakeAlias
Item9Hotkey=Ctrl+l
Item10Name=Show Original	Ctrl+R
Item10Label=0
Item10Hotkey=None
Item11Name=Add To Favorites	Ctrl+T
Item11Label=AddToFavorites
Item11Hotkey=Ctrl+t
Item12Name=Separator
Item12Label=None
Item12Hotkey=None
Item13Name=Move To Trash
Item13Label=MoveToTrash
Item13Hotkey=None	
Item14Name=Eject	Ctrl+E
Item14Label=Eject
Item14Hotkey=Ctrl+e
Item15Name=Separator
Item15Label=None
Item15Hotkey=None
Item16Name=Find	Ctrl+F
Item16Label=Find
Item16Hotkey=Ctrl+f
Item17Name=Separator
Item17Label=None
Item17Hotkey=None
Item18Name=Restart...
Item18Label=Restart
Item18Hotkey=None
Item19Name=Shut Down...
Item19Label=ShutDown
Item19Hotkey=None

[Menu2]
Menu2Alias=Edit
Menu2Name=Menu2
ItemsCount=8
Item1Name=Undo	Ctrl+Z
Item1Label=Undo
Item1Hotkey=$Ctrl+z
Item2Name=Separator
Item2Label=None
Item2Hotkey=None
Item3Name=Cut	Ctrl+X
Item3Label=Cut
Item3Hotkey=$Ctrl+x
Item4Name=Copy	Ctrl+C
Item4Label=Copy
Item4Hotkey=$Ctrl+c
Item5Name=Paste	Ctrl+V
Item5Label=Paste
Item5Hotkey=$Ctrl+v
Item6Name=Select All	Ctrl+A
Item6Label=SelectAll
Item6Hotkey=$Ctrl+a
Item7Name=Separator
Item7Label=None
Item7Hotkey=None
Item8Name=Show Clipboard	
Item8Label=ShowClipboard
Item8Hotkey=None

[Menu3]
Menu3Alias=View
Menu3Name=Menu3
ItemsCount=12
Item1Name=as Columns	Ctrl+1
Item1Label=asColumns
Item1Hotkey=Ctrl+1
Item2Name=as Icons	Ctrl+2
Item2Label=asIcons
Item2Hotkey=Ctrl+2
Item3Name=as List	Ctrl+3
Item3Label=asList
Item3Hotkey=Ctrl+3
Item4Name=Separator
Item4Label=None
Item4Hotkey=None
Item5Name=Clean Up
Item5Label=CleanUp
Item5Hotkey=None
Item6Name=Arrange By Name
Item6Label=ArrangeByName
Item6Hotkey=None
Item7Name=Separator
Item7Label=None
Item7Hotkey=None
Item8Name=Hide Toolbar	Ctrl+B
Item8Label=0
Item8Hotkey=Ctrl+b
Item9Name=Customize Toolbar...
Item9Label=CustomizeToolbar
Item9Hotkey=None
Item10Name=Show/Hide tray Icon
Item10Label=ShowTrayIcon
Item10Hotkey=None
Item11Name=Separator
Item11Label=None
Item11Hotkey=None
Item12Name=Show View Options	Ctrl+J
Item12Label=0
Item12Hotkey=Ctrl+j

[Menu4]
Menu4Alias=Go
Menu4Name=Menu4
ItemsCount=11
Item1Name=Computer	Shift+Ctrl+C	
Item1Label=GoComputer
Item1Hotkey=Ctrl+Shift+c
Item2Name=Home	Shift+Ctrl+H
Item2Label=GoHome
Item2Hotkey=Ctrl+Shift+h
Item3Name=iDisk	Shift+Ctrl+I
Item3Label=0
Item3Hotkey=Ctrl+Shift+i
Item4Name=Favorites	Shift+Ctrl+F
Item4Label=GoFavorites
Item4Hotkey=Ctrl+Shift+f
Item5Name=Applications	Shift+Ctrl+A
Item5Label=GoApplications
Item5Hotkey=Ctrl+Shift+a
Item6Name=System Preferences...
Item6Label=SystemPreferences
Item6Hotkey=None
Item7Name=Separator
Item7Label=None
Item1Hotkey=None
Item8Name=Recent Folders
Item8Label=0
Item8Hotkey=None
Item9Name=Go To Folder...	Ctrl+G
Item9Label=GoToFolder
Item9Hotkey=Ctrl+g
Item10Name=Separator
Item10Label=None
Item10Hotkey=None
Item11Name=Connect To Server	Ctrl+K
Item11Label=ConnectToServer
Item11Hotkey=Ctrl+k
Item7Hotkey=None

[Menu5]
Menu5Alias=Window
Menu5Name=Menu5
ItemsCount=7
Item1Name=Close Window	Ctrl+W
Item1Label=CloseWindow
Item1Hotkey=Ctrl+w
Item2Name=Roll Window	Ctrl+R
Item2Label=RollWindow
Item2Hotkey=Ctrl+r
Item3Name=Minimize Window	Ctrl+M
Item3Label=MinimizeWindow
Item3Hotkey=Ctrl+m
Item4Name=Show Log Window
Item4Label=ShowLogWindow
Item4Hotkey=None
Item5Name=Separator
Item5Label=None
Item5Hotkey=None
Item6Name=Minimize All
Item6Label=MinimizeAllWindows
Item6Hotkey=None
Item7Name=Bring All To Front
Item7Label=RestoreAllWindows
Item7Hotkey=None

[Menu6]
Menu6Alias=Help
Menu6Name=Menu6
ItemsCount=3
Item1Name=Mac Help
Item1Label=MacHelp
Item1Hotkey=None
Item2Name=About This Mac
Item2Label=AboutThisMac
Item2Hotkey=None
Item3Name=About Finderbar
Item3Label=AboutFinderbar
Item3Hotkey=None

Please your opinions. Thanks.

8)

BoBo
  • Guests
  • Last active:
  • Joined: --
Amazing :D

Landvermesser
  • Members
  • 51 posts
  • Last active: Aug 12 2008 09:02 AM
  • Joined: 03 Nov 2004
I would like to know, whether has sense to improve this technique or complete support of standard menus will be already in following version AutoHotKey? In other words, whether this program like SmartGUI is necessary for a community?

BoBo
  • Guests
  • Last active:
  • Joined: --
Maybe you should reopen that thread combined with a poll ?
Unfortunately I'm a CMDline type of guy, so MHO isn't really representative. :p

BTBH any effort you make to enhance your skills (I assume you've started that proj because it was a challenge 8) ), with the side effect of a benefit for the community - yes indeed! Keep up that excellent work.

:wink:

BTW: have you found a way to use cyrillic fonts/characters with AHK ?

Landvermesser
  • Members
  • 51 posts
  • Last active: Aug 12 2008 09:02 AM
  • Joined: 03 Nov 2004

BTBH any effort you make to enhance your skills (I assume you've started that proj because it was a challenge 8) ), with the side effect of a benefit for the community - yes indeed! Keep up that excellent work.


This editor of the menu is a part of my project "Finderbar" http://landvermesser.tripod.com/
Unfortunately, Finderbars users are not " CMDline type of guys ", also require the visual editor. I plan to add support of the submenu. In parallel I can finish the editor for AHK community too.

BTW: have you found a way to use cyrillic fonts/characters with AHK ?


Actually I searched for a way to insert special symbols of the Mac OS X in the AHK menus. I had to make a special font in which the necessary symbols had numbers less as 256.

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

I would like to know, whether has sense to improve this technique or complete support of standard menus will be already in following version AutoHotKey? In other words, whether this program like SmartGUI is necessary for a community?

Since there is no plan to add a wysiwyg menu editor to AutoHotkey, a script like this might definitely be useful to those wishing to build elaborate menus. Thanks for sharing your work.

Landvermesser
  • Members
  • 51 posts
  • Last active: Aug 12 2008 09:02 AM
  • Joined: 03 Nov 2004
OK, Chris, then I'll continue to work with this program. Thanks!

:)