FLTK 1.4.0
Loading...
Searching...
No Matches
Fl_Slider.H
1//
2// Slider 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_Slider widget . */
19
20#ifndef Fl_Slider_H
21#define Fl_Slider_H
22
23#ifndef Fl_Valuator_H
24#include "Fl_Valuator.H"
25#endif
26
27// values for type(), lowest bit indicate horizontal:
28#define FL_VERT_SLIDER 0
29#define FL_HOR_SLIDER 1
30#define FL_VERT_FILL_SLIDER 2
31#define FL_HOR_FILL_SLIDER 3
32#define FL_VERT_NICE_SLIDER 4
33#define FL_HOR_NICE_SLIDER 5
34
59class FL_EXPORT Fl_Slider : public Fl_Valuator {
60
61 float slider_size_;
62 uchar slider_;
63 void _Fl_Slider();
64 void draw_bg(int, int, int, int);
65
66protected:
67
68 // these allow subclasses to put the slider in a smaller area:
69 void draw(int, int, int, int);
70 int handle(int, int, int, int, int);
71 void draw() FL_OVERRIDE;
72
73public:
74
75 int handle(int) FL_OVERRIDE;
76 Fl_Slider(int X,int Y,int W,int H, const char *L = 0);
77 Fl_Slider(uchar t,int X,int Y,int W,int H, const char *L);
78
79 int scrollvalue(int pos,int size,int first,int total);
80 void bounds(double a, double b);
81
85 float slider_size() const {return slider_size_;}
86
96 void slider_size(double v);
97
99 Fl_Boxtype slider() const {return (Fl_Boxtype)slider_;}
100
102 void slider(Fl_Boxtype c) {slider_ = c;}
103};
104
105#endif
Fl_Boxtype
FLTK standard box types.
Definition Enumerations.H:626
The Fl_Slider widget contains a sliding knob inside a box.
Definition Fl_Slider.H:59
void slider(Fl_Boxtype c)
Sets the slider box type.
Definition Fl_Slider.H:102
float slider_size() const
Get the dimensions of the moving piece of slider.
Definition Fl_Slider.H:85
Fl_Boxtype slider() const
Gets the slider box type.
Definition Fl_Slider.H:99
The Fl_Valuator class controls a single floating-point value and provides a consistent interface to s...
Definition Fl_Valuator.H:47
void bounds(double a, double b)
Sets the minimum (a) and maximum (b) values for the valuator widget.
Definition Fl_Valuator.H:73
virtual void draw()=0
Draws the widget.
virtual int handle(int event)
Handles the specified event.
Definition Fl_Widget.cxx:102
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46
unsigned char uchar
unsigned char
Definition fl_types.h:30