summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2013-04-08 01:40:14 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2013-04-08 01:40:14 +0100
commit4a16290513e9719cf71987da9b325d0534dde54f (patch)
tree0ea7795d917c97a84f545d018cb8374ee8ad1609 /src
parent74fac8c94d47ed546ecaf73d42a8206a8d56f8e7 (diff)
downloadfpGUI-4a16290513e9719cf71987da9b325d0534dde54f.tar.xz
tree keyboard handling: we never tested for ShiftState
Diffstat (limited to 'src')
-rw-r--r--src/gui/fpg_tree.pas111
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