FLTK 1.4.5: Fl_Scrollbar.H Source File

FLTK 1.4.5

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
41 class 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);
53 ~Fl_Scrollbar();
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
Fl_Scrollbar::handle
int handle(int) FL_OVERRIDE
Handles the specified event.
Definition Fl_Scrollbar.cxx:64
Fl_Scrollbar::value
int value() const
Gets the integer value (position) of the slider in the scrollbar.
Definition Fl_Scrollbar.H:63
Fl_Scrollbar::value
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
Fl_Scrollbar::Fl_Scrollbar
Fl_Scrollbar(int X, int Y, int W, int H, const char *L=0)
Creates a new Fl_Scrollbar widget with given position, size, and label.
Definition Fl_Scrollbar.cxx:257
Fl_Scrollbar::value
int value(int p)
Sets the value (position) of the slider in the scrollbar.
Definition Fl_Scrollbar.H:71
Fl_Scrollbar::linesize
int linesize() const
Get the size of step, in lines, that the arror keys move.
Definition Fl_Scrollbar.H:94
Fl_Scrollbar::draw
void draw() FL_OVERRIDE
Draws the widget.
Definition Fl_Scrollbar.cxx:198
Fl_Scrollbar::linesize
void linesize(int i)
This number controls how big the steps are that the arrow keys do.
Definition Fl_Scrollbar.H:101
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::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_Valuator::value
double value() const
Gets the floating point(double) value.
Definition Fl_Valuator.H:125
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