fltk/FL/Fl_Tooltip.H
Michael R Sweet 8e3cdc0ac1 Propagate events from the tooltip window to the widget we are tooltipping
for...

Add "tooltips" resource for default state of tooltips.

Fix another tooltip cycling problem.

Fix default help and argument processing (didn't have the right min
chars for matching, and didn't list new options)

Update docos to list new tooltip resource and list of standard arguments.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2079 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2002-04-14 02:43:48 +00:00

82 lines
2.4 KiB
C++

//
// "$Id: Fl_Tooltip.H,v 1.16.2.7 2002/04/14 02:43:48 easysw Exp $"
//
// Tooltip header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2002 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems to "fltk-bugs@fltk.org".
//
#ifndef _Fl_Tooltip_H_
#define _Fl_Tooltip_H_
#include <FL/Fl.H>
#include <FL/Fl_Widget.H>
class Fl_Tooltip_Box;
class Fl_Tooltip_Window;
class FL_EXPORT Fl_Tooltip {
friend class Fl_Tooltip_Box;
friend class Fl_Tooltip_Window;
friend class Fl_Widget;
static float delay_;
static Fl_Tooltip_Box *box;
static Fl_Tooltip_Window *window;
static Fl_Widget *widget;
static int shown;
static unsigned color_;
static int font_;
static int size_;
static void tooltip_timeout(void *);
static void tooltip_exit(Fl_Widget *);
static void (*tooltip_callback_)(void *);
static void (*tooltip_exit_)(void *);
public:
// These functions are user-called functions
static float delay() { return delay_; }
static void delay(float f) { delay_ = (f < 0.1f) ? 0.1f : f; }
static int font() { return font_; }
static int size() { return size_; }
static void font(int i) { font_ = i; }
static void size(int s) { size_ = s; }
static void color(unsigned c) { color_ = c; }
static Fl_Color color() { return (Fl_Color)color_; }
static void enter(Fl_Widget *w);
static void exit(Fl_Widget *w);
static int enabled() {return tooltip_callback_ != 0;}
static void enable(int b = 1) {if (!b) enter(0); tooltip_callback_ = b ? tooltip_timeout : 0; tooltip_exit_ = b ? (void (*)(void *))tooltip_exit : 0;}
static void disable() {enter(0); tooltip_callback_ = 0; tooltip_exit_ = 0;}
};
#endif
//
// End of "$Id: Fl_Tooltip.H,v 1.16.2.7 2002/04/14 02:43:48 easysw Exp $".
//