summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2015-09-01 14:27:45 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2015-09-01 14:27:45 +0000
commitd99d22cf916fcf775eca8d3fb766d9421a87e027 (patch)
tree07e0cde8228a65a5ea73fb42194eaed8e463e588
parente31c8cd758be037aac3dcb73af1d9ac2ffb23939 (diff)
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
-rw-r--r--src/Fl_Tooltip.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx
index 159d2929a..cff54fae5 100644
--- a/src/Fl_Tooltip.cxx
+++ b/src/Fl_Tooltip.cxx
@@ -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;