|
fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) ![]() |
#include <Fl_Adjuster.H>


Public Member Functions | |
| Fl_Adjuster (int X, int Y, int W, int H, const char *l=0) | |
| void | soft (int s) |
| int | soft () const |
Protected Member Functions | |
| void | draw () |
| int | handle (int) |
| void | value_damage () |
The Fl_Adjuster widget was stolen from Prisms, and has proven to be very useful for values that need a large dynamic range.
When you press a button and drag to the right the value increases. When you drag to the left it decreases. The largest button adjusts by 100 * step(), the next by 10 * step() and that smallest button by step(). Clicking on the buttons increments by 10 times the amount dragging by a pixel does. Shift + click decrements by 10 times the amount.
Definition at line 52 of file Fl_Adjuster.H.
| Fl_Adjuster::Fl_Adjuster | ( | int | X, |
| int | Y, | ||
| int | W, | ||
| int | H, | ||
| const char * | l = 0 |
||
| ) |
Creates a new Fl_Adjuster widget using the given position, size, and label string. It looks best if one of the dimensions is 3 times the other.
Inherited destructor destroys the Valuator.
Definition at line 171 of file Fl_Adjuster.cxx.
References Fl_Widget::box(), FL_SELECTION_COLOR, FL_UP_BOX, Fl_Widget::selection_color(), and Fl_Valuator::step().
| void Fl_Adjuster::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.
Definition at line 43 of file Fl_Adjuster.cxx.
References Fl_Widget::active_r(), Fl_Widget::box(), Fl_Widget::color(), Fl_Bitmap::draw(), Fl_Widget::draw_box(), Fl_Widget::draw_focus(), dx, dy, fastarrow_height, fastarrow_width, fl_color(), FL_DOWN_BOX, fl_inactive(), Fl::focus(), Fl_Widget::h(), H, mediumarrow_height, mediumarrow_width, Fl_Widget::selection_color(), slowarrow_width, Fl_Widget::w(), Fl_Widget::x(), and Fl_Widget::y().
| int Fl_Adjuster::handle | ( | int | event | ) | [protected, 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.
Definition at line 68 of file Fl_Adjuster.cxx.
References Fl_Valuator::clamp(), Fl_Widget_Tracker::deleted(), Fl::event_is_click(), Fl::event_key(), Fl::event_state(), Fl::event_x(), Fl::event_y(), FL_Down, FL_DRAG, FL_ENTER, FL_FOCUS, FL_KEYBOARD, FL_LEAVE, FL_Left, FL_PUSH, FL_RELEASE, FL_Right, FL_UNFOCUS, FL_Up, Fl::focus(), Fl_Widget::h(), Fl_Valuator::handle_drag(), Fl_Valuator::handle_push(), Fl_Valuator::handle_release(), Fl_Valuator::increment(), Fl_Valuator::previous_value(), Fl_Widget::redraw(), soft(), Fl_Valuator::softclamp(), Fl_Valuator::value(), Fl::visible_focus(), Fl_Widget::w(), Fl_Widget::x(), and Fl_Widget::y().
| void Fl_Adjuster::soft | ( | int | s | ) | [inline] |
If "soft" is turned on, the user is allowed to drag the value outside the range. If they drag the value to one of the ends, let go, then grab again and continue to drag, they can get to any value. Default is one.
Definition at line 69 of file Fl_Adjuster.H.
| int Fl_Adjuster::soft | ( | ) | const [inline] |
If "soft" is turned on, the user is allowed to drag the value outside the range. If they drag the value to one of the ends, let go, then grab again and continue to drag, they can get to any value. Default is one.
Definition at line 76 of file Fl_Adjuster.H.
Referenced by handle().
| void Fl_Adjuster::value_damage | ( | ) | [protected, virtual] |
Asks for partial redraw
Reimplemented from Fl_Valuator.
Definition at line 41 of file Fl_Adjuster.cxx.