Ter, 2009-02-10 ?s 16:55 -0300, Jorge Arellano Cid escreveu:
On Mon, Feb 09, 2009 at 09:23:38PM +0000, Jo?o Ricardo Louren?o wrote:
A simple update.
I've fixed most issues I found. For instance, we were processing the click on PUSH and not RELEASE, that was causing some problems and The issue I talked about earlier (working while not visible).
Good.
I've got a working tooltip, added to CustTabGroup.
Good 2. I feared this could be harder.
The only problem is drawing into the button. Should I use an image (or multiple images, mouseover, etc...)? Should I add a cross ('X') to it? Adding a cross is easy, adding an image involves digging some more but it is obviously doable.
Try drawing a cross with a couple of lines. After all this is a well-baheved workaround, but no more. At some point in time it will be fixed in FLTK (I hope).
Fixed a couple more issues relating to focus and events getting lost, including the tooltip not showing up after fixing some of these. To draw the 'X', I thought of writting an 'X' there. This turned out OK: I set the color to black and, then, determine the positions of the 'X' based on fltk::measure. I thought the cross was too 'thin' so I decided to use a bold font. Now here comes the problem. For some reason, measure() uses the previously set font (although the selected is printed)). Maybe I'm missing something, here's the code: fltk::setfont(fltk::getfont()->bold(), fltk::getsize()); int textW=0, textH=0; fltk::measure("X", textW, textH, ALIGN_CENTER); MSG("W: %d, H: %d.\n", textW, textH); fltk::drawtext("X", btn_x+textW, textH); Any change to setfont() (bold, font itself) does not affect measure, which affects the positioning of the cross... I tried to draw the lines, but they were simply too 'choppy' and it even looks better with the 'skinny text' itself. Thanks, Jo?o