summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-10-29 20:44:22 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-10-29 20:44:22 +0000
commita5131e195974d6b61a9763e2bca9dc02bf36e474 (patch)
tree951572cbcbed3547cb729223fe951b79cf3c3726
parent0daa36de390e6a67545f920f829be6097beef102 (diff)
Fix focus hogging by the Fl_Tabs widget.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2713 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES2
-rw-r--r--src/Fl_Tabs.cxx11
2 files changed, 9 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 52bd887ee..e03a5c06c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.2
+ - The Fl_Tabs widget should no longer be a focus hog;
+ previously it would take focus from child widgets.
- The file chooser now activates the OK button when
opening a directory in directory selection mode.
- Fixed a bug in the file chooser when entering an
diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx
index 7599c8019..a901aa64e 100644
--- a/src/Fl_Tabs.cxx
+++ b/src/Fl_Tabs.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.14 2002/10/22 17:39:12 easysw Exp $"
+// "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.15 2002/10/29 20:44:22 easysw Exp $"
//
// Tab widget for the Fast Light Tool Kit (FLTK).
//
@@ -139,7 +139,10 @@ int Fl_Tabs::handle(int event) {
return 1;
case FL_FOCUS:
case FL_UNFOCUS:
- if (Fl::visible_focus()) {
+ if (!Fl::visible_focus()) return Fl_Group::handle(event);
+ if (Fl::event() == FL_PUSH ||
+ Fl::event() == FL_SHORTCUT ||
+ Fl::event() == FL_KEYBOARD) {
int H = tab_height();
if (H >= 0) {
H += Fl::box_dy(box());
@@ -149,7 +152,7 @@ int Fl_Tabs::handle(int event) {
damage(FL_DAMAGE_SCROLL, x(), y() + h() - H, w(), H);
}
return 1;
- } else return 0;
+ } else return Fl_Group::handle(event);
case FL_KEYBOARD:
switch (Fl::event_key()) {
case FL_Left:
@@ -299,5 +302,5 @@ Fl_Tabs::Fl_Tabs(int X,int Y,int W, int H, const char *l) :
}
//
-// End of "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.14 2002/10/22 17:39:12 easysw Exp $".
+// End of "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.15 2002/10/29 20:44:22 easysw Exp $".
//