Would it be usefull if I tried to do some internal test to the scrollable branch of LibQTip in tomQuest2?
If so I would need to know how to use it? Will I be able to set in my option a maximum height to the tooltip after which it should be scrollable?
You use it like you would use the normal version. After all your data was added to the tip, you call tooltip:UpdateScrolling() and it will resize if it was currently going outside of screen boundaries in vertical dimension.
would it be possible to implement the following suggestions:
1. manually define max height to the tooltip instead of checking if the tooltip is going outside screen boundaries.
2. make only a part of the tooltip scrollable, this would allow me to define a header and a footer to my tooltip that would always be shown and just let the central part of my tooltiip to scroll.
Is there any way to specify any sort of spell spacing? I've got some cells that are a little closer together than I would like, but don't want to pad the actual text with spaces unless it's absolutely necessary.
in tomQuest2 I am doing something like that using a custom cell provider.
local cProvider, cPrototype, basecCellPrototype = LibQTip:CreateCellProvider(LibQTip.LabelProvider)
self.fontString = self:CreateFontString()
function cPrototype:SetupCell(tooltip, value, justification, font, indentLeft, indentRight, maxWidth)
indent = indent or 0
local width, height = basecCellPrototype.SetupCell(self, tooltip, value, justification, font)
local fs = self.fontString
fs:SetPoint("TOPLEFT", self, "TOPLEFT", indentLeft, 0)
fs:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", indentRight, 0)
width = width + indentLeft + indentRight
if width > maxWidth then
height = fs:GetHeight()
width = maxWidth
return width, height
so when you add a line to the tooltip you do the following:
tip = LibQTip:Acquire("unike key for tooltip", 2, "LEFT", "RIGHT")
local tempLine = tip:AddLine()
tip:SetCell(tempLine, 1, "text to add to the tooltip", font, "LEFT", 1, cProvider, indentLeft, indentRight, maxWidth)
the first 1 in the SetCell is the column number in which you want to put your text
font is the font you've defined
the second 1 is the collspan
cProvider is the name of the custom cell provider defined previously
indentLeft and indentRight are the length in pixel from the left and right border of the cell
maxWidth is the maximum width of the cell after which the content will be automatically splitted in multiple line.
(the code is not tested but it's what I'm doing in tomQuest2 minus the clickable code of the
below is a result example:
as you can see in the tooltip the begining of the zone, quest name and quest objective are not at the same horizontal point, it's done with the indentLeft argument and the quest objective text on multiple lines is done with the maxWidth argument
I've merged in Elkano's scrollable branch, and added some upvalues for the heavily-used globals. Adirelle has added an automatic tooltip-hiding mechanism. Documentation for the new API functions will be up as soon as Elkano, Adirelle, or myself gets to it.
I'll look at it later, if I feel up to it...just got home from work, I'm exhausted, and now I have to troubleshoot my GF's father's computer.
If I'm the reading the code properly, there is one new method for the tooltip, namely <tooltip>:UpdateScrolling(maxHeight), which will essentially display a scrolling slider, able to be controlled via mousewheel, if the tooltip height is equal or greater than maxHeight. Would I be correct in this assumption, as I'm looking forward to testing out this feature.