From 57cef6a4bde017e205e54271e769de0db596d893 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 23 Jul 2002 15:07:33 +0000 Subject: Remove extra 3 pixel offset when the size is below a certain amount; instead, use a constant +1 offset. Add another bit to flags_, VISIBLE_FOCUS, which provides per-widget keyboard focus control. The default is for all widgets to participate in keyboard focus navigation. Use the set_visible_focus(), clear_visible_focus(), and visible_focus() methods on Fl_Widget to control this. Clean up the Fl_Widget documentation and add missing stuff. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2543 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Widget.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Fl_Widget.cxx') diff --git a/src/Fl_Widget.cxx b/src/Fl_Widget.cxx index d904e87d2..7d396eac7 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.18 2002/06/02 17:52:36 easysw Exp $" +// "$Id: Fl_Widget.cxx,v 1.5.2.4.2.19 2002/07/23 15:07:33 easysw Exp $" // // Base widget class for the Fast Light Tool Kit (FLTK). // @@ -89,7 +89,7 @@ Fl_Widget::Fl_Widget(int X, int Y, int W, int H, const char* L) { callback_ = default_callback; user_data_ = 0; type_ = 0; - flags_ = 0; + flags_ = VISIBLE_FOCUS; damage_ = 0; box_ = FL_NO_BOX; color_ = FL_GRAY; @@ -115,6 +115,7 @@ int Fl_Widget::damage_resize(int X, int Y, int W, int H) { int Fl_Widget::take_focus() { if (!takesevents()) return 0; + if (!visible_focus()) return 0; if (!handle(FL_FOCUS)) return 0; // see if it wants it if (contains(Fl::focus())) return 1; // it called Fl::focus for us Fl::focus(this); @@ -241,5 +242,5 @@ int Fl_Widget::contains(const Fl_Widget *o) const { } // -// End of "$Id: Fl_Widget.cxx,v 1.5.2.4.2.18 2002/06/02 17:52:36 easysw Exp $". +// End of "$Id: Fl_Widget.cxx,v 1.5.2.4.2.19 2002/07/23 15:07:33 easysw Exp $". // -- cgit v1.2.3