Mercurial > wow > pvpscan
comparison Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown.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 --[[ $Id: AceGUIWidget-DropDown.lua 1101 2013-10-25 12:46:47Z nevcairiel $ ]]-- | 1 --[[ $Id: AceGUIWidget-DropDown.lua 1167 2017-08-29 22:08:48Z funkydude $ ]]-- |
| 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 = 31 |
| 360 | 360 |
| 361 --[[ Static data ]]-- | 361 --[[ Static data ]]-- |
| 362 | 362 |
| 363 --[[ UI event handler ]]-- | 363 --[[ UI event handler ]]-- |
| 364 | 364 |
| 379 end | 379 end |
| 380 end | 380 end |
| 381 | 381 |
| 382 local function Dropdown_TogglePullout(this) | 382 local function Dropdown_TogglePullout(this) |
| 383 local self = this.obj | 383 local self = this.obj |
| 384 PlaySound("igMainMenuOptionCheckBoxOn") -- missleading name, but the Blizzard code uses this sound | 384 PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
| 385 if self.open then | 385 if self.open then |
| 386 self.open = nil | 386 self.open = nil |
| 387 self.pullout:Close() | 387 self.pullout:Close() |
| 388 AceGUI:ClearFocus() | 388 AceGUI:ClearFocus() |
| 389 else | 389 else |
| 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) |
