FLTK 1.4.4

Loading...
Searching...
No Matches
Fl_Value_Input.H
1//
2// Value input header file for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 1998-2022 by Bill Spitzak and others.
5//
6// This library is free software. Distribution and use rights are outlined in
7// the file "COPYING" which should have been included with this file. If this
8// file is missing or damaged, see the license at:
9//
10// https://www.fltk.org/COPYING.php
11//
12// Please see the following page on how to report bugs and issues:
13//
14// https://www.fltk.org/bugs.php
15//
16
17/* \file
18 Fl_Value_Input widget . */
19
20#ifndef Fl_Value_Input_H
21#define Fl_Value_Input_H
22
23#include "Fl_Valuator.H"
24#include "Fl_Input.H"
25
56 class FL_EXPORT Fl_Value_Input : public Fl_Valuator {
57 public:
58 /* This is the encapsulated Fl_input attribute to which
59 this class delegates the value font, color and shortcut */
60 Fl_Input input;
61 private:
62 char soft_;
63 static void input_cb(Fl_Widget*,void*);
64 void value_damage() FL_OVERRIDE; // cause damage() due to value() changing
65 public:
66 int handle(int) FL_OVERRIDE;
67 protected:
68 void draw() FL_OVERRIDE;
69 public:
70 void resize(int,int,int,int) FL_OVERRIDE;
71 Fl_Value_Input(int x,int y,int w,int h,const char *l=0);
72 ~Fl_Value_Input();
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();}
122 void cursor_color(Fl_Color n) {input.cursor_color(n);}
123
124};
125
126#endif
Fl_Font
int Fl_Font
A font number is an index into the internal font table.
Definition Enumerations.H:1063
Fl_Color
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition Enumerations.H:1120
Fl_Fontsize
int Fl_Fontsize
Size of a font in pixels.
Definition Enumerations.H:1092
Fl_Input
This is the FLTK text input widget.
Definition Fl_Input.H:220
Fl_Valuator::value_damage
virtual void value_damage()
Asks for partial redraw.
Definition Fl_Valuator.cxx:68
Fl_Valuator::Fl_Valuator
Fl_Valuator(int X, int Y, int W, int H, const char *L)
Creates a new Fl_Valuator widget using the given position, size, and label string.
Definition Fl_Valuator.cxx:26
Fl_Value_Input::textfont
void textfont(Fl_Font s)
Sets the typeface of the text in the value box.
Definition Fl_Value_Input.H:110
Fl_Value_Input::shortcut
void shortcut(int s)
Sets the shortcut key to s.
Definition Fl_Value_Input.H:105
Fl_Value_Input::cursor_color
Fl_Color cursor_color() const
Gets the color of the text cursor.
Definition Fl_Value_Input.H:120
Fl_Value_Input::soft
void soft(char s)
See void Fl_Value_Input::soft(char s).
Definition Fl_Value_Input.H:75
Fl_Value_Input::shortcut
int shortcut() const
Returns the current shortcut key for the Input.
Definition Fl_Value_Input.H:87
Fl_Value_Input::textfont
Fl_Font textfont() const
Gets the typeface of the text in the value box.
Definition Fl_Value_Input.H:108
Fl_Value_Input::Fl_Value_Input
Fl_Value_Input(int x, int y, int w, int h, const char *l=0)
Creates a new Fl_Value_Input widget using the given position, size, and label string.
Definition Fl_Value_Input.cxx:114
Fl_Value_Input::textcolor
Fl_Color textcolor() const
Gets the color of the text in the value box.
Definition Fl_Value_Input.H:116
Fl_Value_Input::cursor_color
void cursor_color(Fl_Color n)
Sets the color of the text cursor.
Definition Fl_Value_Input.H:122
Fl_Value_Input::textsize
void textsize(Fl_Fontsize s)
Sets the size of the text in the value box.
Definition Fl_Value_Input.H:114
Fl_Value_Input::soft
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_Value_Input::textsize
Fl_Fontsize textsize() const
Gets the size of the text in the value box.
Definition Fl_Value_Input.H:112
Fl_Value_Input::textcolor
void textcolor(Fl_Color n)
Sets the color of the text in the value box.
Definition Fl_Value_Input.H:118
Fl_Widget::draw
virtual void draw()=0
Draws the widget.
Fl_Widget::handle
virtual int handle(int event)
Handles the specified event.
Definition Fl_Widget.cxx:102
Fl_Widget::x
void x(int v)
Internal use only.
Definition Fl_Widget.H:150
Fl_Widget::resize
virtual void resize(int x, int y, int w, int h)
Changes the size or position of the widget.
Definition Fl_Widget.cxx:138
Fl_Widget::w
void w(int v)
Internal use only.
Definition Fl_Widget.H:154
Fl_Widget::y
void y(int v)
Internal use only.
Definition Fl_Widget.H:152
Fl_Widget::h
void h(int v)
Internal use only.
Definition Fl_Widget.H:156
FL_OVERRIDE
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46