I forgot to mention that I added inline functions to Fl_Tree_Item too:
int x() {return _xywh[0];};
int y() {return _xywh[1];};
int w() {return _xywh[2];};
int h() {return _xywh[3];};
En 10/08/2010 20:30:16, Domingo Alvarez Duarte <[email protected]>
escribió:
> 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;
> }
> ...
--
Usando el revolucionario cliente de correo de Opera:
http://www.opera.com/mail/
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk