diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 1999-01-13 15:47:27 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 1999-01-13 15:47:27 +0000 |
| commit | 8327071ab0068f0f65ea176bc03f51dedb061254 (patch) | |
| tree | 653470e179b440f8c9741d6c5074539b755a8c0b | |
| parent | ab5771b62fbff2510ff495ba6dd2fcd8d1720593 (diff) | |
Fixes from Bill:
- Fixed redraw bug in fl_color_chooser().
- Fl_Value_Input will now accept hexadecimal numbers.
git-svn-id: file:///fltk/svn/fltk/trunk@210 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/Fl_Color_Chooser.cxx | 8 | ||||
| -rw-r--r-- | src/Fl_Input.cxx | 12 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/Fl_Color_Chooser.cxx b/src/Fl_Color_Chooser.cxx index 58f6b882d..4252ac9c0 100644 --- a/src/Fl_Color_Chooser.cxx +++ b/src/Fl_Color_Chooser.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Color_Chooser.cxx,v 1.5 1999/01/07 19:17:18 mike Exp $" +// "$Id: Fl_Color_Chooser.cxx,v 1.6 1999/01/13 15:47:27 mike Exp $" // // Color chooser for the Fast Light Tool Kit (FLTK). // @@ -310,6 +310,10 @@ void Fl_Color_Chooser::rgb_cb(Fl_Widget* o, void*) { void Fl_Color_Chooser::mode_cb(Fl_Widget* o, void*) { Fl_Color_Chooser* c = (Fl_Color_Chooser*)(o->parent()); + // force them to redraw even if value is the same: + c->rvalue.value(-1); + c->gvalue.value(-1); + c->bvalue.value(-1); c->set_valuators(); } @@ -426,5 +430,5 @@ int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b) { } // -// End of "$Id: Fl_Color_Chooser.cxx,v 1.5 1999/01/07 19:17:18 mike Exp $". +// End of "$Id: Fl_Color_Chooser.cxx,v 1.6 1999/01/13 15:47:27 mike Exp $". // diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index f2bdd0d08..15980f348 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Input.cxx,v 1.8 1999/01/07 19:17:21 mike Exp $" +// "$Id: Fl_Input.cxx,v 1.9 1999/01/13 15:47:27 mike Exp $" // // Input widget for the Fast Light Tool Kit (FLTK). // @@ -259,7 +259,13 @@ int Fl_Input::handle_key() { if (type() == FL_FLOAT_INPUT) { if (!strchr("0123456789.eE+-", key)) return 0; } else if (type() == FL_INT_INPUT) { - if (!strchr("0123456789+-", key)) return 0; + if (!position() && (key == '+' || key == '-')); + else if (key >= '0' && key <= '9'); + // we allow 0xabc style hex numbers to be typed: + else if (position()==1 && index(0)=='0' && (key == 'x' || key == 'X')); + else if (position()>1 && index(0)=='0' && (index(1)=='x'||index(1)=='X') + && (key>='A'&& key<='F' || key>='a'&& key<='f')); + else return 0; } return replace(position(), mark(), Fl::event_text(), Fl::event_length()); @@ -323,5 +329,5 @@ Fl_Input::Fl_Input(int x, int y, int w, int h, const char *l) } // -// End of "$Id: Fl_Input.cxx,v 1.8 1999/01/07 19:17:21 mike Exp $". +// End of "$Id: Fl_Input.cxx,v 1.9 1999/01/13 15:47:27 mike Exp $". // |
