From d07ef8020747fbeac907417b1420ed19690bec16 Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Mon, 23 Apr 2012 16:31:51 +0000 Subject: Various Fl_Tree enhancements: o Added keyboard navigation table o Added Shift-Click to extend selection, Ctrl-Space to toggle selection, Enter key toggle o Added protected extend_selection(from_item,to_item) o Cleanup of Fl_Tree::handle() o Limit ^A to multi-select mode only o Disable focus box in SELECT_NONE mode o test/tree: changed default mode to 'multiselect' (most often needs testing) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9385 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Tree.H | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) (limited to 'FL') diff --git a/FL/Fl_Tree.H b/FL/Fl_Tree.H index 453841007..64fd234f7 100644 --- a/FL/Fl_Tree.H +++ b/FL/Fl_Tree.H @@ -179,6 +179,78 @@ /// \image html tree-elements.png /// \image latex tree-elements.png "Fl_Tree dimensions" width=6cm /// +/// The following table lists keyboard bindings for navigating the tree: +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +///
Fl_Tree keyboard bindings.
KeyboardFL_TREE_SELECT_MULTIFL_TREE_SELECT_SINGLEFL_TREE_SELECT_NONE
Ctrl-A (Linux/Windows)
Command-A (Mac)
Select all items.N/AN/A
Space Selects item.Selects item.N/A
Ctrl-Space Toggle item.Toggle item.N/A
Shift-Space Extends selection
from last item.
Selects item.N/A
Enter,
Ctrl-Enter,
Shift-Enter
Toggles open/closeToggles open/closeToggles open/close
Right / LeftOpen/Close item.Open/Close item.Open/Close item.
Up / DownMove focus box up/down.Move focus box up/down.N/A
Shift-Up / Shift-DownExtend selection up/down.Move focus up/down.N/A
Home / EndMove to top/bottom of tree.Move to top/bottom of tree.Move to top/bottom of tree.
PageUp / PageDownPage up/down.Page up/down.Page up/down.
+/// /// \enum Fl_Tree_Reason /// The reason the callback was invoked. @@ -216,6 +288,7 @@ protected: void item_clicked(Fl_Tree_Item* val); void do_callback_for_item(Fl_Tree_Item* item, Fl_Tree_Reason reason); Fl_Tree_Item *next_visible_item(Fl_Tree_Item *start, int dir); + void extend_selection(Fl_Tree_Item *from, Fl_Tree_Item *to); public: Fl_Tree(int X, int Y, int W, int H, const char *L=0); -- cgit v1.2.3