NTK 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
65class FL_EXPORT Fl_Value_Input : public Fl_Valuator {
66public:
67 /* This is the encapsulated Fl_input attribute to which
68 this class delegates the value font, color and shortcut */
69 Fl_Input input;
70private:
71 char soft_;
72 static void input_cb(Fl_Widget*,void*);
73 virtual void value_damage(); // cause damage() due to value() changing
74public:
75 int handle(int);
76protected:
77 void draw();
78public:
79 void resize(int,int,int,int);
80 Fl_Value_Input(int x,int y,int w,int h,const char *l=0);
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();}
132
133};
134
135#endif
136
137//
138// End of "$Id: Fl_Value_Input.H 8337 2011-01-30 09:04:59Z manolo $".
139//
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:707
unsigned int Fl_Color
an FLTK color value
Definition: Enumerations.H:764
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:736
Fl_Font textfont() const
Gets the font of the text in the input field.
Definition: Fl_Input_.H:387
Fl_Color textcolor() const
Gets the color of the text in the input field.
Definition: Fl_Input_.H:406
int shortcut() const
Return the shortcut key associated with this widget.
Definition: Fl_Input_.H:375
Fl_Fontsize textsize() const
Gets the size of the text in the input field.
Definition: Fl_Input_.H:396
Fl_Color cursor_color() const
Gets the color of the cursor.
Definition: Fl_Input_.H:416
This is the FLTK text input widget.
Definition: Fl_Input.H:230
The Fl_Valuator class controls a single floating-point value and provides a consistent interface to s...
Definition: Fl_Valuator.H:55
virtual void value_damage()
Asks for partial redraw.
Definition: Fl_Valuator.cxx:69
The Fl_Value_Input widget displays a numeric value.
Definition: Fl_Value_Input.H:65
void textfont(Fl_Font s)
Sets the typeface of the text in the value box.
Definition: Fl_Value_Input.H:119
void shortcut(int s)
Sets the shortcut key to s.
Definition: Fl_Value_Input.H:114
Fl_Color cursor_color() const
Gets the color of the text cursor.
Definition: Fl_Value_Input.H:129
void soft(char s)
See void Fl_Value_Input::soft(char s)
Definition: Fl_Value_Input.H:84
int shortcut() const
Returns the current shortcut key for the Input.
Definition: Fl_Value_Input.H:96
Fl_Font textfont() const
Gets the typeface of the text in the value box.
Definition: Fl_Value_Input.H:117
Fl_Color textcolor() const
Gets the color of the text in the value box.
Definition: Fl_Value_Input.H:125
void cursor_color(Fl_Color n)
Sets the color of the text cursor.
Definition: Fl_Value_Input.H:131
void textsize(Fl_Fontsize s)
Sets the size of the text in the value box.
Definition: Fl_Value_Input.H:123
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
Fl_Fontsize textsize() const
Gets the size of the text in the value box.
Definition: Fl_Value_Input.H:121
void textcolor(Fl_Color n)
Sets the color of the text in the value box.
Definition: Fl_Value_Input.H:127
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:111
virtual void draw()=0
Draws the widget.
virtual int handle(int event)
Handles the specified event.
Definition: Fl_Widget.cxx:106
virtual void resize(int x, int y, int w, int h)
Changes the size or position of the widget.
Definition: Fl_Widget.cxx:140