FLTK 1.3.9
Loading...
Searching...
No Matches
Fl_Value_Input.H
1//
2// "$Id$"
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. 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_Value_Input widget . */
21
22#ifndef Fl_Value_Input_H
23#define Fl_Value_Input_H
24
25#include "Fl_Valuator.H"
26#include "Fl_Input.H"
27
56class FL_EXPORT Fl_Value_Input : public Fl_Valuator {
57public:
58 /* This is the encapsulated Fl_input attribute to which
59 this class delegates the value font, color and shortcut */
60 Fl_Input input;
61private:
62 char soft_;
63 static void input_cb(Fl_Widget*,void*);
64 virtual void value_damage(); // cause damage() due to value() changing
65public:
66 int handle(int);
67protected:
68 void draw();
69public:
70 void resize(int,int,int,int);
71 Fl_Value_Input(int x,int y,int w,int h,const char *l=0);
73
75 void soft(char s) {soft_ = s;}
82 char soft() const {return soft_;}
87 int shortcut() const {return input.shortcut();}
105 void shortcut(int s) {input.shortcut(s);}
106
108 Fl_Font textfont() const {return input.textfont();}
110 void textfont(Fl_Font s) {input.textfont(s);}
112 Fl_Fontsize textsize() const {return input.textsize();}
114 void textsize(Fl_Fontsize s) {input.textsize(s);}
116 Fl_Color textcolor() const {return input.textcolor();}
118 void textcolor(Fl_Color n) {input.textcolor(n);}
120 Fl_Color cursor_color() const {return input.cursor_color();}
123
124};
125
126#endif
127
128//
129// End of "$Id$".
130//
int Fl_Font
A font number is an index into the internal font table.
Definition Enumerations.H:875
unsigned int Fl_Color
An FLTK color value; see also Colors
Definition Enumerations.H:932
int Fl_Fontsize
Size of a font in pixels.
Definition Enumerations.H:904
Fl_Font textfont() const
Gets the font of the text in the input field.
Definition Fl_Input_.H:386
Fl_Color textcolor() const
Gets the color of the text in the input field.
Definition Fl_Input_.H:405
int shortcut() const
Return the shortcut key associated with this widget.
Definition Fl_Input_.H:374
Fl_Fontsize textsize() const
Gets the size of the text in the input field.
Definition Fl_Input_.H:395
Fl_Color cursor_color() const
Gets the color of the cursor.
Definition Fl_Input_.H:415
This is the FLTK text input widget.
Definition Fl_Input.H:222
The Fl_Valuator class controls a single floating-point value and provides a consistent interface to s...
Definition Fl_Valuator.H:49
virtual void value_damage()
Asks for partial redraw.
Definition Fl_Valuator.cxx:70
The Fl_Value_Input widget displays a numeric value.
Definition Fl_Value_Input.H:56
void textfont(Fl_Font s)
Sets the typeface of the text in the value box.
Definition Fl_Value_Input.H:110
void shortcut(int s)
Sets the shortcut key to s.
Definition Fl_Value_Input.H:105
Fl_Color cursor_color() const
Gets the color of the text cursor.
Definition Fl_Value_Input.H:120
void soft(char s)
See void Fl_Value_Input::soft(char s)
Definition Fl_Value_Input.H:75
int shortcut() const
Returns the current shortcut key for the Input.
Definition Fl_Value_Input.H:87
Fl_Font textfont() const
Gets the typeface of the text in the value box.
Definition Fl_Value_Input.H:108
Fl_Color textcolor() const
Gets the color of the text in the value box.
Definition Fl_Value_Input.H:116
void cursor_color(Fl_Color n)
Sets the color of the text cursor.
Definition Fl_Value_Input.H:122
void textsize(Fl_Fontsize s)
Sets the size of the text in the value box.
Definition Fl_Value_Input.H:114
char soft() const
If "soft" is turned on, the user is allowed to drag the value outside the range.
Definition Fl_Value_Input.H:82
Fl_Fontsize textsize() const
Gets the size of the text in the value box.
Definition Fl_Value_Input.H:112
void textcolor(Fl_Color n)
Sets the color of the text in the value box.
Definition Fl_Value_Input.H:118
Fl_Widget is the base class for all widgets in FLTK.
Definition Fl_Widget.H:101
virtual void draw()=0
Draws the widget.
virtual int handle(int event)
Handles the specified event.
Definition Fl_Widget.cxx:112
virtual void resize(int x, int y, int w, int h)
Changes the size or position of the widget.
Definition Fl_Widget.cxx:150