FLTK 1.4.4: Fl_Value_Slider.H Source File

FLTK 1.4.4

Loading...
Searching...
No Matches
Fl_Value_Slider.H
1//
2// Value Slider 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_Value_Slider widget . */
19
20#ifndef Fl_Value_Slider_H
21#define Fl_Value_Slider_H
22
23#include "Fl_Slider.H"
24
31 class FL_EXPORT Fl_Value_Slider : public Fl_Slider {
32 Fl_Font textfont_;
33 Fl_Fontsize textsize_;
34 Fl_Color textcolor_;
35 short value_width_;
36 short value_height_;
37
38protected:
39 void draw() FL_OVERRIDE;
40
41public:
42 int handle(int) FL_OVERRIDE;
43 Fl_Value_Slider(int x, int y, int w, int h, const char *l = 0);
44
46 Fl_Font textfont() const { return textfont_; }
47
49 void textfont(Fl_Font s) { textfont_ = s; }
50
52 Fl_Fontsize textsize() const { return textsize_; }
53
55 void textsize(Fl_Fontsize s) { textsize_ = s; }
56
58 Fl_Color textcolor() const { return textcolor_; }
59
61 void textcolor(Fl_Color s) { textcolor_ = s; }
62
78 void value_width(int s) {
79 if (s > w() - 10)
80 s = w() - 10;
81 if (s < 10)
82 s = 10;
83 value_width_ = (short)s;
84 }
85
90 int value_width() const { return (value_width_); }
91
107 void value_height(int s) {
108 if (s > h() - 10)
109 s = h() - 10;
110 if (s < 10)
111 s = 10;
112 value_height_ = (short)s;
113 }
114
118 int value_height() const { return (value_height_); }
119};
120
121#endif
Fl_Font
int Fl_Font
A font number is an index into the internal font table.
Definition Enumerations.H:1063
Fl_Color
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition Enumerations.H:1120
Fl_Fontsize
int Fl_Fontsize
Size of a font in pixels.
Definition Enumerations.H:1092
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::draw
void draw() FL_OVERRIDE
Draws the widget.
Definition Fl_Slider.cxx:211
Fl_Value_Slider::textfont
void textfont(Fl_Font s)
Sets the typeface of the text in the value box.
Definition Fl_Value_Slider.H:49
Fl_Value_Slider::value_height
void value_height(int s)
Sets the height of the value box in pixels (vertical mode only).
Definition Fl_Value_Slider.H:107
Fl_Value_Slider::textfont
Fl_Font textfont() const
Gets the typeface of the text in the value box.
Definition Fl_Value_Slider.H:46
Fl_Value_Slider::handle
int handle(int) FL_OVERRIDE
Handles the specified event.
Definition Fl_Value_Slider.cxx:63
Fl_Value_Slider::value_height
int value_height() const
Gets the height of the value box in pixels (vertical mode only).
Definition Fl_Value_Slider.H:118
Fl_Value_Slider::textcolor
void textcolor(Fl_Color s)
Sets the color of the text in the value box.
Definition Fl_Value_Slider.H:61
Fl_Value_Slider::textsize
Fl_Fontsize textsize() const
Gets the size of the text in the value box.
Definition Fl_Value_Slider.H:52
Fl_Value_Slider::Fl_Value_Slider
Fl_Value_Slider(int x, int y, int w, int h, const char *l=0)
Creates a new Fl_Value_Slider widget using the given position, size, and label string.
Definition Fl_Value_Slider.cxx:27
Fl_Value_Slider::value_width
void value_width(int s)
Sets the width of the value box in pixels (horizontal mode only).
Definition Fl_Value_Slider.H:78
Fl_Value_Slider::textsize
void textsize(Fl_Fontsize s)
Sets the size of the text in the value box.
Definition Fl_Value_Slider.H:55
Fl_Value_Slider::textcolor
Fl_Color textcolor() const
Gets the color of the text in the value box.
Definition Fl_Value_Slider.H:58
Fl_Value_Slider::value_width
int value_width() const
Gets the width of the value box in pixels (horizontal mode only).
Definition Fl_Value_Slider.H:90
Fl_Widget::h
int h() const
Gets the widget height.
Definition Fl_Widget.H:376
Fl_Widget::w
int w() const
Gets the widget width.
Definition Fl_Widget.H:371
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