comparison Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua @ 18:a0dcdcaec1ea v7.3.0.018

- toc update. - libs update.
author Tercio
date Tue, 17 Oct 2017 10:02:01 -0200
parents ce416064d8a1
children
comparison
equal deleted inserted replaced
17:da84a5064a5a 18:a0dcdcaec1ea
1 --[[----------------------------------------------------------------------------- 1 --[[-----------------------------------------------------------------------------
2 TreeGroup Container 2 TreeGroup Container
3 Container that uses a tree control to switch between groups. 3 Container that uses a tree control to switch between groups.
4 -------------------------------------------------------------------------------]] 4 -------------------------------------------------------------------------------]]
5 local Type, Version = "TreeGroup", 36 5 local Type, Version = "TreeGroup", 40
6 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) 6 local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end 7 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 8
9 -- Lua APIs 9 -- Lua APIs
10 local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type 10 local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type
210 self:Fire("OnButtonEnter", frame.uniquevalue, frame) 210 self:Fire("OnButtonEnter", frame.uniquevalue, frame)
211 211
212 if self.enabletooltips then 212 if self.enabletooltips then
213 GameTooltip:SetOwner(frame, "ANCHOR_NONE") 213 GameTooltip:SetOwner(frame, "ANCHOR_NONE")
214 GameTooltip:SetPoint("LEFT",frame,"RIGHT") 214 GameTooltip:SetPoint("LEFT",frame,"RIGHT")
215 GameTooltip:SetText(frame.text:GetText() or "", 1, .82, 0, 1) 215 GameTooltip:SetText(frame.text:GetText() or "", 1, .82, 0, true)
216 216
217 GameTooltip:Show() 217 GameTooltip:Show()
218 end 218 end
219 end 219 end
220 220
293 -------------------------------------------------------------------------------]] 293 -------------------------------------------------------------------------------]]
294 local methods = { 294 local methods = {
295 ["OnAcquire"] = function(self) 295 ["OnAcquire"] = function(self)
296 self:SetTreeWidth(DEFAULT_TREE_WIDTH, DEFAULT_TREE_SIZABLE) 296 self:SetTreeWidth(DEFAULT_TREE_WIDTH, DEFAULT_TREE_SIZABLE)
297 self:EnableButtonTooltips(true) 297 self:EnableButtonTooltips(true)
298 self.frame:SetScript("OnUpdate", FirstFrameUpdate)
298 end, 299 end,
299 300
300 ["OnRelease"] = function(self) 301 ["OnRelease"] = function(self)
301 self.status = nil 302 self.status = nil
302 for k, v in pairs(self.localstatus) do 303 for k, v in pairs(self.localstatus) do
332 button:SetScript("OnEnter",Button_OnEnter) 333 button:SetScript("OnEnter",Button_OnEnter)
333 button:SetScript("OnLeave",Button_OnLeave) 334 button:SetScript("OnLeave",Button_OnLeave)
334 335
335 button.toggle.button = button 336 button.toggle.button = button
336 button.toggle:SetScript("OnClick",Expand_OnClick) 337 button.toggle:SetScript("OnClick",Expand_OnClick)
338
339 button.text:SetHeight(14) -- Prevents text wrapping
337 340
338 return button 341 return button
339 end, 342 end,
340 343
341 ["SetStatusTable"] = function(self, status) 344 ["SetStatusTable"] = function(self, status)
665 scrollbar:SetWidth(16) 668 scrollbar:SetWidth(16)
666 scrollbar:SetScript("OnValueChanged", OnScrollValueChanged) 669 scrollbar:SetScript("OnValueChanged", OnScrollValueChanged)
667 670
668 local scrollbg = scrollbar:CreateTexture(nil, "BACKGROUND") 671 local scrollbg = scrollbar:CreateTexture(nil, "BACKGROUND")
669 scrollbg:SetAllPoints(scrollbar) 672 scrollbg:SetAllPoints(scrollbar)
670 scrollbg:SetTexture(0,0,0,0.4) 673 scrollbg:SetColorTexture(0,0,0,0.4)
671 674
672 local border = CreateFrame("Frame",nil,frame) 675 local border = CreateFrame("Frame",nil,frame)
673 border:SetPoint("TOPLEFT", treeframe, "TOPRIGHT") 676 border:SetPoint("TOPLEFT", treeframe, "TOPRIGHT")
674 border:SetPoint("BOTTOMRIGHT") 677 border:SetPoint("BOTTOMRIGHT")
675 border:SetBackdrop(PaneBackdrop) 678 border:SetBackdrop(PaneBackdrop)