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)  

Fl_Value_Slider Class Reference

#include <Fl_Value_Slider.H>

Inheritance diagram for Fl_Value_Slider:
Collaboration diagram for Fl_Value_Slider:

List of all members.

Public Member Functions

int handle (int)
 Fl_Value_Slider (int x, int y, int w, int h, const char *l=0)
Fl_Font textfont () const
void textfont (Fl_Font s)
Fl_Fontsize textsize () const
void textsize (Fl_Fontsize s)
Fl_Color textcolor () const
void textcolor (Fl_Color s)

Protected Member Functions

void draw ()

Detailed Description

The Fl_Value_Slider widget is a Fl_Slider widget with a box displaying the current value.

value_slider.png

Definition at line 42 of file Fl_Value_Slider.H.


Constructor & Destructor Documentation

Fl_Value_Slider::Fl_Value_Slider ( int  X,
int  Y,
int  W,
int  H,
const char *  l = 0 
)

Creates a new Fl_Value_Slider widget using the given position, size, and label string. The default boxtype is FL_DOWN_BOX.

Definition at line 37 of file Fl_Value_Slider.cxx.

References FL_FOREGROUND_COLOR, FL_HELVETICA, and Fl_Valuator::step().


Member Function Documentation

void Fl_Value_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()

Reimplemented from Fl_Slider.

Definition at line 45 of file Fl_Value_Slider.cxx.

References Fl_Widget::active_r(), Fl_Widget::box(), Fl::box_dh(), Fl::box_dw(), Fl::box_dx(), Fl::box_dy(), buf, Fl_Widget::color(), Fl_Widget::damage(), Fl_Widget::draw_box(), FL_ALIGN_CLIP, fl_color(), FL_DAMAGE_ALL, fl_draw(), fl_font(), fl_inactive(), Fl_Valuator::format(), Fl_Widget::h(), Fl_Valuator::horizontal(), textcolor(), textfont(), textsize(), Fl_Widget::w(), Fl_Widget::x(), and Fl_Widget::y().

int Fl_Value_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.

Parameters:
[in]eventthe kind of event received
Return values:
0if the event was not used or understood
1if the event was used and can be deleted
See also:
Fl_Event

Reimplemented from Fl_Slider.

Definition at line 66 of file Fl_Value_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(), Fl_Valuator::horizontal(), Fl_Widget::redraw(), Fl::visible_focus(), Fl_Widget::w(), Fl_Widget::x(), and Fl_Widget::y().

void Fl_Value_Slider::textcolor ( Fl_Color  s) [inline]

Sets the color of the text in the value box.

Definition at line 62 of file Fl_Value_Slider.H.

Fl_Color Fl_Value_Slider::textcolor ( ) const [inline]

Gets the color of the text in the value box.

Definition at line 60 of file Fl_Value_Slider.H.

Referenced by draw().

Fl_Font Fl_Value_Slider::textfont ( ) const [inline]

Gets the typeface of the text in the value box.

Definition at line 52 of file Fl_Value_Slider.H.

Referenced by draw().

void Fl_Value_Slider::textfont ( Fl_Font  s) [inline]

Sets the typeface of the text in the value box.

Definition at line 54 of file Fl_Value_Slider.H.

void Fl_Value_Slider::textsize ( Fl_Fontsize  s) [inline]

Sets the size of the text in the value box.

Definition at line 58 of file Fl_Value_Slider.H.

Fl_Fontsize Fl_Value_Slider::textsize ( ) const [inline]

Gets the size of the text in the value box.

Definition at line 56 of file Fl_Value_Slider.H.

Referenced by draw().


The documentation for this class was generated from the following files: