FLTK 1.3.0
Fl_Positioner.H
00001 //
00002 // "$Id: Fl_Positioner.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
00003 //
00004 // Positioner header file for the Fast Light Tool Kit (FLTK).
00005 //
00006 // Copyright 1998-2010 by Bill Spitzak and others.
00007 //
00008 // This library is free software; you can redistribute it and/or
00009 // modify it under the terms of the GNU Library General Public
00010 // License as published by the Free Software Foundation; either
00011 // version 2 of the License, or (at your option) any later version.
00012 //
00013 // This library is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 // Library General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU Library General Public
00019 // License along with this library; if not, write to the Free Software
00020 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00021 // USA.
00022 //
00023 // Please report all bugs and problems on the following page:
00024 //
00025 //     http://www.fltk.org/str.php
00026 //
00027 
00028 /* \file
00029    Fl_Positioner widget . */
00030 
00031 #ifndef Fl_Positioner_H
00032 #define Fl_Positioner_H
00033 
00034 #ifndef Fl_Widget_H
00035 #include "Fl_Widget.H"
00036 #endif
00037 
00046 class FL_EXPORT Fl_Positioner : public Fl_Widget {
00047 
00048   double xmin, ymin;
00049   double xmax, ymax;
00050   double xvalue_, yvalue_;
00051   double xstep_, ystep_;
00052 
00053 protected:
00054 
00055   // these allow subclasses to put the dial in a smaller area:
00056   void draw(int, int, int, int);
00057   int handle(int, int, int, int, int);
00058   void draw();
00059 
00060 public:
00061 
00062   int handle(int);
00067   Fl_Positioner(int x,int y,int w,int h, const char *l=0);
00069   double xvalue() const {return xvalue_;}
00071   double yvalue() const {return yvalue_;}
00072   int xvalue(double);
00073   int yvalue(double);
00074   int value(double,double);
00075   void xbounds(double, double);
00077   double xminimum() const {return xmin;}
00079   void xminimum(double a) {xbounds(a,xmax);}
00081   double xmaximum() const {return xmax;}
00083   void xmaximum(double a) {xbounds(xmin,a);}
00084   void ybounds(double, double);
00086   double yminimum() const {return ymin;}
00088   void yminimum(double a) {ybounds(a, ymax);}
00090   double ymaximum() const {return ymax;}
00092   void ymaximum(double a) {ybounds(ymin, a);}
00094   void xstep(double a) {xstep_ = a;}
00096   void ystep(double a) {ystep_ = a;}
00097 };
00098 
00099 #endif
00100 
00101 //
00102 // End of "$Id: Fl_Positioner.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
00103 //