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
This commit is contained in:
parent
d1f909be8a
commit
9ce13e4fff
@ -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 $".
|
||||
//
|
||||
|
@ -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 $".
|
||||
//
|
||||
|
@ -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 $".
|
||||
//
|
||||
|
@ -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 $".
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user