My first try on your patch show that the scrollbar isn't working, and  
modifyng with this make it works even with keyboard:


....
   //int ret = 0;
   int ret = Fl_Group::handle(e);
....
          case FL_Up:           // next item up
          case FL_Down: {       // next item down
            Fl_Tree_Item *newitem = next_visible_item(_item_focus, eventkey);   
//  
next item up|dn
            if ( newitem ) {                                                    
// any found?
              _item_focus = newitem;                                            
// new item becomes new focus widget
              if ( _prefs.selectmode() == FL_TREE_SELECT_MULTI &&               
// multiselect?
                   (Fl::event_state() & FL_SHIFT) &&                            
// Shift-Up?
                    ! newitem->is_selected() ) {                                
// not already selected?
                select(newitem, 1);                                             
// extend selection..
              }
//make scrollbar been updated when cursor goes under or over visible item
              switch (eventkey) {
              case FL_Up:
                if(_item_focus->y() < y())  
_vscroll->value(_vscroll->value()-_item_focus->h());
                break;
              case FL_Down:
                if((_item_focus->y()+_item_focus->h()) > (y()+h()))
                        _vscroll->value(_vscroll->value()+_item_focus->h());
                break;
              }
//end new code
              redraw();                                                         
// redraw focus box/changes
            }
            ret = 1;
            break;
          }
...
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to