summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-08-05 15:34:28 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-08-05 15:34:28 +0000
commitf6ea21e2fb15bf37605f5d7c760048eda51c8491 (patch)
treee1fcc9152ca759a77855f979852706985c1511b6
parent51050b38d82ca53bb71c85d2031f9777e6dd373e (diff)
Keyboard nav for tabs.
Define MAX_PATH for Cygwin. Update configure script to add *BSD DSO generation rules and X include directory for Xdbe.h and OpenGL headers. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1556 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--configure.in11
-rw-r--r--fluid/fluid.cxx8
-rw-r--r--src/Fl_Tabs.cxx42
3 files changed, 52 insertions, 9 deletions
diff --git a/configure.in b/configure.in
index 9ab9704eb..9ee19a326 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,7 @@
dnl -*- sh -*-
dnl the "configure" script is made from this by running GNU "autoconf"
dnl
-dnl "$Id: configure.in,v 1.33.2.31.2.3 2001/08/02 19:43:49 easysw Exp $"
+dnl "$Id: configure.in,v 1.33.2.31.2.4 2001/08/05 15:34:28 easysw Exp $"
dnl
dnl Configuration script for the Fast Light Tool Kit (FLTK).
dnl
@@ -77,10 +77,14 @@ if eval "test x$enable_shared = xyes"; then
GLDSONAME="libfltkgl.sl.1.1"
DSOCOMMAND="ld -b -z +h \$@ $DEBUGFLAG -o"
;;
- IRIX* | OSF1* | FreeBSD* | NetBSD* | OpenBSD*)
+ IRIX* | OSF1*)
DSONAME="libfltk.so.1.1"
GLDSONAME="libfltkgl.so.1.1"
DSOCOMMAND="\$(CXX) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG -o"
+ FreeBSD* | NetBSD* | OpenBSD*)
+ DSONAME="libfltk.so.1.1"
+ GLDSONAME="libfltkgl.so.1.1"
+ DSOCOMMAND="\$(CXX) -Wl,-soname,\$@ \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
;;
AIX*)
DSONAME="libfltk_s.a"
@@ -203,6 +207,7 @@ fi
LIBS="$LIBS$X_LIBS"
CFLAGS="$CFLAGS$X_CFLAGS"
CXXFLAGS="$CXXFLAGS$X_CFLAGS"
+ac_cpp="$ac_cpp -I$x_includes"
dnl Check for OpenGL unless disabled...
GLLIB=
@@ -433,5 +438,5 @@ AC_CONFIG_HEADER(config.h:configh.in)
AC_OUTPUT(makeinclude)
dnl
-dnl End of "$Id: configure.in,v 1.33.2.31.2.3 2001/08/02 19:43:49 easysw Exp $".
+dnl End of "$Id: configure.in,v 1.33.2.31.2.4 2001/08/05 15:34:28 easysw Exp $".
dnl
diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx
index b1f317f6b..b8a69ad5b 100644
--- a/fluid/fluid.cxx
+++ b/fluid/fluid.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fluid.cxx,v 1.15.2.13.2.1 2001/08/02 16:17:04 easysw Exp $"
+// "$Id: fluid.cxx,v 1.15.2.13.2.2 2001/08/05 15:34:28 easysw Exp $"
//
// FLUID main entry for the Fast Light Tool Kit (FLTK).
//
@@ -252,6 +252,10 @@ static int ipasteoffset;
static char* cutfname() {
#ifdef WIN32
+# ifndef MAX_PATH
+# define MAX_PATH 256
+# endif // !MAX_PATH
+
static char name[MAX_PATH+16] = "";
if (!name[0]) {
@@ -474,5 +478,5 @@ int main(int argc,char **argv) {
}
//
-// End of "$Id: fluid.cxx,v 1.15.2.13.2.1 2001/08/02 16:17:04 easysw Exp $".
+// End of "$Id: fluid.cxx,v 1.15.2.13.2.2 2001/08/05 15:34:28 easysw Exp $".
//
diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx
index e405832d1..669bb3fae 100644
--- a/src/Fl_Tabs.cxx
+++ b/src/Fl_Tabs.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Tabs.cxx,v 1.6.2.10 2001/01/22 15:13:40 easysw Exp $"
+// "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.1 2001/08/05 15:34:28 easysw Exp $"
//
// Tab widget for the Fast Light Tool Kit (FLTK).
//
@@ -29,6 +29,7 @@
// Each child widget is a card, and it's label() is printed on the card tab.
// Clicking the tab makes that card visible.
+#include <stdio.h>
#include <FL/Fl.H>
#include <FL/Fl_Tabs.H>
#include <FL/fl_draw.H>
@@ -126,6 +127,7 @@ Fl_Widget *Fl_Tabs::which(int event_x, int event_y) {
int Fl_Tabs::handle(int event) {
Fl_Widget *o;
+ int i;
switch (event) {
@@ -136,13 +138,37 @@ int Fl_Tabs::handle(int event) {
} else {
if (Fl::event_y() < y()+h()+H) goto DEFAULT;
}}
+ take_focus();
case FL_DRAG:
case FL_RELEASE:
o = which(Fl::event_x(), Fl::event_y());
if (event == FL_RELEASE) {push(0); if (o && value(o)) do_callback();}
else push(o);
return 1;
-
+ case FL_FOCUS:
+ case FL_UNFOCUS:
+ redraw();
+ return 1;
+ case FL_KEYBOARD:
+ switch (Fl::event_key()) {
+ case FL_Left:
+ if (child(0)->visible()) return 0;
+ for (i = 1; i < children(); i ++)
+ if (child(i)->visible()) break;
+ value(child(i - 1));
+ return 1;
+ case FL_Right:
+ if (child(children() - 1)->visible()) return 0;
+ for (i = 0; i < children(); i ++)
+ if (child(i)->visible()) break;
+ value(child(i + 1));
+ return 1;
+ case FL_Down:
+ redraw();
+ return Fl_Group::handle(FL_FOCUS);
+ default:
+ break;
+ }
default:
DEFAULT:
return Fl_Group::handle(event);
@@ -261,10 +287,18 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) {
fl_color(!sel && o==push_ ? FL_DARK3 : FL_LIGHT3);
fl_line(x1, y()+h()+H, x1+TABSLOPE, y()+h()-1);
}
- if (W > TABSLOPE+EXTRASPACE/2)
+ if (W > TABSLOPE+EXTRASPACE/2) {
o->draw_label((what==LEFT ? x1 : x2-W)+(TABSLOPE+EXTRASPACE/2),
y()+(H<0?h()+H-2:0), W-(TABSLOPE+EXTRASPACE/2),
(H<0?-H:H)+3, FL_ALIGN_CENTER);
+
+ if (Fl::focus() == this && o->visible())
+ draw_focus(FL_FLAT_BOX,
+ (what==LEFT ? x1 : x2-W)+(TABSLOPE+EXTRASPACE/2),
+ y()+(H<0?h()+H-2:0) + 3,
+ W-(TABSLOPE+EXTRASPACE/2),
+ (H<0?-H:H)-3);
+ }
}
Fl_Tabs::Fl_Tabs(int X,int Y,int W, int H, const char *l) :
@@ -275,5 +309,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 2001/01/22 15:13:40 easysw Exp $".
+// End of "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.1 2001/08/05 15:34:28 easysw Exp $".
//