Skip to content

Commit

Permalink
Moved CodeQuickTester.CreateMenuBar method to CreateMenus function
Browse files Browse the repository at this point in the history
  • Loading branch information
G33kDude committed Aug 18, 2017
1 parent 42322b7 commit 848f3ef
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
19 changes: 1 addition & 18 deletions lib/CQT.ahk
Expand Up @@ -52,7 +52,7 @@ class CodeQuickTester
Gui, New, +Resize +hWndhMainWindow -AlwaysOnTop
this.AlwaysOnTop := False
this.hMainWindow := hMainWindow
this.Menus := this.CreateMenuBar(Menus)
this.Menus := CreateMenus(Menus)
Gui, Menu, % this.Menus[1]
Gui, Margin, 5, 5

Expand Down Expand Up @@ -144,23 +144,6 @@ class CodeQuickTester
}
}

CreateMenuBar(Menu)
{
static MenuName := 0
Menus := ["CQT_" MenuName++]
for each, Item in Menu
{
Ref := Item[2]
if IsObject(Ref) && Ref._NewEnum()
{
SubMenus := this.CreateMenuBar(Ref)
Menus.Push(SubMenus*), Ref := ":" SubMenus[1]
}
Menu, % Menus[1], Add, % Item[1], %Ref%
}
return Menus
}

RunButton()
{
if (this.Exec.Status == 0) ; Running
Expand Down
17 changes: 17 additions & 0 deletions lib/Utils.ahk
Expand Up @@ -96,3 +96,20 @@ UriEncode(Uri, RE="[0-9A-Za-z]") {
Res .= (Chr:=Chr(Code)) ~= RE ? Chr : Format("%{:02X}", Code)
Return, Res
}

CreateMenus(Menu)
{
static MenuName := 0
Menus := ["Menu_" MenuName++]
for each, Item in Menu
{
Ref := Item[2]
if IsObject(Ref) && Ref._NewEnum()
{
SubMenus := CreateMenus(Ref)
Menus.Push(SubMenus*), Ref := ":" SubMenus[1]
}
Menu, % Menus[1], Add, % Item[1], %Ref%
}
return Menus
}

0 comments on commit 848f3ef

Please sign in to comment.