new ui complete

This commit is contained in:
Manuel Simon Hirsig
2016-01-26 19:36:34 +01:00
parent 077fe068f5
commit 66f5e8a61f
3 changed files with 108 additions and 6 deletions
+28 -2
View File
@@ -467,12 +467,12 @@ function public.on_load()
end
do
local label = Aux.gui.label(AuxFilterSearchFrameFiltersCategoryDropDown, 13)
label:SetPoint('BOTTOMLEFT', AuxFilterSearchFrameFiltersCategoryDropDown, 'TOPLEFT', 20, 1)
label:SetPoint('BOTTOMLEFT', AuxFilterSearchFrameFiltersCategoryDropDown, 'TOPLEFT', -2, -4)
label:SetText('Category')
end
do
local label = Aux.gui.label(AuxFilterSearchFrameFiltersQualityDropDown, 13)
label:SetPoint('BOTTOMLEFT', AuxFilterSearchFrameFiltersQualityDropDown, 'TOPLEFT', 20, 1)
label:SetPoint('BOTTOMLEFT', AuxFilterSearchFrameFiltersQualityDropDown, 'TOPLEFT', -2, -4)
label:SetText('Rarity')
end
do
@@ -630,6 +630,32 @@ function public.on_load()
label:SetPoint('BOTTOMLEFT', AuxFilterSearchFrameFiltersAllPagesCheckButton, 'TOPLEFT', 1, -3)
label:SetText('All')
end
-- TODO replace with real gui dropdown
-- CreateFrame('Frame', '$parentCategoryDropDown', AuxFilterSearchFrameFilters, 'UIDropDownMenuTemplate')
-- local dropdown = CreateFrame('Frame', '$parentQualityDropDown', AuxFilterSearchFrameFilters, 'UIDropDownMenuTemplate')
for _, dropdown in ipairs({AuxFilterSearchFrameFiltersCategoryDropDown, AuxFilterSearchFrameFiltersQualityDropDown}) do
dropdown:SetWidth(150)
dropdown:SetHeight(10)
dropdown:SetBackdrop({bgFile='Interface\\Buttons\\WHITE8X8', edgeFile='Interface\\Buttons\\WHITE8X8', edgeSize=Aux.gui.config.edge_size, insets={top=5,bottom=5}})
dropdown:SetBackdropColor(unpack(Aux.gui.config.content_color))
dropdown:SetBackdropBorderColor(unpack(Aux.gui.config.content_border_color))
local left = getglobal(dropdown:GetName()..'Left'):Hide()
local middle = getglobal(dropdown:GetName()..'Middle'):Hide()
local right = getglobal(dropdown:GetName()..'Right'):Hide()
local button = getglobal(dropdown:GetName()..'Button')
-- button:RegisterForClicks('AnyUp')
button:ClearAllPoints()
button:SetPoint('RIGHT', dropdown, 0, 0)
local text = getglobal(dropdown:GetName()..'Text')
text:ClearAllPoints()
text:SetPoint('RIGHT', button, 'LEFT', -2, 0)
text:SetPoint('LEFT', dropdown, 'LEFT', 8, 0)
text:SetFont(Aux.gui.config.content_font, 13)
text:SetShadowColor(0, 0, 0, 0)
end
end
function public.stop_search()
+4 -4
View File
@@ -22,10 +22,10 @@
</Scripts>
<Frames>
<Frame name="$parentCategoryDropDown" inherits="UIDropDownMenuTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-8" y="-56" /></Offset></Anchor></Anchors>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="14" y="-53" /></Offset></Anchor></Anchors>
<Scripts>
<OnLoad>
UIDropDownMenu_SetWidth(140)
<!--UIDropDownMenu_SetWidth(100)-->
UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersCategoryDropDown_Initialize)
</OnLoad>
<OnShow>
@@ -35,10 +35,10 @@
</Frame>
<Frame name="$parentQualityDropDown" inherits="UIDropDownMenuTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-8" y="-98" /></Offset></Anchor></Anchors>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="14" y="-93" /></Offset></Anchor></Anchors>
<Scripts>
<OnLoad>
UIDropDownMenu_SetWidth(140)
<!--UIDropDownMenu_SetWidth(100)-->
UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersQualityDropDown_Initialize)
</OnLoad>
<OnShow>
+76
View File
@@ -360,4 +360,80 @@ function m.CreateVerticalLine(parent, ofsx, relativeFrame, invertedColor)
TSMAPI.Design:SetContentColor(barTex)
end
return barTex
end
function m.dropdown()
local count = AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame", nil, UIParent)
local dropdown = CreateFrame("Frame", "TSMDropDown"..count, frame, "UIDropDownMenuTemplate")
frame:SetScript("OnHide", Dropdown_OnHide)
dropdown:ClearAllPoints()
dropdown:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -7, 0)
dropdown:SetScript("OnHide", nil)
dropdown:SetScript("OnEnter", Control_OnEnter)
dropdown:SetScript("OnLeave", Control_OnLeave)
dropdown:SetScript("OnMouseUp", function(self, button) Dropdown_TogglePullout(self.obj.button, button) end)
TSMAPI.Design:SetContentColor(dropdown)
local left = _G[dropdown:GetName().."Left"]
local middle = _G[dropdown:GetName().."Middle"]
local right = _G[dropdown:GetName().."Right"]
middle:ClearAllPoints()
right:ClearAllPoints()
middle:SetPoint("LEFT", left, "RIGHT", 0, 0)
middle:SetPoint("RIGHT", right, "LEFT", 0, 0)
right:SetPoint("TOPRIGHT", dropdown, "TOPRIGHT", 0, 17)
local button = _G[dropdown:GetName().."Button"]
button:RegisterForClicks("AnyUp")
button:SetScript("OnEnter", Control_OnEnter)
button:SetScript("OnLeave", Control_OnLeave)
button:SetScript("OnClick", Dropdown_TogglePullout)
button:ClearAllPoints()
button:SetPoint("RIGHT", dropdown, 0, 0)
local text = _G[dropdown:GetName().."Text"]
text:ClearAllPoints()
text:SetPoint("RIGHT", button, "LEFT", -2, 0)
text:SetPoint("LEFT", dropdown, "LEFT", 8, 0)
text:SetFont(TSMAPI.Design:GetContentFont("normal"))
text:SetShadowColor(0, 0, 0, 0)
local label = frame:CreateFontString(nil, "OVERLAY")
label:SetPoint("TOPLEFT", frame, "TOPLEFT", 0, 0)
label:SetPoint("TOPRIGHT", frame, "TOPRIGHT", 0, 0)
label:SetJustifyH("LEFT")
label:SetHeight(18)
label:SetFont(TSMAPI.Design:GetContentFont("small"))
label:SetShadowColor(0, 0, 0, 0)
label:Hide()
left:Hide()
middle:Hide()
right:Hide()
local widget = {
frame = frame,
label = label,
dropdown = dropdown,
text = text,
button = button,
count = count,
alignoffset = 30,
type = Type,
}
for method, func in pairs(methods) do
widget[method] = func
end
frame.obj = widget
dropdown.obj = widget
text.obj = widget
button.obj = widget
return AceGUI:RegisterAsWidget(widget)
end