FLTK: Fl_Slider.H Source File

FLTK

Fl_Slider.H
1 //
2 // "$Id$"
3 //
4 // Slider header file for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2010 by Bill Spitzak and others.
7 //
8 // This library is free software. Distribution and use rights are outlined in
9 // the file "COPYING" which should have been included with this file. If this
10 // file is missing or damaged, see the license at:
11 //
12 // http://www.fltk.org/COPYING.php
13 //
14 // Please report all bugs and problems on the following page:
15 //
16 // http://www.fltk.org/str.php
17 //
18
19 /* \file
20 Fl_Slider widget . */
21
22 #ifndef Fl_Slider_H
23 #define Fl_Slider_H
24
25 #ifndef Fl_Valuator_H
26 #include "Fl_Valuator.H"
27 #endif
28
29 // values for type(), lowest bit indicate horizontal:
30 #define FL_VERT_SLIDER 0
31 #define FL_HOR_SLIDER 1
32 #define FL_VERT_FILL_SLIDER 2
33 #define FL_HOR_FILL_SLIDER 3
34 #define FL_VERT_NICE_SLIDER 4
35 #define FL_HOR_NICE_SLIDER 5
36
61 class FL_EXPORT Fl_Slider : public Fl_Valuator {
62
63 float slider_size_;
64 uchar slider_;
65 void _Fl_Slider();
66 void draw_bg(int, int, int, int);
67
68 protected:
69
70 // these allow subclasses to put the slider in a smaller area:
71 void draw(int, int, int, int);
72 int handle(int, int, int, int, int);
73 void draw();
74
75 public:
76
77 int handle(int);
78 Fl_Slider(int X,int Y,int W,int H, const char *L = 0);
79 Fl_Slider(uchar t,int X,int Y,int W,int H, const char *L);
80
81 int scrollvalue(int pos,int size,int first,int total);
82 void bounds(double a, double b);
83
87 float slider_size() const {return slider_size_;}
88
98 void slider_size(double v);
99
101 Fl_Boxtype slider() const {return (Fl_Boxtype)slider_;}
102
104 void slider(Fl_Boxtype c) {slider_ = c;}
105 };
106
107 #endif
108
109 //
110 // End of "$Id$".
111 //
Fl_Boxtype
Fl_Boxtype
Definition: Enumerations.H:603
Fl_Slider
The Fl_Slider widget contains a sliding knob inside a box.
Definition: Fl_Slider.H:61
Fl_Slider::slider
Fl_Boxtype slider() const
Gets the slider box type.
Definition: Fl_Slider.H:101
Fl_Widget::handle
virtual int handle(int event)
Handles the specified event.
Definition: Fl_Widget.cxx:112
Fl_Slider::slider_size
float slider_size() const
Get the dimensions of the moving piece of slider.
Definition: Fl_Slider.H:87
Fl_Valuator
The Fl_Valuator class controls a single floating-point value and provides a consistent interface to s...
Definition: Fl_Valuator.H:49
Fl_Slider::slider
void slider(Fl_Boxtype c)
Sets the slider box type.
Definition: Fl_Slider.H:104
Fl_Widget::draw
virtual void draw()=0
Draws the widget.
uchar
unsigned char uchar
unsigned char
Definition: fl_types.h:30
Fl_Valuator::bounds
void bounds(double a, double b)
Sets the minimum (a) and maximum (b) values for the valuator widget.
Definition: Fl_Valuator.H:75
- © 1998-2016 by Bill Spitzak and others.