FLTK 1.4.4

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
59 class 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
66 protected:
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
73 public:
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
Fl_Boxtype
FLTK standard box types.
Definition Enumerations.H:644
Fl_Slider::Fl_Slider
Fl_Slider(int X, int Y, int W, int H, const char *L=0)
Creates a new Fl_Slider widget using the given position, size, and label string.
Definition Fl_Slider.cxx:38
Fl_Slider::slider
void slider(Fl_Boxtype c)
Sets the slider box type.
Definition Fl_Slider.H:102
Fl_Slider::scrollvalue
int scrollvalue(int pos, int size, int first, int total)
Sets the size and position of the sliding knob in the box.
Definition Fl_Slider.cxx:84
Fl_Slider::slider_size
float slider_size() const
Get the dimensions of the moving piece of slider.
Definition Fl_Slider.H:85
Fl_Slider::slider
Fl_Boxtype slider() const
Gets the slider box type.
Definition Fl_Slider.H:99
Fl_Valuator::Fl_Valuator
Fl_Valuator(int X, int Y, int W, int H, const char *L)
Creates a new Fl_Valuator widget using the given position, size, and label string.
Definition Fl_Valuator.cxx:26
Fl_Valuator::bounds
void bounds(double a, double b)
Sets the minimum (a) and maximum (b) values for the valuator widget.
Definition Fl_Valuator.H:75
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::size
void size(int W, int H)
Changes the size of the widget.
Definition Fl_Widget.H:418
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
uchar
unsigned char uchar
unsigned char
Definition fl_types.h:30