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
This commit is contained in:
Michael R Sweet 1999-01-13 15:47:27 +00:00
parent ab5771b62f
commit 8327071ab0
2 changed files with 15 additions and 5 deletions

View File

@ -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 $".
//

View File

@ -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 $".
//