comparison Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua @ 5:c31ee4251181

Libs Update
author tercio
date Tue, 25 Nov 2014 21:15:10 -0200
parents fc346da3afd9
children 3000eccbf1a0
comparison
equal deleted inserted replaced
4:453c68ff5d72 5:c31ee4251181
1 --[[ $Id: AceGUIWidget-DropDown.lua 1101 2013-10-25 12:46:47Z nevcairiel $ ]]-- 1 --[[ $Id: AceGUIWidget-DropDown.lua 1116 2014-10-12 08:15:46Z nevcairiel $ ]]--
2 local AceGUI = LibStub("AceGUI-3.0") 2 local AceGUI = LibStub("AceGUI-3.0")
3 3
4 -- Lua APIs 4 -- Lua APIs
5 local min, max, floor = math.min, math.max, math.floor 5 local min, max, floor = math.min, math.max, math.floor
6 local select, pairs, ipairs, type = select, pairs, ipairs, type 6 local select, pairs, ipairs, type = select, pairs, ipairs, type
354 AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion) 354 AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
355 end 355 end
356 356
357 do 357 do
358 local widgetType = "Dropdown" 358 local widgetType = "Dropdown"
359 local widgetVersion = 29 359 local widgetVersion = 30
360 360
361 --[[ Static data ]]-- 361 --[[ Static data ]]--
362 362
363 --[[ UI event handler ]]-- 363 --[[ UI event handler ]]--
364 364
492 local function SetDisabled(self, disabled) 492 local function SetDisabled(self, disabled)
493 self.disabled = disabled 493 self.disabled = disabled
494 if disabled then 494 if disabled then
495 self.text:SetTextColor(0.5,0.5,0.5) 495 self.text:SetTextColor(0.5,0.5,0.5)
496 self.button:Disable() 496 self.button:Disable()
497 self.button_cover:Disable()
497 self.label:SetTextColor(0.5,0.5,0.5) 498 self.label:SetTextColor(0.5,0.5,0.5)
498 else 499 else
499 self.button:Enable() 500 self.button:Enable()
501 self.button_cover:Enable()
500 self.label:SetTextColor(1,.82,0) 502 self.label:SetTextColor(1,.82,0)
501 self.text:SetTextColor(1,1,1) 503 self.text:SetTextColor(1,1,1)
502 end 504 end
503 end 505 end
504 506
702 button:SetScript("OnEnter",Control_OnEnter) 704 button:SetScript("OnEnter",Control_OnEnter)
703 button:SetScript("OnLeave",Control_OnLeave) 705 button:SetScript("OnLeave",Control_OnLeave)
704 button:SetScript("OnClick",Dropdown_TogglePullout) 706 button:SetScript("OnClick",Dropdown_TogglePullout)
705 707
706 local button_cover = CreateFrame("BUTTON",nil,self.frame) 708 local button_cover = CreateFrame("BUTTON",nil,self.frame)
709 self.button_cover = button_cover
707 button_cover.obj = self 710 button_cover.obj = self
708 button_cover:SetPoint("TOPLEFT",self.frame,"BOTTOMLEFT",0,25) 711 button_cover:SetPoint("TOPLEFT",self.frame,"BOTTOMLEFT",0,25)
709 button_cover:SetPoint("BOTTOMRIGHT",self.frame,"BOTTOMRIGHT") 712 button_cover:SetPoint("BOTTOMRIGHT",self.frame,"BOTTOMRIGHT")
710 button_cover:SetScript("OnEnter",Control_OnEnter) 713 button_cover:SetScript("OnEnter",Control_OnEnter)
711 button_cover:SetScript("OnLeave",Control_OnLeave) 714 button_cover:SetScript("OnLeave",Control_OnLeave)