FLTK 1.3.0
Fl_Value_Input.H
00001 //
00002 // "$Id$"
00003 //
00004 // Value input header file for the Fast Light Tool Kit (FLTK).
00005 //
00006 // Copyright 1998-2010 by Bill Spitzak and others.
00007 //
00008 // This library is free software; you can redistribute it and/or
00009 // modify it under the terms of the GNU Library General Public
00010 // License as published by the Free Software Foundation; either
00011 // version 2 of the License, or (at your option) any later version.
00012 //
00013 // This library is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 // Library General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU Library General Public
00019 // License along with this library; if not, write to the Free Software
00020 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00021 // USA.
00022 //
00023 // Please report all bugs and problems on the following page:
00024 //
00025 //     http://www.fltk.org/str.php
00026 //
00027 
00028 /* \file
00029    Fl_Value_Input widget . */
00030 
00031 #ifndef Fl_Value_Input_H
00032 #define Fl_Value_Input_H
00033 
00034 #include "Fl_Valuator.H"
00035 #include "Fl_Input.H"
00036 
00065 class FL_EXPORT Fl_Value_Input : public Fl_Valuator {
00066 public:
00067   /* This is the encapsulated Fl_input attribute to which 
00068   this class delegates the value font, color and shortcut */
00069   Fl_Input input;
00070 private:
00071   char soft_;
00072   static void input_cb(Fl_Widget*,void*);
00073   virtual void value_damage(); // cause damage() due to value() changing
00074 public:
00075   int handle(int);
00076 protected:
00077   void draw();
00078 public:
00079   void resize(int,int,int,int);
00080   Fl_Value_Input(int x,int y,int w,int h,const char *l=0);
00081   ~Fl_Value_Input();
00082 
00084   void soft(char s) {soft_ = s;}
00091   char soft() const {return soft_;}
00096   int shortcut() const {return input.shortcut();}
00114   void shortcut(int s) {input.shortcut(s);}
00115 
00117   Fl_Font textfont() const {return input.textfont();}
00119   void textfont(Fl_Font s) {input.textfont(s);}
00121   Fl_Fontsize textsize() const {return input.textsize();}
00123   void textsize(Fl_Fontsize s) {input.textsize(s);}
00125   Fl_Color textcolor() const {return input.textcolor();}
00127   void textcolor(Fl_Color n) {input.textcolor(n);}
00129   Fl_Color cursor_color() const {return input.cursor_color();}
00131   void cursor_color(Fl_Color n) {input.cursor_color(n);}
00132 
00133 };
00134 
00135 #endif
00136 
00137 //
00138 // End of "$Id$".
00139 //