From ab53ca94e11833d023a4b9a3fff8085e67cbdd7e Mon Sep 17 00:00:00 2001 From: vincents Date: Mon, 31 Mar 2008 22:10:38 +0000 Subject: [PATCH] object inspector: only respond to arrow keys, if no modifier keys are pressed, so that alt+Down can be handled by a combobox, fixes bug #11031 git-svn-id: trunk@14699 - --- ideintf/objectinspector.pp | 68 +++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/ideintf/objectinspector.pp b/ideintf/objectinspector.pp index 94b3719e25..5f6ba5cac4 100644 --- a/ideintf/objectinspector.pp +++ b/ideintf/objectinspector.pp @@ -1905,45 +1905,53 @@ var Handled: Boolean; begin //writeln('TOICustomPropertyGrid.HandleStandardKeys ',Key); - Handled:=true; - case Key of + if Shift = [] then + begin + Handled:=true; + case Key of - VK_UP: - if (ItemIndex>0) then SetItemIndexAndFocus(ItemIndex-1); + VK_UP: + if (ItemIndex>0) then SetItemIndexAndFocus(ItemIndex-1); - VK_Down: - if (ItemIndex=0) and (Rows[ItemIndex].Expanded) then - ShrinkRow(ItemIndex) + VK_LEFT: + if (FCurrentEdit=nil) + and (ItemIndex>=0) and (Rows[ItemIndex].Expanded) then + ShrinkRow(ItemIndex) + else + Handled:=false; + + VK_RIGHT: + if (FCurrentEdit=nil) + and (ItemIndex>=0) and (not Rows[ItemIndex].Expanded) + and (paSubProperties in Rows[ItemIndex].Editor.GetAttributes) then + ExpandRow(ItemIndex) + else + Handled:=false; + + VK_RETURN: + begin + SetRowValue; + if (FCurrentEdit is TCustomEdit) then + TCustomEdit(FCurrentEdit).SelectAll; + end; else - Handled:=false; - - VK_RIGHT: - if (FCurrentEdit=nil) - and (ItemIndex>=0) and (not Rows[ItemIndex].Expanded) - and (paSubProperties in Rows[ItemIndex].Editor.GetAttributes) then - ExpandRow(ItemIndex) - else - Handled:=false; - - VK_RETURN: - begin - SetRowValue; - if (FCurrentEdit is TCustomEdit) then - TCustomEdit(FCurrentEdit).SelectAll; + Handled := false; end; - + end else - if Assigned(OnOIKeyDown) then - OnOIKeyDown(Self,Key,Shift); + Handled := false; + if not Handled and Assigned(OnOIKeyDown) then + begin + OnOIKeyDown(Self,Key,Shift); Handled:=Key=VK_UNKNOWN; end; + //writeln('TOICustomPropertyGrid.HandleStandardKeys ',Key,' Handled=',Handled); if Handled then Key:=VK_UNKNOWN; end;