FLTK 1.3.0
Fl_Counter.H
1 //
2 // "$Id: Fl_Counter.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
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; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Library General Public License for more details.
17 //
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 // USA.
22 //
23 // Please report all bugs and problems on the following page:
24 //
25 // http://www.fltk.org/str.php
26 //
27 
28 /* \file
29  Fl_Counter widget . */
30 
31 // A numerical value with up/down step buttons. From Forms.
32 
33 #ifndef Fl_Counter_H
34 #define Fl_Counter_H
35 
36 #ifndef Fl_Valuator_H
37 #include "Fl_Valuator.H"
38 #endif
39 
40 // values for type():
41 #define FL_NORMAL_COUNTER 0
42 #define FL_SIMPLE_COUNTER 1
57 class FL_EXPORT Fl_Counter : public Fl_Valuator {
58 
59  Fl_Font textfont_;
60  Fl_Fontsize textsize_;
61  Fl_Color textcolor_;
62  double lstep_;
63  uchar mouseobj;
64  static void repeat_callback(void *);
65  int calc_mouseobj();
66  void increment_cb();
67 
68 protected:
69 
70  void draw();
71 
72 public:
73 
74  int handle(int);
75 
76  Fl_Counter(int X, int Y, int W, int H, const char* L = 0);
77  ~Fl_Counter();
78 
84  void lstep(double a) {lstep_ = a;}
85 
90  void step(double a,double b) {Fl_Valuator::step(a); lstep_ = b;}
91 
96  void step(double a) {Fl_Valuator::step(a);}
97 
101  double step() const {return Fl_Valuator::step();}
102 
104  Fl_Font textfont() const {return textfont_;}
106  void textfont(Fl_Font s) {textfont_ = s;}
107 
109  Fl_Fontsize textsize() const {return textsize_;}
111  void textsize(Fl_Fontsize s) {textsize_ = s;}
112 
114  Fl_Color textcolor() const {return textcolor_;}
116  void textcolor(Fl_Color s) {textcolor_ = s;}
117 
118 };
119 
120 #endif
121 
122 //
123 // End of "$Id: Fl_Counter.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
124 //