/trunk
local checked = not not self:GetChecked() -- WOD: won't need typecasting |
PlaySound(checked and "igMainMenuOptionCheckBoxOn" or "igMainMenuOptionCheckBoxOff") |
self:GetScript("OnLeave")(self) |
if self.Callback then |
self:Callback(checked) |
local callback = self.Callback or self.OnValueChanged |
if callback then |
callback(self, checked) |
end |
end |
dropdown.valueText:SetText(self:GetText() or self.value) |
if dropdown.Callback then |
dropdown:Callback(self.value) |
local callback = dropdown.OnValueChanged or dropdown.Callback |
if callback then |
callback(dropdown, self.value) |
end |
PlaySound("UChatScrollButton") |
button:Hide() |
end |
if dropdown.ListButtonCallback then |
dropdown:ListButtonCallback(button, item, selected) |
local callback = dropdown.OnListButtonChanged or dropdown.ListButtonCallback |
if callback then |
callback(dropdown, button, item, selected) |
end |
end |
self.swatch:SetVertexColor(r, g, b, a) |
self.bg:SetAlpha(a) |
if self.Callback then |
local callback = self.Callback or self.OnValueChanged |
if callback then |
-- Ignore updates while ColorPickerFrame:IsShown() if desired. |
self:Callback(r, g, b, a) |
callback(self, r, g, b, a) |
end |
end |
if text:len() == 0 then text = nil end -- experimental |
local parent = self:GetParent() |
if parent.CallbackOnTextChanged and text ~= self.currText then |
parent:CallbackOnTextChanged(text) |
local callback = parent.CallbackOnTextChanged or parent.OnTextChanged |
if callback and text ~= self.currText then |
callback(parent, text) |
self.currText = text |
end |
end |
self:ClearFocus() |
local parent = self:GetParent() |
if parent.Callback then |
parent:Callback(text) |
local callback = parent.Callback or parent.OnValueChanged |
if callback then |
callback(parent, text) |
end |
end |
self:SetValue(value) |
if parent.Callback then |
parent:Callback(value) |
local callback = parent.OnValueChanged or parent.Callback |
if callback then |
callback(parent, value) |
end |
end |