diff options
Diffstat (limited to 'src/Fl_Counter.cxx')
| -rw-r--r-- | src/Fl_Counter.cxx | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/Fl_Counter.cxx b/src/Fl_Counter.cxx index 06f26ff30..93f8c0e3f 100644 --- a/src/Fl_Counter.cxx +++ b/src/Fl_Counter.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Counter.cxx,v 1.8.2.3 2001/01/22 15:13:39 easysw Exp $" +// "$Id: Fl_Counter.cxx,v 1.8.2.3.2.1 2001/08/05 14:00:15 easysw Exp $" // // Counter widget for the Fast Light Tool Kit (FLTK). // @@ -59,6 +59,7 @@ void Fl_Counter::draw() { fl_color(active_r() ? textcolor() : inactive(textcolor())); char str[128]; format(str); fl_draw(str, xx[0], y(), ww[0], h(), FL_ALIGN_CENTER); + if (Fl::focus() == this) draw_focus(boxtype[0], xx[0], y(), ww[0], h()); if (!(damage()&FL_DAMAGE_ALL)) return; // only need to redraw text if (active_r()) @@ -130,6 +131,7 @@ int Fl_Counter::handle(int event) { handle_release(); return 1; case FL_PUSH: + take_focus(); handle_push(); case FL_DRAG: i = calc_mouseobj(); @@ -141,6 +143,22 @@ int Fl_Counter::handle(int event) { redraw(); } return 1; + case FL_KEYBOARD : + switch (Fl::event_key()) { + case FL_Left: + handle_drag(clamp(increment(value(),-1))); + return 1; + case FL_Right: + handle_drag(clamp(increment(value(),1))); + return 1; + default: + return 0; + } + break; + case FL_FOCUS : + case FL_UNFOCUS : + damage(FL_DAMAGE_ALL); + return 1; default: return 0; } @@ -165,5 +183,5 @@ Fl_Counter::Fl_Counter(int x, int y, int w, int h, const char* l) } // -// End of "$Id: Fl_Counter.cxx,v 1.8.2.3 2001/01/22 15:13:39 easysw Exp $". +// End of "$Id: Fl_Counter.cxx,v 1.8.2.3.2.1 2001/08/05 14:00:15 easysw Exp $". // |
