This is provided only to emulate the Forms Timer widget. More...
#include <Fl_Timer.H>
Public Member Functions | |
void | direction (char d) |
Gets or sets the direction of the timer. | |
char | direction () const |
Gets or sets the direction of the timer. | |
Fl_Timer (uchar t, int x, int y, int w, int h, const char *l) | |
Creates a new Fl_Timer widget using the given type, position, size, and label string. | |
int | handle (int) |
Handles the specified event. | |
void | suspended (char d) |
Gets or sets whether the timer is suspended. | |
char | suspended () const |
Gets or sets whether the timer is suspended. | |
double | value () const |
See void Fl_Timer::value(double). | |
void | value (double) |
Sets the current timer value. | |
~Fl_Timer () | |
Destroys the timer and removes the timeout. | |
Protected Member Functions | |
void | draw () |
Draws the widget. |
This is provided only to emulate the Forms Timer widget.
It works by making a timeout callback every 1/5 second. This is wasteful and inaccurate if you just want something to happen a fixed time in the future. You should directly call Fl::add_timeout() instead.
Fl_Timer::Fl_Timer | ( | uchar | t, | |
int | X, | |||
int | Y, | |||
int | W, | |||
int | H, | |||
const char * | l | |||
) |
Creates a new Fl_Timer widget using the given type, position, size, and label string.
The type parameter can be any of the following symbolic constants:
void Fl_Timer::direction | ( | char | d | ) | [inline] |
Gets or sets the direction of the timer.
If the direction is zero then the timer will count up, otherwise it will count down from the initial value().
char Fl_Timer::direction | ( | ) | const [inline] |
Gets or sets the direction of the timer.
If the direction is zero then the timer will count up, otherwise it will count down from the initial value().
void Fl_Timer::draw | ( | ) | [protected, virtual] |
Draws the widget.
Never call this function directly. FLTK will schedule redrawing whenever needed. If your widget must be redrawn as soon as possible, call redraw() instead.
Override this function to draw your own widgets.
If you ever need to call another widget's draw method from within your own draw() method, e.g. for an embedded scrollbar, you can do it (because draw() is virtual) like this:
Fl_Widget *s = &scroll; // scroll is an embedded Fl_Scrollbar s->draw(); // calls Fl_Scrollbar::draw()
Implements Fl_Widget.
int Fl_Timer::handle | ( | int | event | ) | [virtual] |
Handles the specified event.
You normally don't call this method directly, but instead let FLTK do it when the user interacts with the widget.
When implemented in a widget, this function must return 0 if the widget does not use the event or 1 otherwise.
Most of the time, you want to call the inherited handle() method in your overridden method so that you don't short-circuit events that you don't handle. In this last case you should return the callee retval.
[in] | event | the kind of event received |
0 | if the event was not used or understood | |
1 | if the event was used and can be deleted |
Reimplemented from Fl_Widget.
void Fl_Timer::suspended | ( | char | d | ) |
Gets or sets whether the timer is suspended.
char Fl_Timer::suspended | ( | ) | const [inline] |
Gets or sets whether the timer is suspended.