FLTK 1.4.0
Loading...
Searching...
No Matches
Fl_Scrollbar.H
1//
2// Scroll bar 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_Scrollbar widget . */
19
20#ifndef Fl_Scrollbar_H
21#define Fl_Scrollbar_H
22
23#include "Fl_Slider.H"
24
41class FL_EXPORT Fl_Scrollbar : public Fl_Slider {
42
43 int linesize_;
44 int pushed_;
45 static void timeout_cb(void*);
46 void increment_cb();
47protected:
48 void draw() FL_OVERRIDE;
49
50public:
51
52 Fl_Scrollbar(int X,int Y,int W,int H, const char *L = 0);
54 int handle(int) FL_OVERRIDE;
55
63 int value() const {return int(Fl_Slider::value());}
64
71 int value(int p) {return int(Fl_Slider::value((double)p));}
72
87 int value(int pos, int windowSize, int first_line, int total_lines) {
88 return scrollvalue(pos, windowSize, first_line, total_lines);
89 }
90
94 int linesize() const {return linesize_;}
95
101 void linesize(int i) {linesize_ = i;}
102
103};
104
105#endif
The Fl_Scrollbar widget displays a slider with arrow buttons at the ends of the scrollbar.
Definition Fl_Scrollbar.H:41
int value() const
Gets the integer value (position) of the slider in the scrollbar.
Definition Fl_Scrollbar.H:63
int value(int pos, int windowSize, int first_line, int total_lines)
Sets the position, size and range of the slider in the scrollbar.
Definition Fl_Scrollbar.H:87
int value(int p)
Sets the value (position) of the slider in the scrollbar.
Definition Fl_Scrollbar.H:71
int linesize() const
Get the size of step, in lines, that the arror keys move.
Definition Fl_Scrollbar.H:94
void linesize(int i)
This number controls how big the steps are that the arrow keys do.
Definition Fl_Scrollbar.H:101
The Fl_Slider widget contains a sliding knob inside a box.
Definition Fl_Slider.H:59
void draw() FL_OVERRIDE
Draws the widget.
Definition Fl_Slider.cxx:211
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
double value() const
Gets the floating point(double) value.
Definition Fl_Valuator.H:123
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46