FLTK 1.3.3
Fl_Positioner.H
1 //
2 // "$Id: Fl_Positioner.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
3 //
4 // Positioner 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_Positioner widget . */
21 
22 #ifndef Fl_Positioner_H
23 #define Fl_Positioner_H
24 
25 #ifndef Fl_Widget_H
26 #include "Fl_Widget.H"
27 #endif
28 
37 class FL_EXPORT Fl_Positioner : public Fl_Widget {
38 
39  double xmin, ymin;
40  double xmax, ymax;
41  double xvalue_, yvalue_;
42  double xstep_, ystep_;
43 
44 protected:
45 
46  // these allow subclasses to put the dial in a smaller area:
47  void draw(int, int, int, int);
48  int handle(int, int, int, int, int);
49  void draw();
50 
51 public:
52 
53  int handle(int);
58  Fl_Positioner(int x,int y,int w,int h, const char *l=0);
60  double xvalue() const {return xvalue_;}
62  double yvalue() const {return yvalue_;}
63  int xvalue(double);
64  int yvalue(double);
65  int value(double,double);
66  void xbounds(double, double);
68  double xminimum() const {return xmin;}
70  void xminimum(double a) {xbounds(a,xmax);}
72  double xmaximum() const {return xmax;}
74  void xmaximum(double a) {xbounds(xmin,a);}
75  void ybounds(double, double);
77  double yminimum() const {return ymin;}
79  void yminimum(double a) {ybounds(a, ymax);}
81  double ymaximum() const {return ymax;}
83  void ymaximum(double a) {ybounds(ymin, a);}
85  void xstep(double a) {xstep_ = a;}
87  void ystep(double a) {ystep_ = a;}
88 };
89 
90 #endif
91 
92 //
93 // End of "$Id: Fl_Positioner.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
94 //