Fix confusing argument value to fl_measure() in tooltip handling.
The argument 'draw_symbols' was inconsistently set with the intended tooltip label alignment. This was confusing, but didn't do any harm since the value was != 0 anyway. Also added the 'image' and 'draw_symbols' argument to fl_draw() call. Defined static constant draw_symbols_ for potential later inclusion in Fl_Tooltip class and code clarification. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10850 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
e31c8cd758
commit
d99d22cf91
@ -3,7 +3,7 @@
|
||||
//
|
||||
// Tooltip source file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2011 by Bill Spitzak and others.
|
||||
// Copyright 1998-2015 by Bill Spitzak and others.
|
||||
//
|
||||
// This library is free software. Distribution and use rights are outlined in
|
||||
// the file "COPYING" which should have been included with this file. If this
|
||||
@ -38,6 +38,10 @@ int Fl_Tooltip::wrap_width_ = 400;
|
||||
#endif
|
||||
|
||||
static const char* tip;
|
||||
|
||||
// FIXME: this should be a static class variable: Fl_Tooltip::draw_symbols_
|
||||
static const int draw_symbols_ = 1; // 1 = draw @-symbols in tooltips, 0 = no
|
||||
|
||||
/**
|
||||
This widget creates a tooltip box window, with no caption.
|
||||
*/
|
||||
@ -82,8 +86,8 @@ Fl_Window *Fl_Tooltip::current_window(void)
|
||||
void Fl_TooltipBox::layout() {
|
||||
fl_font(Fl_Tooltip::font(), Fl_Tooltip::size());
|
||||
int ww = Fl_Tooltip::wrap_width();
|
||||
int hh;
|
||||
fl_measure(tip, ww, hh, FL_ALIGN_LEFT|FL_ALIGN_WRAP|FL_ALIGN_INSIDE);
|
||||
int hh = 0;
|
||||
fl_measure(tip, ww, hh, draw_symbols_);
|
||||
ww += (Fl_Tooltip::margin_width() * 2);
|
||||
hh += (Fl_Tooltip::margin_height() * 2);
|
||||
|
||||
@ -116,7 +120,7 @@ void Fl_TooltipBox::draw() {
|
||||
int Y = Fl_Tooltip::margin_height();
|
||||
int W = w() - (Fl_Tooltip::margin_width()*2);
|
||||
int H = h() - (Fl_Tooltip::margin_height()*2);
|
||||
fl_draw(tip, X, Y, W, H, Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_WRAP));
|
||||
fl_draw(tip, X, Y, W, H, Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_WRAP), 0, draw_symbols_);
|
||||
}
|
||||
|
||||
static char recent_tooltip;
|
||||
|
Loading…
Reference in New Issue
Block a user