FLTK 1.3.0
Fl_Value_Input.H
1 //
2 // "$Id: Fl_Value_Input.H 8337 2011-01-30 09:04:59Z manolo $"
3 //
4 // Value input 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_Value_Input widget . */
30 
31 #ifndef Fl_Value_Input_H
32 #define Fl_Value_Input_H
33 
34 #include "Fl_Valuator.H"
35 #include "Fl_Input.H"
36 
65 class FL_EXPORT Fl_Value_Input : public Fl_Valuator {
66 public:
67  /* This is the encapsulated Fl_input attribute to which
68  this class delegates the value font, color and shortcut */
69  Fl_Input input;
70 private:
71  char soft_;
72  static void input_cb(Fl_Widget*,void*);
73  virtual void value_damage(); // cause damage() due to value() changing
74 public:
75  int handle(int);
76 protected:
77  void draw();
78 public:
79  void resize(int,int,int,int);
80  Fl_Value_Input(int x,int y,int w,int h,const char *l=0);
81  ~Fl_Value_Input();
82 
84  void soft(char s) {soft_ = s;}
91  char soft() const {return soft_;}
96  int shortcut() const {return input.shortcut();}
114  void shortcut(int s) {input.shortcut(s);}
115 
117  Fl_Font textfont() const {return input.textfont();}
119  void textfont(Fl_Font s) {input.textfont(s);}
121  Fl_Fontsize textsize() const {return input.textsize();}
123  void textsize(Fl_Fontsize s) {input.textsize(s);}
125  Fl_Color textcolor() const {return input.textcolor();}
127  void textcolor(Fl_Color n) {input.textcolor(n);}
129  Fl_Color cursor_color() const {return input.cursor_color();}
131  void cursor_color(Fl_Color n) {input.cursor_color(n);}
132 
133 };
134 
135 #endif
136 
137 //
138 // End of "$Id: Fl_Value_Input.H 8337 2011-01-30 09:04:59Z manolo $".
139 //