[773] | 1 | // |
---|
| 2 | // "$Id: NumericInput.h 2973 2003-04-20 03:17:51Z easysw $" |
---|
| 3 | // |
---|
| 4 | // One-line text input field, which handles up/down arrows to |
---|
| 5 | // change the digit to the right of the cursor. This still allows |
---|
| 6 | // arbitrary text such as a math expression to be typed, if you |
---|
| 7 | // want to restrict the user to a number use FloatInput or IntInput. |
---|
| 8 | // |
---|
| 9 | // Copyright 1998-2003 by Bill Spitzak and others. |
---|
| 10 | // |
---|
| 11 | // This library is free software; you can redistribute it and/or |
---|
| 12 | // modify it under the terms of the GNU Library General Public |
---|
| 13 | // License as published by the Free Software Foundation; either |
---|
| 14 | // version 2 of the License, or (at your option) any later version. |
---|
| 15 | // |
---|
| 16 | // This library is distributed in the hope that it will be useful, |
---|
| 17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 19 | // Library General Public License for more details. |
---|
| 20 | // |
---|
| 21 | // You should have received a copy of the GNU Library General Public |
---|
| 22 | // License along with this library; if not, write to the Free Software |
---|
| 23 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
---|
| 24 | // USA. |
---|
| 25 | // |
---|
| 26 | // Please report all bugs and problems to "fltk-bugs@fltk.org". |
---|
| 27 | // |
---|
| 28 | |
---|
| 29 | #ifndef fltk_NumericInput_h |
---|
| 30 | #define fltk_NumericInput_h |
---|
| 31 | |
---|
| 32 | #include "Input.h" |
---|
| 33 | |
---|
| 34 | namespace fltk { |
---|
| 35 | |
---|
| 36 | class FL_API NumericInput : public Input { |
---|
| 37 | protected: |
---|
| 38 | int handle_arrow(int); |
---|
| 39 | public: |
---|
| 40 | NumericInput(int x,int y, int w,int h,const char* l = 0) : |
---|
| 41 | Input(x,y,w,h,l) {when(WHEN_ENTER_KEY|WHEN_RELEASE);} |
---|
| 42 | void value(double); |
---|
| 43 | void value(int); |
---|
| 44 | void value(const char* s) {Input::value(s);} |
---|
| 45 | const char* value() const {return Input::value();} |
---|
| 46 | int handle(int); |
---|
| 47 | }; |
---|
| 48 | |
---|
| 49 | } |
---|
| 50 | #endif |
---|
| 51 | |
---|
| 52 | // |
---|
| 53 | // End of "$Id: NumericInput.h 2973 2003-04-20 03:17:51Z easysw $" |
---|
| 54 | // |
---|