Commit 83126424 authored by nevcairiel's avatar nevcairiel

AceGUI-3.0: DropDown: Initialize the widget with an empty item list (instead...

AceGUI-3.0: DropDown: Initialize the widget with an empty item list (instead of nil), this allows AddItem to be used right away (Fixes #542)

git-svn-id: https://repos.wowace.com/wow/ace3/trunk@1236 5debad98-a965-4143-8383-f471b3509dcf
parent 38033fa6
......@@ -356,7 +356,7 @@ end
do
local widgetType = "Dropdown"
local widgetVersion = 34
local widgetVersion = 35
--[[ Static data ]]--
......@@ -465,6 +465,7 @@ do
self:SetWidth(200)
self:SetLabel()
self:SetPulloutWidth(nil)
self.list = {}
end
-- exported, AceGUI callback
......@@ -535,9 +536,7 @@ do
-- exported
local function SetValue(self, value)
if self.list then
self:SetText(self.list[value] or "")
end
self:SetText(self.list[value] or "")
self.value = value
end
......@@ -601,7 +600,7 @@ do
end
end
local function SetList(self, list, order, itemType)
self.list = list
self.list = list or {}
self.pullout:Clear()
self.hasClose = nil
if not list then return end
......@@ -629,10 +628,8 @@ do
-- exported
local function AddItem(self, value, text, itemType)
if self.list then
self.list[value] = text
AddListItem(self, value, text, itemType)
end
self.list[value] = text
AddListItem(self, value, text, itemType)
end
-- exported
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment