FLTK
Fl_Positioner.H
1 //
2 // Positioner header file for the Fast Light Tool Kit (FLTK).
3 //
4 // Copyright 1998-2010 by Bill Spitzak and others.
5 //
6 // This library is free software. Distribution and use rights are outlined in
7 // the file "COPYING" which should have been included with this file. If this
8 // file is missing or damaged, see the license at:
9 //
10 // https://www.fltk.org/COPYING.php
11 //
12 // Please see the following page on how to report bugs and issues:
13 //
14 // https://www.fltk.org/bugs.php
15 //
16 
17 /* \file
18  Fl_Positioner widget . */
19 
20 #ifndef Fl_Positioner_H
21 #define Fl_Positioner_H
22 
23 #ifndef Fl_Widget_H
24 #include "Fl_Widget.H"
25 #endif
26 
35 class FL_EXPORT Fl_Positioner : public Fl_Widget {
36 
37  double xmin, ymin;
38  double xmax, ymax;
39  double xvalue_, yvalue_;
40  double xstep_, ystep_;
41 
42 protected:
43 
44  // these allow subclasses to put the dial in a smaller area:
45  void draw(int, int, int, int);
46  int handle(int, int, int, int, int);
47  void draw();
48 
49 public:
50 
51  int handle(int);
56  Fl_Positioner(int x,int y,int w,int h, const char *l=0);
58  double xvalue() const {return xvalue_;}
60  double yvalue() const {return yvalue_;}
61  int xvalue(double);
62  int yvalue(double);
63  int value(double,double);
64  void xbounds(double, double);
66  double xminimum() const {return xmin;}
68  void xminimum(double a) {xbounds(a,xmax);}
70  double xmaximum() const {return xmax;}
72  void xmaximum(double a) {xbounds(xmin,a);}
73  void ybounds(double, double);
75  double yminimum() const {return ymin;}
77  void yminimum(double a) {ybounds(a, ymax);}
79  double ymaximum() const {return ymax;}
81  void ymaximum(double a) {ybounds(ymin, a);}
83  void xstep(double a) {xstep_ = a;}
85  void ystep(double a) {ystep_ = a;}
86 };
87 
88 #endif
double xmaximum() const
Gets the X axis maximum.
Definition: Fl_Positioner.H:70
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:85
double xvalue() const
Gets the X axis coordinate.
Definition: Fl_Positioner.H:58
void xstep(double a)
Sets the stepping value for the X axis.
Definition: Fl_Positioner.H:83
virtual int handle(int event)
Handles the specified event.
Definition: Fl_Widget.cxx:102
double ymaximum() const
Gets the Y axis maximum.
Definition: Fl_Positioner.H:79
virtual void draw()=0
Draws the widget.
void ymaximum(double a)
Same as ybounds(ymininimum(), a)
Definition: Fl_Positioner.H:81
double xminimum() const
Gets the X axis minimum.
Definition: Fl_Positioner.H:66
void yminimum(double a)
Same as ybounds(a, ymaximum())
Definition: Fl_Positioner.H:77
double yvalue() const
Gets the Y axis coordinate.
Definition: Fl_Positioner.H:60
Fl_Widget, Fl_Label classes .
This class is provided for Forms compatibility.
Definition: Fl_Positioner.H:35
void xminimum(double a)
Same as xbounds(a, xmaximum())
Definition: Fl_Positioner.H:68
void xmaximum(double a)
Same as xbounds(xminimum(), a)
Definition: Fl_Positioner.H:72
void ystep(double a)
Sets the stepping value for the Y axis.
Definition: Fl_Positioner.H:85
double yminimum() const
Gets the Y axis minimum.
Definition: Fl_Positioner.H:75