diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-07-23 15:07:33 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-07-23 15:07:33 +0000 |
| commit | 57cef6a4bde017e205e54271e769de0db596d893 (patch) | |
| tree | 3045170ea9a91dd0db8c52835ea22cfb4d8b88e8 /src | |
| parent | c22732b9e0ef37075840d2b2f6b64a06fb4f4968 (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl.cxx | 5 | ||||
| -rw-r--r-- | src/Fl_Input_.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_Widget.cxx | 7 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index ff06ffc7d..3ede09284 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl.cxx,v 1.24.2.41.2.42 2002/07/11 01:10:15 matthiaswm Exp $" +// "$Id: Fl.cxx,v 1.24.2.41.2.43 2002/07/23 15:07:33 easysw Exp $" // // Main event handling code for the Fast Light Tool Kit (FLTK). // @@ -419,6 +419,7 @@ static int send_handlers(int event) { Fl_Widget* fl_oldfocus; // kludge for Fl_Group... void Fl::focus(Fl_Widget *o) { + if (o && !o->visible_focus()) return; if (grab()) return; // don't do anything while grab is on Fl_Widget *p = focus_; if (o != p) { @@ -948,5 +949,5 @@ void Fl_Window::flush() { } // -// End of "$Id: Fl.cxx,v 1.24.2.41.2.42 2002/07/11 01:10:15 matthiaswm Exp $". +// End of "$Id: Fl.cxx,v 1.24.2.41.2.43 2002/07/23 15:07:33 easysw Exp $". // diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index 9ddd8b551..fd91da44e 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Input_.cxx,v 1.21.2.11.2.13 2002/07/20 05:56:44 easysw Exp $" +// "$Id: Fl_Input_.cxx,v 1.21.2.11.2.14 2002/07/23 15:07:33 easysw Exp $" // // Common input widget routines for the Fast Light Tool Kit (FLTK). // @@ -233,7 +233,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) { p = value(); // visit each line and draw it: int desc = height-fl_descent(); - int xpos = X-xscroll_; if (W > 12) xpos += 3; + int xpos = X - xscroll_ + 1; int ypos = -yscroll_; for (; ypos < H;) { @@ -872,5 +872,5 @@ Fl_Input_::~Fl_Input_() { } // -// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.13 2002/07/20 05:56:44 easysw Exp $". +// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.14 2002/07/23 15:07:33 easysw Exp $". // 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 $". // |
