FLTK 1.4.4

Loading...
Searching...
No Matches
Fl_Positioner.H
1//
2// Positioner header file for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 1998-2022 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() FL_OVERRIDE;
48
49 public:
50
51 int handle(int) FL_OVERRIDE;
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
Fl_Widget.H
Fl_Widget and Fl_Label classes.
Fl_Positioner::xmaximum
void xmaximum(double a)
Same as xbounds(xminimum(), a)
Definition Fl_Positioner.H:72
Fl_Positioner::xminimum
void xminimum(double a)
Same as xbounds(a, xmaximum())
Definition Fl_Positioner.H:68
Fl_Positioner::ymaximum
double ymaximum() const
Gets the Y axis maximum.
Definition Fl_Positioner.H:79
Fl_Positioner::xminimum
double xminimum() const
Gets the X axis minimum.
Definition Fl_Positioner.H:66
Fl_Positioner::yminimum
double yminimum() const
Gets the Y axis minimum.
Definition Fl_Positioner.H:75
Fl_Positioner::ystep
void ystep(double a)
Sets the stepping value for the Y axis.
Definition Fl_Positioner.H:85
Fl_Positioner::yminimum
void yminimum(double a)
Same as ybounds(a, ymaximum())
Definition Fl_Positioner.H:77
Fl_Positioner::xvalue
double xvalue() const
Gets the X axis coordinate.
Definition Fl_Positioner.H:58
Fl_Positioner::Fl_Positioner
Fl_Positioner(int x, int y, int w, int h, const char *l=0)
Creates a new Fl_Positioner widget using the given position, size, and label string.
Definition Fl_Positioner.cxx:123
Fl_Positioner::xstep
void xstep(double a)
Sets the stepping value for the X axis.
Definition Fl_Positioner.H:83
Fl_Positioner::xbounds
void xbounds(double, double)
Sets the X axis bounds.
Definition Fl_Positioner.cxx:136
Fl_Positioner::ybounds
void ybounds(double, double)
Sets the Y axis bounds.
Definition Fl_Positioner.cxx:144
Fl_Positioner::yvalue
double yvalue() const
Gets the Y axis coordinate.
Definition Fl_Positioner.H:60
Fl_Positioner::ymaximum
void ymaximum(double a)
Same as ybounds(ymininimum(), a)
Definition Fl_Positioner.H:81
Fl_Positioner::xmaximum
double xmaximum() const
Gets the X axis maximum.
Definition Fl_Positioner.H:70
Fl_Widget::draw
virtual void draw()=0
Draws the widget.
Fl_Widget::handle
virtual int handle(int event)
Handles the specified event.
Definition Fl_Widget.cxx:102
Fl_Widget::x
void x(int v)
Internal use only.
Definition Fl_Widget.H:150
Fl_Widget::w
void w(int v)
Internal use only.
Definition Fl_Widget.H:154
Fl_Widget::y
void y(int v)
Internal use only.
Definition Fl_Widget.H:152
Fl_Widget::h
void h(int v)
Internal use only.
Definition Fl_Widget.H:156
FL_OVERRIDE
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46