From 06befbadc9885279d311c6dfa2c6b8c76cebc5b3 Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 22 Sep 2009 01:11:25 +0000 Subject: [PATCH] designer: focus object inspector grid on pressing Enter key git-svn-id: trunk@21811 - --- designer/designer.pp | 15 +++++++++++++++ designer/objinspext.pas | 2 +- ide/main.pp | 10 ++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/designer/designer.pp b/designer/designer.pp index 7530edaf40..267b3081fc 100644 --- a/designer/designer.pp +++ b/designer/designer.pp @@ -92,6 +92,7 @@ type FMediator: TDesignerMediator; FOnActivated: TNotifyEvent; FOnCloseQuery: TNotifyEvent; + FOnShowObjectInspector: TNotifyEvent; FOnPersistentDeleted: TOnPersistentDeleted; FOnGetNonVisualCompIcon: TOnGetNonVisualCompIcon; FOnGetSelectedComponentClass: TOnGetSelectedComponentClass; @@ -183,6 +184,7 @@ type PasteFlags: TComponentPasteSelectionFlags): Boolean; procedure DoShowTabOrderEditor; procedure DoShowChangeClassDialog; + procedure DoShowObjectInspector; procedure DoOrderMoveSelectionToFront; procedure DoOrderMoveSelectionToBack; procedure DoOrderForwardSelectionOne; @@ -322,6 +324,7 @@ type read FOnShowOptions write FOnShowOptions; property OnViewLFM: TNotifyEvent read FOnViewLFM write FOnViewLFM; property OnSaveAsXML: TNotifyEvent read FOnSaveAsXML write FOnSaveAsXML; + property OnShowObjectInspector: TNotifyEvent read FOnShowObjectInspector write FOnShowObjectInspector; property ShowGrid: boolean read GetShowGrid write SetShowGrid; property ShowBorderSpacing: boolean read GetShowBorderSpacing write SetShowBorderSpacing; property ShowEditorHints: boolean @@ -1147,6 +1150,12 @@ begin ShowChangeClassDialog(Self,ControlSelection[0].Persistent); end; +procedure TDesigner.DoShowObjectInspector; +begin + if Assigned(FOnShowObjectInspector) then + OnShowObjectInspector(Self); +end; + procedure TDesigner.DoOrderMoveSelectionToFront; begin if ControlSelection.Count <> 1 then Exit; @@ -2199,6 +2208,12 @@ begin else Handled := False; + VK_RETURN: + if Shift = [] then + DoShowObjectInspector + else + Handled := False; + VK_A: if Shift = [ssCtrl] then DoSelectAll diff --git a/designer/objinspext.pas b/designer/objinspext.pas index 5fdebb4f2c..16abb70519 100644 --- a/designer/objinspext.pas +++ b/designer/objinspext.pas @@ -1,7 +1,7 @@ { ***************************************************************************** * * - * See the file COPYING.modifiedLGPL.txt, included in this distribution, * + * See the file COPYING.modifiedLGPL.txt, included in this distribution, * * for details about the copyright. * * * * This program is distributed in the hope that it will be useful, * diff --git a/ide/main.pp b/ide/main.pp index fc24bc602d..d320513823 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -454,6 +454,7 @@ type AComponent: TComponent; const NewName: string); procedure OnDesignerViewLFM(Sender: TObject); procedure OnDesignerSaveAsXML(Sender: TObject); + procedure OnDesignerShowObjectInspector(Sender: TObject); // control selection procedure OnControlSelectionChanged(Sender: TObject; ForceUpdate: Boolean); @@ -3161,6 +3162,7 @@ begin OnComponentAdded:=@OnDesignerComponentAdded; OnViewLFM:=@OnDesignerViewLFM; OnSaveAsXML:=@OnDesignerSaveAsXML; + OnShowObjectInspector:=@OnDesignerShowObjectInspector; ShowEditorHints:=EnvironmentOptions.ShowEditorHints; ShowComponentCaptions := EnvironmentOptions.ShowComponentCaptions; end; @@ -11220,9 +11222,12 @@ end; procedure TMainIDE.DoBringToFrontFormOrInspector(ForceInspector: boolean); procedure ShowInspector; + var + Control: TWinControl; begin if ObjectInspector1=nil then exit; ObjectInspector1.ShowOnTop; + ObjectInspector1.FocusGrid; if FDisplayState <> high(TDisplayState) then FDisplayState:= Succ(FDisplayState); end; @@ -13968,6 +13973,11 @@ begin end; end; +procedure TMainIDE.OnDesignerShowObjectInspector(Sender: TObject); +begin + DoBringToFrontFormOrInspector(True); +end; + Procedure TMainIDE.OnSrcNoteBookAddJumpPoint(ACaretXY: TPoint; ATopLine: integer; APageIndex: integer; DeleteForwardHistory: boolean); {off $DEFINE VerboseJumpHistory}