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 //
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:109
The Fl_Valuator class controls a single floating-point value and provides a consistent interface to s...
Definition: Fl_Valuator.H:55
The Fl_Value_Input widget displays a numeric value.
Definition: Fl_Value_Input.H:65
virtual int handle(int event)
Handles the specified event.
Definition: Fl_Widget.cxx:106
void textsize(Fl_Fontsize s)
Sets the size of the text in the value box.
Definition: Fl_Value_Input.H:123
void soft(char s)
See void Fl_Value_Input::soft(char s)
Definition: Fl_Value_Input.H:84
char soft() const
If "soft" is turned on, the user is allowed to drag the value outside the range.
Definition: Fl_Value_Input.H:91
virtual void draw()=0
Draws the widget.
This is the FLTK text input widget.
Definition: Fl_Input.H:230
virtual void resize(int x, int y, int w, int h)
Changes the size or position of the widget.
Definition: Fl_Widget.cxx:140
void textfont(Fl_Font s)
Sets the typeface of the text in the value box.
Definition: Fl_Value_Input.H:119
Fl_Color cursor_color() const
Gets the color of the text cursor.
Definition: Fl_Value_Input.H:129
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:741
Fl_Fontsize textsize() const
Gets the size of the text in the value box.
Definition: Fl_Value_Input.H:121
int shortcut() const
Returns the current shortcut key for the Input.
Definition: Fl_Value_Input.H:96
unsigned int Fl_Color
an FLTK color value
Definition: Enumerations.H:769
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:712
void cursor_color(Fl_Color n)
Sets the color of the text cursor.
Definition: Fl_Value_Input.H:131
virtual void value_damage()
Asks for partial redraw.
Definition: Fl_Valuator.cxx:69
void textcolor(Fl_Color n)
Sets the color of the text in the value box.
Definition: Fl_Value_Input.H:127
Fl_Color textcolor() const
Gets the color of the text in the value box.
Definition: Fl_Value_Input.H:125
void shortcut(int s)
Sets the shortcut key to s.
Definition: Fl_Value_Input.H:114
Fl_Font textfont() const
Gets the typeface of the text in the value box.
Definition: Fl_Value_Input.H:117