summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>1999-11-16 07:39:59 +0000
committerBill Spitzak <spitzak@gmail.com>1999-11-16 07:39:59 +0000
commit9ce13e4fff5d16d2b838141184739caa08608210 (patch)
treea9bfc272f0a5a5185bd644b7aeb86734e50a8bf2
parentd1f909be8a18885ef4a1a96836bf986a37fdc694 (diff)
Changes requested by Jeff Meininger
1. Browser responds to FL_KEYBOARD as well as FL_SHORTCUT. If you subclass it to accept focus then keyboard navigation will work. I could not do his full patch as it broke the file chooser's tab completion and perhaps other programs. 2. Fl_Tile and Fl_Tabs do their callback when the user changes their display. 3. Made some of the private methods of Fl_Browser protected. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@879 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--FL/Fl_Browser.H25
-rw-r--r--src/Fl_Browser_.cxx7
-rw-r--r--src/Fl_Tabs.cxx6
-rw-r--r--src/Fl_Tile.cxx5
4 files changed, 24 insertions, 19 deletions
diff --git a/FL/Fl_Browser.H b/FL/Fl_Browser.H
index b5e89fe50..733f3ae4b 100644
--- a/FL/Fl_Browser.H
+++ b/FL/Fl_Browser.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Browser.H,v 1.8.2.2 1999/08/20 07:54:36 bill Exp $"
+// "$Id: Fl_Browser.H,v 1.8.2.3 1999/11/16 07:39:56 bill Exp $"
//
// Browser header file for the Fast Light Tool Kit (FLTK).
//
@@ -36,6 +36,18 @@ struct FL_BLINE;
class Fl_Browser : public Fl_Browser_ {
+ FL_BLINE *first; // the array of lines
+ FL_BLINE *last;
+ FL_BLINE *cache;
+ int cacheline; // line number of cache
+ int lines; // Number of lines
+ int full_height_;
+ const int* column_widths_;
+ char format_char_; // alternative to @-sign
+ char column_char_; // alternative to tab
+
+protected:
+
// required routines for Fl_Browser_ subclass:
FL_EXPORT void* item_first() const ;
FL_EXPORT void* item_next(void*) const ;
@@ -48,15 +60,6 @@ class Fl_Browser : public Fl_Browser_ {
FL_EXPORT int full_height() const ;
FL_EXPORT int incr_height() const ;
- FL_BLINE *first; // the array of lines
- FL_BLINE *last;
- FL_BLINE *cache;
- int cacheline; // line number of cache
- int lines; // Number of lines
- int full_height_;
- const int* column_widths_;
- char format_char_; // alternative to @-sign
- char column_char_; // alternative to tab
FL_EXPORT FL_BLINE* find_line(int) const ;
FL_EXPORT FL_BLINE* _remove(int) ;
FL_EXPORT void insert(int, FL_BLINE*);
@@ -115,5 +118,5 @@ public:
#endif
//
-// End of "$Id: Fl_Browser.H,v 1.8.2.2 1999/08/20 07:54:36 bill Exp $".
+// End of "$Id: Fl_Browser.H,v 1.8.2.3 1999/11/16 07:39:56 bill Exp $".
//
diff --git a/src/Fl_Browser_.cxx b/src/Fl_Browser_.cxx
index d95d45a88..244dbdb8f 100644
--- a/src/Fl_Browser_.cxx
+++ b/src/Fl_Browser_.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Browser_.cxx,v 1.10.2.4 1999/11/07 08:33:36 bill Exp $"
+// "$Id: Fl_Browser_.cxx,v 1.10.2.5 1999/11/16 07:39:57 bill Exp $"
//
// Base Browser widget class for the Fast Light Tool Kit (FLTK).
//
@@ -485,7 +485,8 @@ int Fl_Browser_::select_only(void* l, int docallbacks) {
int Fl_Browser_::handle(int event) {
// must do shortcuts first or the scrollbar will get them...
- if (event == FL_SHORTCUT && type() >= FL_HOLD_BROWSER) {
+ if ((event == FL_SHORTCUT || event == FL_KEYBOARD)
+ && type() >= FL_HOLD_BROWSER) {
void* l1 = selection_;
void* l = l1; if (!l) l = top_; if (!l) l = item_first();
if (l) {
@@ -667,5 +668,5 @@ void Fl_Browser_::item_select(void*, int) {}
int Fl_Browser_::item_selected(void* l) const {return l==selection_;}
//
-// End of "$Id: Fl_Browser_.cxx,v 1.10.2.4 1999/11/07 08:33:36 bill Exp $".
+// End of "$Id: Fl_Browser_.cxx,v 1.10.2.5 1999/11/16 07:39:57 bill Exp $".
//
diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx
index 43355c84b..b24b7957c 100644
--- a/src/Fl_Tabs.cxx
+++ b/src/Fl_Tabs.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Tabs.cxx,v 1.6.2.3 1999/10/15 09:01:45 bill Exp $"
+// "$Id: Fl_Tabs.cxx,v 1.6.2.4 1999/11/16 07:39:59 bill Exp $"
//
// Tab widget for the Fast Light Tool Kit (FLTK).
//
@@ -138,7 +138,7 @@ int Fl_Tabs::handle(int event) {
case FL_DRAG:
case FL_RELEASE:
o = which(Fl::event_x(), Fl::event_y());
- if (event == FL_RELEASE) {push(0); if (o) value(o);}
+ if (event == FL_RELEASE) {push(0); if (o && value(o)) do_callback();}
else push(o);
return 1;
@@ -271,5 +271,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.3 1999/10/15 09:01:45 bill Exp $".
+// End of "$Id: Fl_Tabs.cxx,v 1.6.2.4 1999/11/16 07:39:59 bill Exp $".
//
diff --git a/src/Fl_Tile.cxx b/src/Fl_Tile.cxx
index 1ba47b33c..08071ecce 100644
--- a/src/Fl_Tile.cxx
+++ b/src/Fl_Tile.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Tile.cxx,v 1.5.2.1 1999/05/25 05:33:56 bill Exp $"
+// "$Id: Fl_Tile.cxx,v 1.5.2.2 1999/11/16 07:39:59 bill Exp $"
//
// Tile widget for the Fast Light Tool Kit (FLTK).
//
@@ -187,6 +187,7 @@ int Fl_Tile::handle(int event) {
} else
newy = sy;
position(sx,sy,newx,newy);
+ do_callback();
return 1;}
}
@@ -195,5 +196,5 @@ int Fl_Tile::handle(int event) {
}
//
-// End of "$Id: Fl_Tile.cxx,v 1.5.2.1 1999/05/25 05:33:56 bill Exp $".
+// End of "$Id: Fl_Tile.cxx,v 1.5.2.2 1999/11/16 07:39:59 bill Exp $".
//