# HG changeset patch # User wobin # Date 1248268602 -36000 # Node ID 8df5d8ef2e27b2a57c9224f38e3cb357739c39a1 # Parent e066473450c2dc42609a9075d66654cede83f628 switch back to LibQTip-1.0 as LQTC is depreciated Fixed up the line resizing as LQT does this automatically now diff -r e066473450c2 -r 8df5d8ef2e27 .pkgmeta --- a/.pkgmeta Wed Jul 22 22:06:36 2009 +1000 +++ b/.pkgmeta Wed Jul 22 23:16:42 2009 +1000 @@ -22,6 +22,3 @@ Libs/LibQTip-1.0: url: svn://svn.wowace.com/wow/libqtip-1-0/mainline/trunk tag: latest - Libs/LibQTipClick-1.0: - url: git://git.wowace.com/wow/libqtipclick-1-1/mainline.git - tag: latest diff -r e066473450c2 -r 8df5d8ef2e27 Libs/LibQTipClick-1.1/LibQTipClick-1.1.lua --- a/Libs/LibQTipClick-1.1/LibQTipClick-1.1.lua Wed Jul 22 22:06:36 2009 +1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -local MAJOR = "LibQTipClick-1.1" -local MINOR = 3 -assert(LibStub, MAJOR.." requires LibStub") - -local lib, oldminor = LibStub:NewLibrary(MAJOR, MINOR) - -if not lib then return end -- No upgrade needed - -local QTip = LibStub:GetLibrary("LibQTip-1.0") -assert(QTip, MAJOR.." requires LibQTip-1.0") - -local CBH = LibStub:GetLibrary("CallbackHandler-1.0") -assert(CBH, MAJOR.." requires CallbackHandler-1.0") - -------------------------------------------------------------------------------- --- Local variables -------------------------------------------------------------------------------- -lib.LabelProvider, lib.LabelPrototype, lib.BaseProvider = QTip:CreateCellProvider(QTip.LabelProvider) -local cell_provider, cell_prototype, cell_base = lib.LabelProvider, lib.LabelPrototype, lib.BaseProvider - -------------------------------------------------------------------------------- --- Public library API -------------------------------------------------------------------------------- -local highlighter = CreateFrame("Frame", nil, UIParent) -highlighter:SetFrameStrata("TOOLTIP") -highlighter:Hide() - -local cell_highlight = highlighter:CreateTexture(nil, "BACKGROUND") -cell_highlight:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight") -cell_highlight:SetBlendMode("ADD") -cell_highlight:SetAllPoints(highlighter) - -function lib.OnEnter(event, cell, arg) - highlighter:SetAllPoints(cell) - highlighter:SetFrameLevel(cell:GetFrameLevel()) - highlighter:Show() -end - -function lib.OnLeave(event, cell, arg) - highlighter:ClearAllPoints() - highlighter:Hide() -end - -function lib.OnMouseDown(event, cell, arg, button) PlaySound("igMainMenuOpen") end -function lib.OnMouseUp(event, cell, arg, button) end - -local function Cell_OnEnter(cell) cell.callbacks:Fire("OnEnter", cell, cell.arg) end -local function Cell_OnLeave(cell) cell.callbacks:Fire("OnLeave", cell, cell.arg) end -local function Cell_OnMouseDown(cell, button) cell.callbacks:Fire("OnMouseDown", cell, cell.arg, button) end -local function Cell_OnMouseUp(cell, button) cell.callbacks:Fire("OnMouseUp", cell, cell.arg, button) end - -function cell_prototype:InitializeCell() cell_base.InitializeCell(self) end - -function cell_prototype:SetupCell(tooltip, value, justification, font, arg, ...) - local width, height = cell_base.SetupCell(self, tooltip, value, justification, font, ...) - self:EnableMouse(true) - self.arg = arg - self.callbacks = tooltip.callbacks - self:SetScript("OnEnter", Cell_OnEnter) - self:SetScript("OnLeave", Cell_OnLeave) - self:SetScript("OnMouseDown", Cell_OnMouseDown) - self:SetScript("OnMouseUp", Cell_OnMouseUp) - - return width, height -end - -function cell_prototype:ReleaseCell() - self:EnableMouse(false) - self:SetScript("OnEnter", nil) - self:SetScript("OnLeave", nil) - self:SetScript("OnMouseDown", nil) - self:SetScript("OnMouseUp", nil) - self.arg = nil - self.callbacks = nil -end - -------------------------------------------------------------------------------- --- LibQTip wrapper API -------------------------------------------------------------------------------- -local function AddNormalLine(tooltip, ...) - local oldProvider = tooltip:GetDefaultProvider() - tooltip:SetDefaultProvider(QTip.LabelProvider) - local lineNum, colNum = tooltip:AddLine(...) - tooltip:SetDefaultProvider(oldProvider) - return lineNum, colNum -end - -local function AddNormalHeader(tooltip, ...) - local oldProvider = tooltip:GetDefaultProvider() - tooltip:SetDefaultProvider(QTip.LabelProvider) - local lineNum, colNum = tooltip:AddHeader(...) - tooltip:SetDefaultProvider(oldProvider) - return lineNum, colNum -end - -local function SetNormalCell(tooltip, ...) - local oldProvider = tooltip:GetDefaultProvider() - tooltip:SetDefaultProvider(QTip.LabelProvider) - local lineNum, colNum = tooltip:SetCell(...) - tooltip:SetDefaultProvider(oldProvider) - return lineNum, colNum -end - -function lib:Acquire(key, ...) - local tooltip = QTip:Acquire(key, ...) - tooltip:EnableMouse(true) - - tooltip.callbacks = CBH:New(tooltip, "SetCallback", "UnSetCallback", "UnSetAllCallbacks" or false) - tooltip:SetCallback("OnEnter", self.OnEnter) - tooltip:SetCallback("OnLeave", self.OnLeave) - tooltip:SetCallback("OnMouseDown", self.OnMouseDown) - tooltip:SetCallback("OnMouseUp", self.OnMouseUp) - - tooltip.AddNormalLine = AddNormalLine - tooltip.AddNormalHeader = AddNormalHeader - tooltip.SetNormalCell = SetNormalCell - tooltip:SetDefaultProvider(cell_provider) - return tooltip -end - -function lib:IsAcquired(key) return QTip:IsAcquired(key) end - -function lib:Release(tooltip) - if not tooltip then return end - tooltip:EnableMouse(false) - tooltip:UnSetAllCallbacks(tooltip) - tooltip.callbacks = nil - tooltip["SetCallback"] = nil - tooltip["UnSetCallback"] = nil - tooltip["UnSetAllCallbacks"] = nil - QTip:Release(tooltip) -end - -function lib:IterateTooltips() return QTip:IterateTooltips() end -function lib:CreateCellProvider(baseProvider) return QTip:CreateCellProvider(baseProvider) end diff -r e066473450c2 -r 8df5d8ef2e27 Libs/LibQTipClick-1.1/LibQTipClick-1.1.toc --- a/Libs/LibQTipClick-1.1/LibQTipClick-1.1.toc Wed Jul 22 22:06:36 2009 +1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -## Interface: 30100 -## Title: Lib: QTipClick-1.1 -## Notes: Library providing mouse-click support for LibQTip-1.0. -## Author: Torhal -## Version: r8 -## X-Date: 2009-05-31T22:22:40Z -## X-Category: Library, Tooltip -## X-License: Ace3 BSD-like license -## OptionalDeps: LibQTip-1.0 -## X-Curse-Packaged-Version: r8 -## X-Curse-Project-Name: LibQTipClick-1.1 -## X-Curse-Project-ID: libqtipclick-1-1 -## X-Curse-Repository-ID: wow/libqtipclick-1-1/mainline - -LibStub\LibStub.lua -CallbackHandler-1.0\CallbackHandler-1.0.lua -lib.xml \ No newline at end of file diff -r e066473450c2 -r 8df5d8ef2e27 Libs/LibQTipClick-1.1/lib.xml --- a/Libs/LibQTipClick-1.1/lib.xml Wed Jul 22 22:06:36 2009 +1000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ - -