right click menu for saved searches

This commit is contained in:
Manuel Simon Hirsig
2016-11-11 20:41:18 +01:00
parent 001883ca40
commit 077b18e3b6
2 changed files with 29 additions and 46 deletions
+8 -20
View File
@@ -95,27 +95,15 @@ do
end
do
local menu = CreateFrame('Frame', unique_name, UIParent, 'UIMenuTemplate')
local orig = menu:GetScript'OnShow'
local structure = T
menu:SetScript('OnShow', function()
UIMenu_Initialize()
for i = 1, getn(structure), 2 do
UIMenu_AddButton(
structure[i],
nil,
structure[i + 1]
)
end
return orig()
end)
local menu = CreateFrame('Frame', unique_name, UIParent, 'UIDropDownMenuTemplate')
M.menu = vararg-function(arg)
static(arg)
structure = arg
local x, y = GetCursorPosition()
menu:ClearAllPoints()
menu:SetPoint('BOTTOMLEFT', x + 75, y)
menu:Show()
HideDropDownMenu(1)
UIDropDownMenu_Initialize(menu, function()
for i = 1, getn(arg), 2 do
UIDropDownMenu_AddButton(O('text', arg[i], 'notCheckable', true, 'func', arg[i + 1]))
end
end, 'MENU')
ToggleDropDownMenu(1, nil, menu, 'cursor')
end
end