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_Widget.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/Fl_Widget.cxx') diff --git a/src/Fl_Widget.cxx b/src/Fl_Widget.cxx index 7c95f9e8a..cedf0d0e4 100644 --- a/src/Fl_Widget.cxx +++ b/src/Fl_Widget.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Widget.cxx,v 1.5.2.4.2.2 2001/08/03 15:48:20 easysw Exp $" +// "$Id: Fl_Widget.cxx,v 1.5.2.4.2.3 2001/08/04 20:17:10 easysw Exp $" // // Base widget class for the Fast Light Tool Kit (FLTK). // @@ -27,6 +27,7 @@ #include #include #include +#include //////////////////////////////////////////////////////////////// @@ -132,6 +133,17 @@ Fl_Widget::~Fl_Widget() { fl_throw_focus(this); } +// draw a focus box for the widget... +void +Fl_Widget::draw_focus(Fl_Boxtype B, int X, int Y, int W, int H) const { + fl_color(FL_BLACK); + fl_line_style(FL_DASH); + fl_rect(X + Fl::box_dx(B), Y + Fl::box_dy(B), + W - Fl::box_dw(B) - 1, H - Fl::box_dh(B) - 1); + fl_line_style(FL_SOLID); +} + + // redraw this, plus redraw opaque object if there is an outside label static void redraw_label(Fl_Widget* w) { w->redraw(); @@ -206,5 +218,5 @@ int Fl_Widget::contains(const Fl_Widget *o) const { } // -// End of "$Id: Fl_Widget.cxx,v 1.5.2.4.2.2 2001/08/03 15:48:20 easysw Exp $". +// End of "$Id: Fl_Widget.cxx,v 1.5.2.4.2.3 2001/08/04 20:17:10 easysw Exp $". // -- cgit v1.2.3