No focus, hitting down would skip first item
Enter key to toggle was falling through to other widgets
Removing an item that has focus clears item focus (to prevent wild ptr)
Added new methods:
Fl_Tree::get_item_focus()
Fl_Tree::first_visible()
Fl_Tree::last_visible()
Fl_Tree::is_vscroll_visible()
Simplified + fixed Fl_Tree_Item::next_displayed()
Fixed Fl_Tree_Item::visible_r(), was skipping item if it was a closed branch.
tree demo: fixed button ordering for "Test Suggestions" button
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9555 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
/// \returns last visible item in the tree, or 0 if none.
///
/// \see first_visible(), last_visible()
///
Fl_Tree_Item*Fl_Tree::last_visible(){
Fl_Tree_Item*item=last();
while(item){
if(item->visible()){
if(item==_root&&!showroot()){
return(0);
}else{
return(item);
}
}
item=prev(item);
}
return(item);
}
/// Returns the first selected item in the tree.
///
/// Use this to walk the tree looking for all the selected items, eg:
@ -1334,6 +1374,11 @@ int Fl_Tree::select_all(Fl_Tree_Item *item, int docallback) {
@@ -1334,6 +1374,11 @@ int Fl_Tree::select_all(Fl_Tree_Item *item, int docallback) {
return(count);
}
/// Get the item that currently has keyboard focus.
Fl_Tree_Item*Fl_Tree::get_item_focus()const{
return(_item_focus);
}
/// Set the item that currently should have keyboard focus.
/// Handles calling redraw() to update the focus box (if it is visible).
tooltip {Sets the default label bg color for newly created items. When set, this overrides the default behavior of using Fl_Tree::color().} xywh {975 477 16 16} box DOWN_BOX labelsize 12 align 7