Quantcast

Update AceGUI

Jim Whitehead [08-11-16 - 17:29]
Update AceGUI
Filename
libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua
libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua
libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua
libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua
libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua
libs/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua
libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua
libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua
libs/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua
diff --git a/libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua b/libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua
index a56e7cd..6dd0c4d 100755
--- a/libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua
+++ b/libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua
@@ -2,10 +2,12 @@
 ScrollFrame Container
 Plain container that scrolls its content and doesn't grow in height.
 -------------------------------------------------------------------------------]]
-local Type, Version = "ScrollFrame", 23
+local Type, Version = "ScrollFrame", 24
 local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end

+local IsLegion = select(4, GetBuildInfo()) >= 70000
+
 -- Lua APIs
 local pairs, assert, type = pairs, assert, type
 local min, max, floor, abs = math.min, math.max, math.floor, math.abs
@@ -176,7 +178,11 @@ local function Constructor()

 	local scrollbg = scrollbar:CreateTexture(nil, "BACKGROUND")
 	scrollbg:SetAllPoints(scrollbar)
-	scrollbg:SetTexture(0, 0, 0, 0.4)
+	if IsLegion then
+		scrollbg:SetColorTexture(0, 0, 0, 0.4)
+	else
+		scrollbg:SetTexture(0, 0, 0, 0.4)
+	end

 	--Container Support
 	local content = CreateFrame("Frame", nil, scrollframe)
diff --git a/libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua b/libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua
index 6fbe066..9bf17d8 100755
--- a/libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua
+++ b/libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua
@@ -2,10 +2,12 @@
 TreeGroup Container
 Container that uses a tree control to switch between groups.
 -------------------------------------------------------------------------------]]
-local Type, Version = "TreeGroup", 36
+local Type, Version = "TreeGroup", 40
 local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end

+local IsLegion = select(4, GetBuildInfo()) >= 70000
+
 -- Lua APIs
 local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type
 local math_min, math_max, floor = math.min, math.max, floor
@@ -212,7 +214,7 @@ local function Button_OnEnter(frame)
 	if self.enabletooltips then
 		GameTooltip:SetOwner(frame, "ANCHOR_NONE")
 		GameTooltip:SetPoint("LEFT",frame,"RIGHT")
-		GameTooltip:SetText(frame.text:GetText() or "", 1, .82, 0, 1)
+		GameTooltip:SetText(frame.text:GetText() or "", 1, .82, 0, true)

 		GameTooltip:Show()
 	end
@@ -295,6 +297,7 @@ local methods = {
 	["OnAcquire"] = function(self)
 		self:SetTreeWidth(DEFAULT_TREE_WIDTH, DEFAULT_TREE_SIZABLE)
 		self:EnableButtonTooltips(true)
+		self.frame:SetScript("OnUpdate", FirstFrameUpdate)
 	end,

 	["OnRelease"] = function(self)
@@ -335,6 +338,8 @@ local methods = {
 		button.toggle.button = button
 		button.toggle:SetScript("OnClick",Expand_OnClick)

+		button.text:SetHeight(14) -- Prevents text wrapping
+
 		return button
 	end,

@@ -667,7 +672,12 @@ local function Constructor()

 	local scrollbg = scrollbar:CreateTexture(nil, "BACKGROUND")
 	scrollbg:SetAllPoints(scrollbar)
-	scrollbg:SetTexture(0,0,0,0.4)
+
+	if IsLegion then
+		scrollbg:SetColorTexture(0,0,0,0.4)
+	else
+		scrollbg:SetTexture(0,0,0,0.4)
+	end

 	local border = CreateFrame("Frame",nil,frame)
 	border:SetPoint("TOPLEFT", treeframe, "TOPRIGHT")
diff --git a/libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua b/libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua
index 028e524..c7c72c1 100755
--- a/libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua
+++ b/libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua
@@ -13,12 +13,6 @@ local pairs = pairs
 local _G = _G
 local PlaySound, CreateFrame, UIParent = PlaySound, CreateFrame, UIParent

-local wowMoP
-do
-	local _, _, _, interface = GetBuildInfo()
-	wowMoP = (interface >= 50000)
-end
-
 --[[-----------------------------------------------------------------------------
 Scripts
 -------------------------------------------------------------------------------]]
@@ -80,7 +74,7 @@ Constructor
 -------------------------------------------------------------------------------]]
 local function Constructor()
 	local name = "AceGUI30Button" .. AceGUI:GetNextWidgetNum(Type)
-	local frame = CreateFrame("Button", name, UIParent, wowMoP and "UIPanelButtonTemplate" or "UIPanelButtonTemplate2")
+	local frame = CreateFrame("Button", name, UIParent, "UIPanelButtonTemplate")
 	frame:Hide()

 	frame:EnableMouse(true)
diff --git a/libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua b/libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua
index f25d46c..740a467 100755
--- a/libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua
+++ b/libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua
@@ -1,10 +1,12 @@
 --[[-----------------------------------------------------------------------------
 ColorPicker Widget
 -------------------------------------------------------------------------------]]
-local Type, Version = "ColorPicker", 22
+local Type, Version = "ColorPicker", 23
 local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end

+local IsLegion = select(4, GetBuildInfo()) >= 70000
+
 -- Lua APIs
 local pairs = pairs

@@ -146,7 +148,11 @@ local function Constructor()
 	local texture = frame:CreateTexture(nil, "BACKGROUND")
 	texture:SetWidth(16)
 	texture:SetHeight(16)
-	texture:SetTexture(1, 1, 1)
+	if IsLegion then
+		texture:SetColorTexture(1, 1, 1)
+	else
+		texture:SetTexture(1, 1, 1)
+	end
 	texture:SetPoint("CENTER", colorSwatch)
 	texture:Show()

diff --git a/libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua b/libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua
index 1f28cb5..5ea840f 100755
--- a/libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua
+++ b/libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua
@@ -1,7 +1,9 @@
---[[ $Id: AceGUIWidget-DropDown-Items.lua 996 2010-12-01 18:34:17Z nevcairiel $ ]]--
+--[[ $Id: AceGUIWidget-DropDown-Items.lua 1137 2016-05-15 10:57:36Z nevcairiel $ ]]--

 local AceGUI = LibStub("AceGUI-3.0")

+local IsLegion = select(4, GetBuildInfo()) >= 70000
+
 -- Lua APIs
 local select, assert = select, assert

@@ -440,7 +442,7 @@ end
 -- A single line to separate items
 do
 	local widgetType = "Dropdown-Item-Separator"
-	local widgetVersion = 1
+	local widgetVersion = 2

 	-- exported, override
 	local function SetDisabled(self, disabled)
@@ -455,7 +457,11 @@ do

 		local line = self.frame:CreateTexture(nil, "OVERLAY")
 		line:SetHeight(1)
-		line:SetTexture(.5, .5, .5)
+		if IsLegion then
+			line:SetColorTexture(.5, .5, .5)
+		else
+			line:SetTexture(.5, .5, .5)
+		end
 		line:SetPoint("LEFT", self.frame, "LEFT", 10, 0)
 		line:SetPoint("RIGHT", self.frame, "RIGHT", -10, 0)

diff --git a/libs/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua b/libs/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua
index c67902c..d039026 100755
--- a/libs/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua
+++ b/libs/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua
@@ -1,7 +1,7 @@
 --[[-----------------------------------------------------------------------------
 EditBox Widget
 -------------------------------------------------------------------------------]]
-local Type, Version = "EditBox", 25
+local Type, Version = "EditBox", 26
 local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end

@@ -200,6 +200,10 @@ local methods = {
 		if not self.frame:IsShown() then
 			self.frame:SetScript("OnShow", Frame_OnShowFocus)
 		end
+	end,
+
+	["HighlightText"] = function(self, from, to)
+		self.editbox:HighlightText(from, to)
 	end
 }

diff --git a/libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua b/libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua
index 8d01b54..561da73 100755
--- a/libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua
+++ b/libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua
@@ -9,7 +9,7 @@ if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
 local select, pairs, print = select, pairs, print

 -- WoW APIs
-local CreateFrame, UIParent, GetBuildInfo = CreateFrame, UIParent, GetBuildInfo
+local CreateFrame, UIParent = CreateFrame, UIParent

 --[[-----------------------------------------------------------------------------
 Scripts
@@ -131,12 +131,8 @@ local function Constructor()
 	for method, func in pairs(methods) do
 		widget[method] = func
 	end
-	-- SetText is deprecated, but keep it around for a while. (say, to WoW 4.0)
-	if (select(4, GetBuildInfo()) < 40000) then
-		widget.SetText = widget.SetLabel
-	else
-		widget.SetText = function(self, ...) print("AceGUI-3.0-Icon: SetText is deprecated! Use SetLabel instead!"); self:SetLabel(...) end
-	end
+
+	widget.SetText = function(self, ...) print("AceGUI-3.0-Icon: SetText is deprecated! Use SetLabel instead!"); self:SetLabel(...) end

 	return AceGUI:RegisterAsWidget(widget)
 end
diff --git a/libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua b/libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua
index 7dccc64..ec4cead 100755
--- a/libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua
+++ b/libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua
@@ -2,7 +2,7 @@
 Keybinding Widget
 Set Keybindings in the Config UI.
 -------------------------------------------------------------------------------]]
-local Type, Version = "Keybinding", 24
+local Type, Version = "Keybinding", 25
 local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end

@@ -17,12 +17,6 @@ local CreateFrame, UIParent = CreateFrame, UIParent
 -- List them here for Mikk's FindGlobals script
 -- GLOBALS: NOT_BOUND

-local wowMoP
-do
-	local _, _, _, interface = GetBuildInfo()
-	wowMoP = (interface >= 50000)
-end
-
 --[[-----------------------------------------------------------------------------
 Scripts
 -------------------------------------------------------------------------------]]
@@ -40,11 +34,13 @@ local function Keybinding_OnClick(frame, button)
 		local self = frame.obj
 		if self.waitingForKey then
 			frame:EnableKeyboard(false)
+			frame:EnableMouseWheel(false)
 			self.msgframe:Hide()
 			frame:UnlockHighlight()
 			self.waitingForKey = nil
 		else
 			frame:EnableKeyboard(true)
+			frame:EnableMouseWheel(true)
 			self.msgframe:Show()
 			frame:LockHighlight()
 			self.waitingForKey = true
@@ -79,6 +75,7 @@ local function Keybinding_OnKeyDown(frame, key)
 		end

 		frame:EnableKeyboard(false)
+		frame:EnableMouseWheel(false)
 		self.msgframe:Hide()
 		frame:UnlockHighlight()
 		self.waitingForKey = nil
@@ -103,6 +100,16 @@ local function Keybinding_OnMouseDown(frame, button)
 	Keybinding_OnKeyDown(frame, button)
 end

+local function Keybinding_OnMouseWheel(frame, direction)
+	local button
+	if direction >= 0 then
+		button = "MOUSEWHEELUP"
+	else
+		button = "MOUSEWHEELDOWN"
+	end
+	Keybinding_OnKeyDown(frame, button)
+end
+
 --[[-----------------------------------------------------------------------------
 Methods
 -------------------------------------------------------------------------------]]
@@ -115,6 +122,7 @@ local methods = {
 		self.msgframe:Hide()
 		self:SetDisabled(false)
 		self.button:EnableKeyboard(false)
+		self.button:EnableMouseWheel(false)
 	end,

 	-- ["OnRelease"] = nil,
@@ -180,15 +188,17 @@ local function Constructor()
 	local name = "AceGUI30KeybindingButton" .. AceGUI:GetNextWidgetNum(Type)

 	local frame = CreateFrame("Frame", nil, UIParent)
-	local button = CreateFrame("Button", name, frame, wowMoP and "UIPanelButtonTemplate" or "UIPanelButtonTemplate2")
+	local button = CreateFrame("Button", name, frame, "UIPanelButtonTemplate")

 	button:EnableMouse(true)
+	button:EnableMouseWheel(false)
 	button:RegisterForClicks("AnyDown")
 	button:SetScript("OnEnter", Control_OnEnter)
 	button:SetScript("OnLeave", Control_OnLeave)
 	button:SetScript("OnClick", Keybinding_OnClick)
 	button:SetScript("OnKeyDown", Keybinding_OnKeyDown)
 	button:SetScript("OnMouseDown", Keybinding_OnMouseDown)
+	button:SetScript("OnMouseWheel", Keybinding_OnMouseWheel)
 	button:SetPoint("BOTTOMLEFT")
 	button:SetPoint("BOTTOMRIGHT")
 	button:SetHeight(24)
diff --git a/libs/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua b/libs/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua
index a27a2fc..9af4b87 100755
--- a/libs/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua
+++ b/libs/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua
@@ -1,4 +1,4 @@
-local Type, Version = "MultiLineEditBox", 27
+local Type, Version = "MultiLineEditBox", 28
 local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end

@@ -14,12 +14,6 @@ local _G = _G
 -- List them here for Mikk's FindGlobals script
 -- GLOBALS: ACCEPT, ChatFontNormal

-local wowMoP
-do
-	local _, _, _, interface = GetBuildInfo()
-	wowMoP = (interface >= 50000)
-end
-
 --[[-----------------------------------------------------------------------------
 Support functions
 -------------------------------------------------------------------------------]]
@@ -251,7 +245,11 @@ local methods = {
 			self.frame:SetScript("OnShow", OnShowFocus)
 		end
 	end,
-
+
+	["HighlightText"] = function(self, from, to)
+		self.editBox:HighlightText(from, to)
+	end,
+
 	["GetCursorPosition"] = function(self)
 		return self.editBox:GetCursorPosition()
 	end,
@@ -285,7 +283,7 @@ local function Constructor()
 	label:SetText(ACCEPT)
 	label:SetHeight(10)

-	local button = CreateFrame("Button", ("%s%dButton"):format(Type, widgetNum), frame, wowMoP and "UIPanelButtonTemplate" or "UIPanelButtonTemplate2")
+	local button = CreateFrame("Button", ("%s%dButton"):format(Type, widgetNum), frame, "UIPanelButtonTemplate")
 	button:SetPoint("BOTTOMLEFT", 0, 4)
 	button:SetHeight(22)
 	button:SetWidth(label:GetStringWidth() + 24)