1 //
2 // "$Id: Fl_Slider.H 4288 2005-04-16 00:13:17Z mike $"
3 //
4 // Slider header file for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2005 by Bill Spitzak and others.
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // Library General Public License for more details.
17 //
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
21 // USA.
22 //
23 // Please report all bugs and problems on the following page:
24 //
25 //     http://www.fltk.org/str.php
26 //
27 
28 #ifndef Fl_Slider_H
29 #define Fl_Slider_H
30 
31 #ifndef Fl_Valuator_H
32 #include "Fl_Valuator.H"
33 #endif
34 
35 // values for type(), lowest bit indicate horizontal:
36 #define FL_VERT_SLIDER		0
37 #define FL_HOR_SLIDER		1
38 #define FL_VERT_FILL_SLIDER	2
39 #define FL_HOR_FILL_SLIDER	3
40 #define FL_VERT_NICE_SLIDER	4
41 #define FL_HOR_NICE_SLIDER	5
42 
43 class FL_EXPORT Fl_Slider : public Fl_Valuator {
44 
45   float slider_size_;
46   uchar slider_;
47   void _Fl_Slider();
48   void draw_bg(int, int, int, int);
49 
50 protected:
51 
52   // these allow subclasses to put the slider in a smaller area:
53   void draw(int, int, int, int);
54   int handle(int, int, int, int, int);
55 
56 public:
57 
58   void draw();
59   int handle(int);
60   Fl_Slider(int x,int y,int w,int h, const char *l = 0);
61   Fl_Slider(uchar t,int x,int y,int w,int h, const char *l);
62 
63   int scrollvalue(int windowtop,int windowsize,int first,int totalsize);
64   void bounds(double a, double b);
slider_size()65   float slider_size() const {return slider_size_;}
66   void slider_size(double v);
slider()67   Fl_Boxtype slider() const {return (Fl_Boxtype)slider_;}
slider(Fl_Boxtype c)68   void slider(Fl_Boxtype c) {slider_ = c;}
69 };
70 
71 #endif
72 
73 //
74 // End of "$Id: Fl_Slider.H 4288 2005-04-16 00:13:17Z mike $".
75 //
76