1) Invoke callback if when(FL_WHEN_RELEASE)
2) Removed unintended fallthrough from FL_DRAG -> FL_RELEASE handler. 3) Removed redundant redraw() calls git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7599 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
3ef47f712a
commit
e874b086ac
@ -304,12 +304,12 @@ int Fl_Tree::handle(int e) {
|
|||||||
changed = 1; // changed
|
changed = 1; // changed
|
||||||
o->select_toggle(); // toggle selection
|
o->select_toggle(); // toggle selection
|
||||||
lastselect = o; // save we toggled it (prevents oscillation)
|
lastselect = o; // save we toggled it (prevents oscillation)
|
||||||
redraw(); // make change(s) visible
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
changed = 1; // changed
|
if ( ! o->is_selected() ) {
|
||||||
o->select(); // select this
|
changed = 1; // changed
|
||||||
redraw(); // make change(s) visible
|
o->select(); // select this
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -323,11 +323,17 @@ int Fl_Tree::handle(int e) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case FL_RELEASE: {
|
case FL_RELEASE: {
|
||||||
if ( Fl::event_button() == FL_LEFT_MOUSE ) {
|
if ( Fl::event_button() == FL_LEFT_MOUSE ) {
|
||||||
ret |= 1;
|
ret |= 1;
|
||||||
}
|
}
|
||||||
|
if ( when() & FL_WHEN_RELEASE ||
|
||||||
|
( changed && when() & FL_WHEN_CHANGED) ) {
|
||||||
|
set_changed();
|
||||||
|
do_callback((Fl_Widget*)this, user_data()); // item callback
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user