From 3b8c66ab2aa1fbe2f215cc9ce00aa930387865d2 Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 24 Dec 2008 14:41:07 +0000 Subject: [PATCH] ideintf: expanding/collapsing subproperties by alt + left/right keys in the Object Inspector (by Alexander S. Klenin, #0012852) git-svn-id: trunk@17939 - --- ideintf/objectinspector.pp | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/ideintf/objectinspector.pp b/ideintf/objectinspector.pp index 1aa64a95a9..4daba71618 100644 --- a/ideintf/objectinspector.pp +++ b/ideintf/objectinspector.pp @@ -2112,12 +2112,6 @@ end; procedure TOICustomPropertyGrid.HandleStandardKeys( var Key: Word; Shift: TShiftState); - function IsGoodEdit: Boolean; - begin - Result := - ((FCurrentEdit = nil) or not FCurrentEdit.Focused) and (ItemIndex >= 0); - end; - var Handled: Boolean; @@ -2134,19 +2128,6 @@ var VK_TAB: DoTabKey; - VK_LEFT: - begin - Handled := IsGoodEdit and Rows[ItemIndex].Expanded; - if Handled then ShrinkRow(ItemIndex); - end; - - VK_RIGHT: - begin - Handled := IsGoodEdit and not Rows[ItemIndex].Expanded and - CanExpandRow(Rows[ItemIndex]); - if Handled then ExpandRow(ItemIndex) - end; - VK_RETURN: begin SetRowValue; @@ -2180,7 +2161,23 @@ begin Handled := true; end; end; - end; + end + else + if Shift = [ssAlt] then + case Key of + VK_LEFT: + begin + Handled := (ItemIndex >= 0) and Rows[ItemIndex].Expanded; + if Handled then ShrinkRow(ItemIndex); + end; + + VK_RIGHT: + begin + Handled := (ItemIndex >= 0) and not Rows[ItemIndex].Expanded and + CanExpandRow(Rows[ItemIndex]); + if Handled then ExpandRow(ItemIndex) + end; + end; if not Handled and Assigned(OnOIKeyDown) then begin