diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2013-04-08 01:40:14 +0100 |
---|---|---|
committer | David Laurence Emerson <dle3ab@angelbase.com> | 2013-05-28 00:42:52 -0700 |
commit | eb95e98e545143b89cbb791e561f905a757f24cf (patch) | |
tree | fb02e26185e4f8225be4c4f41a0198fbee4ab9a5 /src | |
parent | ccb8791169ec6d14ece66f7fa2ec0c0d873970a1 (diff) | |
download | fpGUI-eb95e98e545143b89cbb791e561f905a757f24cf.tar.xz |
tree keyboard handling: we never tested for ShiftState
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/fpg_tree.pas | 111 |
1 files changed, 57 insertions, 54 deletions
diff --git a/src/gui/fpg_tree.pas b/src/gui/fpg_tree.pas index 4a4316ac..8935ec36 100644 --- a/src/gui/fpg_tree.pas +++ b/src/gui/fpg_tree.pas @@ -1868,74 +1868,77 @@ var OldSelection: TfpgTreeNode; begin OldSelection := Selection; - case KeyCode of - keyRight: - begin - Consumed := True; - Selection.Expand; - DoExpand(Selection); - ResetScrollbar; - RePaint; - end; + if ShiftState = [] then + begin + case KeyCode of + keyRight: + begin + Consumed := True; + Selection.Expand; + DoExpand(Selection); + ResetScrollbar; + RePaint; + end; - keyLeft: - begin - Consumed := True; - Selection.Collapsed := true; - ResetScrollbar; - RePaint; - end; + keyLeft: + begin + Consumed := True; + Selection.Collapsed := true; + ResetScrollbar; + RePaint; + end; - keyUp: - begin - if Selection = nil then - Selection := RootNode.FirstSubNode - else - if Selection <> RootNode then + keyUp: + begin + if Selection = nil then + Selection := RootNode.FirstSubNode + else + if Selection <> RootNode then + begin + if NodeIsVisible(selection) then + begin + h := PrevVisualNode(Selection); + if (h <> RootNode) and (h <> nil) then + Selection := h; + end + else + begin + Selection := RootNode.FirstSubNode; + end; + end; + Consumed := True; + end; + + keyDown: + begin + Consumed := True; + if Selection = nil then + Selection := RootNode.FirstSubNode + else begin if NodeIsVisible(selection) then begin - h := PrevVisualNode(Selection); - if (h <> RootNode) and (h <> nil) then + h := NextVisualNode(Selection); + if (h <> nil) then Selection := h; end else - begin Selection := RootNode.FirstSubNode; - end; end; - Consumed := True; - end; + end; - keyDown: - begin - Consumed := True; - if Selection = nil then - Selection := RootNode.FirstSubNode - else + keyPageUp: begin - if NodeIsVisible(selection) then - begin - h := NextVisualNode(Selection); - if (h <> nil) then - Selection := h; - end - else - Selection := RootNode.FirstSubNode; + FVScrollbar.PageUp; end; - end; - - keyPageUp: - begin - FVScrollbar.PageUp; - end; - keyPageDown: - begin - FVScrollbar.PageDown; - end; - else - Consumed := False; + keyPageDown: + begin + FVScrollbar.PageDown; + end; + else + Consumed := False; + end; end; if Selection <> OldSelection then |