From 03f49329ff670c072aaddabf8f1beaf4f69e5bd9 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sat, 4 Aug 2001 20:17:10 +0000 Subject: New draw_focus() methods. Keyboard nav for choice, menu button. Updated Fl_Choice to draw like a combo box. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1553 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Button.cxx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/Fl_Button.cxx') diff --git a/src/Fl_Button.cxx b/src/Fl_Button.cxx index 1ad74240b..c1940b3b5 100644 --- a/src/Fl_Button.cxx +++ b/src/Fl_Button.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Button.cxx,v 1.4.2.6.2.3 2001/08/04 16:43:31 easysw Exp $" +// "$Id: Fl_Button.cxx,v 1.4.2.6.2.4 2001/08/04 20:17:10 easysw Exp $" // // Button widget for the Fast Light Tool Kit (FLTK). // @@ -26,7 +26,6 @@ #include #include #include -#include // There are a lot of subclasses, named Fl_*_Button. Some of // them are implemented by setting the type() value and testing it @@ -56,12 +55,7 @@ void Fl_Button::draw() { //if (col == FL_GRAY && Fl::belowmouse()==this) col = FL_LIGHT1; draw_box(value() ? (down_box()?down_box():down(box())) : box(), col); draw_label(); - if (Fl::focus() == this) { - fl_line_style(FL_DASH); - fl_rect(x() + Fl::box_dx(box()), y() + Fl::box_dy(box()), - w() - Fl::box_dw(box()) - 1, h() - Fl::box_dh(box()) - 1); - fl_line_style(FL_SOLID); - } + if (Fl::focus() == this) draw_focus(); } int Fl_Button::handle(int event) { int newval; @@ -72,6 +66,7 @@ int Fl_Button::handle(int event) { return 1; case FL_PUSH: case FL_DRAG: + take_focus(); if (Fl::event_inside(this)) { if (type() == FL_RADIO_BUTTON) newval = 1; else newval = !oldval; @@ -141,5 +136,5 @@ Fl_Button::Fl_Button(int x,int y,int w,int h, const char *l) } // -// End of "$Id: Fl_Button.cxx,v 1.4.2.6.2.3 2001/08/04 16:43:31 easysw Exp $". +// End of "$Id: Fl_Button.cxx,v 1.4.2.6.2.4 2001/08/04 20:17:10 easysw Exp $". // -- cgit v1.2.3