From 003b0a0ce863167f8ddada1a2ca28781f8f7538d Mon Sep 17 00:00:00 2001 From: juha Date: Tue, 28 Oct 2014 21:35:40 +0000 Subject: [PATCH] IDE: in "Add Unit To Uses Section" dialog, use interface section by default. Fix layout for FilterEdit. git-svn-id: trunk@46696 - --- ide/useunitdlg.lfm | 26 +++++++++++++------------- ide/useunitdlg.pas | 8 +++++--- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ide/useunitdlg.lfm b/ide/useunitdlg.lfm index 1f2dcd0942..d547818394 100644 --- a/ide/useunitdlg.lfm +++ b/ide/useunitdlg.lfm @@ -12,11 +12,11 @@ object UseUnitDialog: TUseUnitDialog OnCreate = FormCreate OnDestroy = FormDestroy Position = poScreenCenter - LCLVersion = '0.9.31' + LCLVersion = '1.3' object ButtonPanel1: TButtonPanel Left = 6 - Height = 32 - Top = 384 + Height = 30 + Top = 386 Width = 351 OKButton.Name = 'OKButton' OKButton.DefaultCaption = True @@ -41,7 +41,7 @@ object UseUnitDialog: TUseUnitDialog AnchorSideBottom.Control = ButtonPanel1 Left = 6 Height = 49 - Top = 329 + Top = 331 Width = 351 Anchors = [akLeft, akRight, akBottom] AutoFill = True @@ -56,10 +56,10 @@ object UseUnitDialog: TUseUnitDialog ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 2 - ClientHeight = 32 + ClientHeight = 24 ClientWidth = 347 Columns = 2 - ItemIndex = 1 + ItemIndex = 0 Items.Strings = ( 'Interface' 'Implementation' @@ -74,7 +74,7 @@ object UseUnitDialog: TUseUnitDialog AnchorSideRight.Side = asrBottom AnchorSideBottom.Control = AllUnitsCheckBox Left = 6 - Height = 267 + Height = 263 Top = 32 Width = 351 Anchors = [akTop, akLeft, akRight, akBottom] @@ -90,9 +90,9 @@ object UseUnitDialog: TUseUnitDialog AnchorSideLeft.Control = Owner AnchorSideBottom.Control = SectionRadioGroup Left = 12 - Height = 18 - Top = 305 - Width = 104 + Height = 24 + Top = 301 + Width = 115 Anchors = [akLeft, akBottom] BorderSpacing.Left = 6 BorderSpacing.Around = 6 @@ -104,11 +104,11 @@ object UseUnitDialog: TUseUnitDialog AnchorSideLeft.Control = Owner AnchorSideTop.Control = Owner Left = 6 - Height = 20 + Height = 28 Top = 6 - Width = 320 + Width = 351 ButtonWidth = 23 - NumGlyphs = 0 + NumGlyphs = 1 Anchors = [akTop, akLeft, akRight] BorderSpacing.Around = 6 Font.Color = clBtnShadow diff --git a/ide/useunitdlg.pas b/ide/useunitdlg.pas index 0a642964d5..4e3656262e 100644 --- a/ide/useunitdlg.pas +++ b/ide/useunitdlg.pas @@ -394,12 +394,12 @@ end; procedure TUseUnitDialog.DetermineUsesSection(ACode: TCodeBuffer; ACursorPos: TPoint); var - CursorPos: TCodeXYPosition; - CleanCursorPos: Integer; ImplUsesNode: TCodeTreeNode; i: Integer; Tool: TCodeTool; - ImplNode: TCodeTreeNode; + //CursorPos: TCodeXYPosition; + //CleanCursorPos: Integer; + //ImplNode: TCodeTreeNode; begin CodeToolBoss.Explore(ACode,Tool,false); if Tool=nil then exit; @@ -409,11 +409,13 @@ begin for i := 0 to FImplUsedUnits.Count - 1 do FImplUsedUnits.Objects[i] := ImplUsesNode; // check if cursor is behind interface section +{Note: now default to interface section always. CursorPos := CodeXYPosition(ACursorPos.X, ACursorPos.Y, ACode); Tool.CaretToCleanPos(CursorPos,CleanCursorPos); ImplNode:=Tool.FindImplementationNode; if (ImplNode<>nil) and (CleanCursorPos>ImplNode.StartPos) then SectionRadioGroup.ItemIndex := 1; +} // update SectionRadioGroup.OnClick(SectionRadioGroup); end;