summaryrefslogtreecommitdiff
path: root/src/gui/fpg_tree.pas
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/fpg_tree.pas')
-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