|
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_Slider.H>


Public Member Functions | |
| int | handle (int) |
| Fl_Slider (int X, int Y, int W, int H, const char *L=0) | |
| Fl_Slider (uchar t, int X, int Y, int W, int H, const char *L) | |
| int | scrollvalue (int pos, int size, int first, int total) |
| void | bounds (double a, double b) |
| float | slider_size () const |
| void | slider_size (double v) |
| Fl_Boxtype | slider () const |
| void | slider (Fl_Boxtype c) |
Protected Member Functions | |
| void | draw (int, int, int, int) |
| int | handle (int, int, int, int, int) |
| void | draw () |
The Fl_Slider widget contains a sliding knob inside a box. It if often used as a scrollbar. Moving the box all the way to the top/left sets it to the minimum(), and to the bottom/right to the maximum(). The minimum() may be greater than the maximum() to reverse the slider direction.
Use void Fl_Widget::type(int) to set how the slider is drawn, which can be one of the following:
Definition at line 70 of file Fl_Slider.H.
| Fl_Slider::Fl_Slider | ( | int | X, |
| int | Y, | ||
| int | W, | ||
| int | H, | ||
| const char * | L = 0 |
||
| ) |
Creates a new Fl_Slider widget using the given position, size, and label string. The default boxtype is FL_DOWN_BOX.
Definition at line 43 of file Fl_Slider.cxx.
References Fl_Widget::box(), and FL_DOWN_BOX.
| Fl_Slider::Fl_Slider | ( | uchar | t, |
| int | X, | ||
| int | Y, | ||
| int | W, | ||
| int | H, | ||
| const char * | L | ||
| ) |
Creates a new Fl_Slider widget using the given box type, position, size, and label string.
Definition at line 53 of file Fl_Slider.cxx.
References Fl_Widget::box(), FL_DOWN_BOX, FL_FLAT_BOX, FL_HOR_NICE_SLIDER, FL_VERT_NICE_SLIDER, and Fl_Widget::type().
| void Fl_Slider::bounds | ( | double | a, |
| double | b | ||
| ) |
Sets the minimum (a) and maximum (b) values for the valuator widget. if at least one of the values is changed, a partial redraw is asked.
Reimplemented from Fl_Valuator.
Definition at line 74 of file Fl_Slider.cxx.
References Fl_Widget::damage(), FL_DAMAGE_EXPOSE, Fl_Valuator::maximum(), and Fl_Valuator::minimum().
Referenced by scrollvalue(), and Fl_Table::table_resized().
| void Fl_Slider::draw | ( | int | X, |
| int | Y, | ||
| int | W, | ||
| int | H | ||
| ) | [protected] |
Definition at line 117 of file Fl_Slider.cxx.
References Fl_Widget::box(), Fl_Widget::draw_box(), Fl_Widget::draw_focus(), Fl_Widget::draw_label(), fl_color(), fl_darker(), FL_GRAY, FL_HOR_FILL_SLIDER, FL_HOR_NICE_SLIDER, fl_lighter(), fl_line(), FL_THIN_DOWN_BOX, FL_UP_BOX, FL_VERT_FILL_SLIDER, FL_VERT_NICE_SLIDER, Fl::focus(), H, Fl_Valuator::horizontal(), int, Fl_Valuator::maximum(), Fl_Valuator::minimum(), Fl::scheme_, Fl_Widget::selection_color(), slider(), Fl_Widget::type(), val, and Fl_Valuator::value().
| void Fl_Slider::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.
Reimplemented in Fl_Scrollbar, and Fl_Value_Slider.
Definition at line 216 of file Fl_Slider.cxx.
References Fl_Widget::box(), Fl::box_dh(), Fl::box_dw(), Fl::box_dx(), Fl::box_dy(), Fl_Widget::damage(), Fl_Widget::draw_box(), FL_DAMAGE_ALL, Fl_Widget::h(), Fl_Widget::w(), Fl_Widget::x(), and Fl_Widget::y().
| int Fl_Slider::handle | ( | int | event, |
| int | X, | ||
| int | Y, | ||
| int | W, | ||
| int | H | ||
| ) | [protected] |
Definition at line 224 of file Fl_Slider.cxx.
References Fl_Valuator::clamp(), Fl_Widget_Tracker::deleted(), Fl::event_inside(), Fl::event_key(), Fl::event_x(), Fl::event_y(), FL_Down, FL_DRAG, FL_ENTER, FL_FOCUS, FL_HOR_FILL_SLIDER, FL_HOR_NICE_SLIDER, FL_KEYBOARD, FL_LEAVE, FL_Left, FL_PUSH, FL_RELEASE, FL_Right, FL_UNFOCUS, FL_Up, FL_VERT_FILL_SLIDER, FL_VERT_NICE_SLIDER, H, Fl_Valuator::handle_drag(), Fl_Valuator::handle_push(), Fl_Valuator::handle_release(), Fl_Valuator::horizontal(), Fl_Valuator::increment(), int, Fl_Valuator::maximum(), Fl_Valuator::minimum(), Fl_Widget::redraw(), Fl_Valuator::round(), Fl_Widget::type(), val, Fl_Valuator::value(), and Fl::visible_focus().
Referenced by handle().
| int Fl_Slider::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.
Reimplemented in Fl_Scrollbar, and Fl_Value_Slider.
Definition at line 354 of file Fl_Slider.cxx.
References Fl_Widget::box(), Fl::box_dh(), Fl::box_dw(), Fl::box_dx(), Fl::box_dy(), FL_PUSH, Fl::focus(), Fl_Widget::h(), handle(), Fl_Widget::redraw(), Fl::visible_focus(), Fl_Widget::w(), Fl_Widget::x(), and Fl_Widget::y().
| int Fl_Slider::scrollvalue | ( | int | pos, |
| int | size, | ||
| int | first, | ||
| int | total | ||
| ) |
Sets the size and position of the sliding knob in the box.
| [in] | pos | position of first line displayed |
| [in] | size | size of window in lines |
| [in] | first | number of first line |
| [in] | total | total number of lines Returns Fl_Valuator::value(p) |
Definition at line 89 of file Fl_Slider.cxx.
References bounds(), slider_size(), Fl_Valuator::step(), and Fl_Valuator::value().
Referenced by Fl_Scrollbar::value().
| void Fl_Slider::slider | ( | Fl_Boxtype | c | ) | [inline] |
Sets the slider box type.
Definition at line 113 of file Fl_Slider.H.
| Fl_Boxtype Fl_Slider::slider | ( | ) | const [inline] |
Gets the slider box type.
Definition at line 110 of file Fl_Slider.H.
Referenced by draw(), Fl_Scrollbar::draw(), and Fl_Scrollbar::Fl_Scrollbar().
| void Fl_Slider::slider_size | ( | double | v | ) |
Set the dimensions of the moving piece of slider. This is the fraction of the size of the entire widget. If you set this to 1 then the slider cannot move. The default value is .08.
For the "fill" sliders this is the size of the area around the end that causes a drag effect rather than causing the slider to jump to the mouse.
Definition at line 61 of file Fl_Slider.cxx.
References Fl_Widget::damage(), and FL_DAMAGE_EXPOSE.
| float Fl_Slider::slider_size | ( | ) | const [inline] |
Get the dimensions of the moving piece of slider.
Definition at line 96 of file Fl_Slider.H.
Referenced by Fl_Widget_Type::copy_properties(), Fl_Tree::draw(), Fl_Scrollbar::handle(), scrollvalue(), and Fl_Table::table_resized().