Edit the first post maybe? BTW, I saw the auctioneer announcement for LibExtraTip now, wonder why they did not just use LibEnhToolTip.
*shrug* ah well
Because "enhanced" is too generic if all their lib does is provide "extra" tooltips?
(note: I don't know what their lib does, going off the old enhtooltip stuff)
Edit the first post maybe? BTW, I saw the auctioneer announcement for LibExtraTip now, wonder why they did not just use LibEnhToolTip.
*shrug* ah well
Because the new Lib is a completely different animal. ETT was written ages ago, and is essentially outdated. From what I've gathered, the new TT has new functionality, is slimmer, faster, and more capable than ETT could hope to be. ETT is ancient, the new TT lib is... new, sparkly, and up to date with the latest fast-paced, in-your-face addon trends. :p
Unlike old cars, you don't take an old addon, rip out the insides, replace the entire thing and keep the exact same name.... typically.
Unlike old cars, you don't take an old addon, rip out the insides, replace the entire thing and keep the exact same name.... typically.
Bah, getting too off topic I guess... but ...
I would, especially in the case of a library like routine in an enviorment with a global namespace. Does not seem to me the guts are what should be named, so much as the functionality.
I would, especially in the case of a library like routine in an enviorment with a global namespace. Does not seem to me the guts are what should be named, so much as the functionality.
I have two question related to LibQTip:
1) Is it possible to make a cell that would not expand in width if the content is bigger than the current maximum width of the column but insted will display the content on multiple line.
2) reading libtooltip previsous thread, it seems that clickable lines would be possible through the use of CellProvider. Can you provide some example of CellProvider for clickable line.
I have two question related to LibQTip:
1) Is it possible to make a cell that would not expand in width if the content is bigger than the current maximum width of the column but insted will display the content on multiple line.
Not with the built-in CellProvider. An custom one may fit.
2) reading libtooltip previsous thread, it seems that clickable lines would be possible through the use of CellProvider. Can you provide some example of CellProvider for clickable line.
CellProvider would allow to make clickable cells. A line would be clickable if it was composed only of clickable cells.
Not with the built-in CellProvider. An custom one may fit.
Making a little bit research on the subject, I found that to do what I want I would need to put a SetWidth equal to the maximum width previously found.
I've seen that the width is returned by SetupCell but not by SetCell.
As SetupCell is called by SetCell I won't call SetupCell otherwise it will be called twice per cell which does not seems good.
Do I have an easy way to retrieve the width of a Cell in order to pass it to my custom cell?
My problem was not to set the width of a cell, what you proposed was more or less what I had on my mind.
So let me explain exactly what I want to do.
I'm making a tooltip for quests, so for some quest I'll display the objectives, (like kill ten mobs, get 12 things...) but for some quest there is no objective like that so I'll display the small description of the quest.
So I have two kind of content to put on my cell:
small one that fit on one line
big one that need to be split on multiple line.
so for the big ones, I'll have to put a maximum width, but I don't want to put an arbitrary one so I want to retrieve the maximum width of the small content, and if it's greater than an arbitrary minimum width I'll give all my big cells the maximum width of small cells, otherwise I'll set it to the minimum width.
Here my problem is to retrieve the maximum width of the small cells, do I have a way to do it without calling the SetupCell function that is already called by the SetCell function.
Or am I completely wrong and the library can "automagically" set the width of my cell to the maximum width of small cells if it's greater that the arbitrary minimum size that I'll put to my big cell?
P.S.: I tried to make it as clear as possible, but as english is not my native language I may not be clear :( ...
There is no way for the cell provider to get the actual width of the column(s) to which the cell is added. But what you should understand is that the "width" returned by SetupCell is actually the minimum width required to properly display the cell. If any other cell in the same column is larger, the given cell will be enlarged accordingly.
So I would suggest to use a custom CellProvided that limits the content width, e.g. : replace "fixedWidth" by "maxWidth" in the previous code sample, and have SetupCell returns "return math.min(width, self.maxWidth), height".
Then use a fairly low number as maxWidth. This way, if the small cells are narrower than your big cell content, the column is enlarged up to maxWidth. And in the contrary, if the small cells are larger than maxWidth, the big cell is enlarged accordingly.
ok I tried it it's almost perfect, I just need to adjust minimum value :)
I tried to get the clickable cell working, but I guess i did something wrong :(
here is what I did for my custom cell provider:
local plus = [[|TInterface\Buttons\UI-PlusButton-Up:12|t]]
local minus = [[|TInterface\Buttons\UI-MinusButton-Up:12|t]]
local zoneDisplay = {}
local zProvider, zPrototype, basezCellPrototype = LibQTip:CreateCellProvider(LibQTip.LabelProvider)
function zPrototype:InitializeCell()
basezCellPrototype.InitializeCell(self)
end
function zPrototype:SetupCell(tooltip, value, justification, font)
local r, g, b = LibTourist:GetLevelColor(value)
local levelMin, levelMax = LibTourist:GetLevel(value)
local width, height = basezCellPrototype.SetupCell(self, tooltip,string.format("%s |cff%02x%02x%02x%s (%s-%s)|r", zoneDisplay[value].display and plus or minus, r*255, g*255, b*255, value, levelMin, levelMax),justification,font)
self:SetScript('OnMouseDown', function() DEFAULT_CHATFRAME:AddMessage("test") end)
return width, height
end
When I try to click on my cell, nothing happen, no error is thrown :(
I think base frames require something more to get clickable. I am not sure what as quite often people use Button instead of Frame. Maybe something like "self:EnableMouse(true)".
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Project home: http://www.wowace.com/projects/libqtip-1-0/
Bug reports : http://www.wowace.com/projects/libqtip-1-0/tickets/
You're right. That's what I get for doing this stuff after working then driving for three hours. :)
*shrug* ah well
Because "enhanced" is too generic if all their lib does is provide "extra" tooltips?
(note: I don't know what their lib does, going off the old enhtooltip stuff)
Because the new Lib is a completely different animal. ETT was written ages ago, and is essentially outdated. From what I've gathered, the new TT has new functionality, is slimmer, faster, and more capable than ETT could hope to be. ETT is ancient, the new TT lib is... new, sparkly, and up to date with the latest fast-paced, in-your-face addon trends. :p
Unlike old cars, you don't take an old addon, rip out the insides, replace the entire thing and keep the exact same name.... typically.
Bah, getting too off topic I guess... but ...
I would, especially in the case of a library like routine in an enviorment with a global namespace. Does not seem to me the guts are what should be named, so much as the functionality.
Yes but in this case the API changed drastically.
1) Is it possible to make a cell that would not expand in width if the content is bigger than the current maximum width of the column but insted will display the content on multiple line.
2) reading libtooltip previsous thread, it seems that clickable lines would be possible through the use of CellProvider. Can you provide some example of CellProvider for clickable line.
Not with the built-in CellProvider. An custom one may fit.
CellProvider would allow to make clickable cells. A line would be clickable if it was composed only of clickable cells.
Making a little bit research on the subject, I found that to do what I want I would need to put a SetWidth equal to the maximum width previously found.
I've seen that the width is returned by SetupCell but not by SetCell.
As SetupCell is called by SetCell I won't call SetupCell otherwise it will be called twice per cell which does not seems good.
Do I have an easy way to retrieve the width of a Cell in order to pass it to my custom cell?
<script src="http://gist.github.com/27135.js"></script>
DISCLAIMER: this is fully drycoded. I think this is the
My problem was not to set the width of a cell, what you proposed was more or less what I had on my mind.
So let me explain exactly what I want to do.
I'm making a tooltip for quests, so for some quest I'll display the objectives, (like kill ten mobs, get 12 things...) but for some quest there is no objective like that so I'll display the small description of the quest.
So I have two kind of content to put on my cell:
small one that fit on one line
big one that need to be split on multiple line.
so for the big ones, I'll have to put a maximum width, but I don't want to put an arbitrary one so I want to retrieve the maximum width of the small content, and if it's greater than an arbitrary minimum width I'll give all my big cells the maximum width of small cells, otherwise I'll set it to the minimum width.
Here my problem is to retrieve the maximum width of the small cells, do I have a way to do it without calling the SetupCell function that is already called by the SetCell function.
Or am I completely wrong and the library can "automagically" set the width of my cell to the maximum width of small cells if it's greater that the arbitrary minimum size that I'll put to my big cell?
P.S.: I tried to make it as clear as possible, but as english is not my native language I may not be clear :( ...
There is no way for the cell provider to get the actual width of the column(s) to which the cell is added. But what you should understand is that the "width" returned by SetupCell is actually the minimum width required to properly display the cell. If any other cell in the same column is larger, the given cell will be enlarged accordingly.
So I would suggest to use a custom CellProvided that limits the content width, e.g. : replace "fixedWidth" by "maxWidth" in the previous code sample, and have SetupCell returns "return math.min(width, self.maxWidth), height".
Then use a fairly low number as maxWidth. This way, if the small cells are narrower than your big cell content, the column is enlarged up to maxWidth. And in the contrary, if the small cells are larger than maxWidth, the big cell is enlarged accordingly.
thanks for your help
I tried to get the clickable cell working, but I guess i did something wrong :(
here is what I did for my custom cell provider:
When I try to click on my cell, nothing happen, no error is thrown :(