FLTK 1.3.8: Fl_Counter.H Source File

FLTK 1.3.8

Fl_Counter.H
1//
2// "$Id$"
3//
4// Counter header file for the Fast Light Tool Kit (FLTK).
5//
6// Copyright 1998-2010 by Bill Spitzak and others.
7//
8// This library is free software. Distribution and use rights are outlined in
9// the file "COPYING" which should have been included with this file. If this
10// file is missing or damaged, see the license at:
11//
12// http://www.fltk.org/COPYING.php
13//
14// Please report all bugs and problems on the following page:
15//
16// http://www.fltk.org/str.php
17//
18
19/* \file
20 Fl_Counter widget . */
21
22// A numerical value with up/down step buttons. From Forms.
23
24#ifndef Fl_Counter_H
25#define Fl_Counter_H
26
27#ifndef Fl_Valuator_H
28#include "Fl_Valuator.H"
29#endif
30
31// values for type():
32#define FL_NORMAL_COUNTER 0
33#define FL_SIMPLE_COUNTER 1
48 class FL_EXPORT Fl_Counter : public Fl_Valuator {
49
50 Fl_Font textfont_;
51 Fl_Fontsize textsize_;
52 Fl_Color textcolor_;
53 double lstep_;
54 uchar mouseobj;
55 static void repeat_callback(void *);
56 int calc_mouseobj();
57 void increment_cb();
58
59protected:
60
61 void draw();
62
63public:
64
65 int handle(int);
66
67 Fl_Counter(int X, int Y, int W, int H, const char* L = 0);
68 ~Fl_Counter();
69
75 void lstep(double a) {lstep_ = a;}
76
81 void step(double a,double b) {Fl_Valuator::step(a); lstep_ = b;}
82
87 void step(double a) {Fl_Valuator::step(a);}
88
92 double step() const {return Fl_Valuator::step();}
93
95 Fl_Font textfont() const {return textfont_;}
97 void textfont(Fl_Font s) {textfont_ = s;}
98
100 Fl_Fontsize textsize() const {return textsize_;}
102 void textsize(Fl_Fontsize s) {textsize_ = s;}
103
105 Fl_Color textcolor() const {return textcolor_;}
107 void textcolor(Fl_Color s) {textcolor_ = s;}
108
109};
110
111#endif
112
113//
114// End of "$Id$".
115//
Fl_Font
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:875
Fl_Color
unsigned int Fl_Color
An FLTK color value; see also Colors
Definition: Enumerations.H:932
Fl_Fontsize
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:904
Fl_Counter
Controls a single floating point value with button (or keyboard) arrows.
Definition: Fl_Counter.H:48
Fl_Counter::textfont
void textfont(Fl_Font s)
Sets the text font to s.
Definition: Fl_Counter.H:97
Fl_Counter::lstep
void lstep(double a)
Sets the increment for the large step buttons.
Definition: Fl_Counter.H:75
Fl_Counter::step
void step(double a, double b)
Sets the increments for the normal and large step buttons.
Definition: Fl_Counter.H:81
Fl_Counter::textsize
void textsize(Fl_Fontsize s)
Sets the font size to s.
Definition: Fl_Counter.H:102
Fl_Counter::textsize
Fl_Fontsize textsize() const
Gets the font size.
Definition: Fl_Counter.H:100
Fl_Counter::step
double step() const
Returns the increment for normal step buttons.
Definition: Fl_Counter.H:92
Fl_Counter::textfont
Fl_Font textfont() const
Gets the text font.
Definition: Fl_Counter.H:95
Fl_Counter::textcolor
void textcolor(Fl_Color s)
Sets the font color to s.
Definition: Fl_Counter.H:107
Fl_Counter::step
void step(double a)
Sets the increment for the normal step buttons.
Definition: Fl_Counter.H:87
Fl_Counter::textcolor
Fl_Color textcolor() const
Gets the font color.
Definition: Fl_Counter.H:105
Fl_Valuator
The Fl_Valuator class controls a single floating-point value and provides a consistent interface to s...
Definition: Fl_Valuator.H:49
Fl_Valuator::step
double step() const
Gets or sets the step value.
Definition: Fl_Valuator.H:121
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:112
uchar
unsigned char uchar
unsigned char
Definition: fl_types.h:30
- Copyright © 1998-2021 by Bill Spitzak and others.