From 6e6af285917bc61d61e3b113923a6247d9a9558f Mon Sep 17 00:00:00 2001 From: wp Date: Tue, 26 Feb 2019 15:27:34 +0000 Subject: [PATCH] TAChart: Increase width of Text column in DataPoints editor. git-svn-id: trunk@60512 - --- components/tachart/tadatapointseditor.lfm | 1 + components/tachart/tadatapointseditor.pas | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/components/tachart/tadatapointseditor.lfm b/components/tachart/tadatapointseditor.lfm index a26dc9bec6..f352a5916e 100644 --- a/components/tachart/tadatapointseditor.lfm +++ b/components/tachart/tadatapointseditor.lfm @@ -68,6 +68,7 @@ object DataPointsEditorForm: TDataPointsEditorForm CancelButton.Name = 'CancelButton' CancelButton.DefaultCaption = True TabOrder = 1 + DefaultButton = pbHelp ShowButtons = [pbOK, pbCancel] end object pmRows: TPopupMenu diff --git a/components/tachart/tadatapointseditor.pas b/components/tachart/tadatapointseditor.pas index b86db3ddfe..faee8c7429 100644 --- a/components/tachart/tadatapointseditor.pas +++ b/components/tachart/tadatapointseditor.pas @@ -155,16 +155,18 @@ begin // Adjust column widths w := sgData.Canvas.TextWidth('$000000') + 3*varCellPadding + sgData.DefaultRowHeight; - for i := 0 to sgData.Columns.Count-1 do + for i := 0 to sgData.Columns.Count-2 do sgData.Columns[i].Width := w; + sgData.Columns[sgData.Columns.Count-1].Width := 3*w; -{$IFDEF WINDOWS} - Width := sgData.ColWidths[0] + 1 + sgData.Columns.Count * w + sgData.Left * 2 + - IfThen(sgData.BorderStyle = bsNone, 0, 3); -{$ELSE} - Width := sgData.ColWidths[0] + sgData.Columns.Count * w + sgData.Left * 2 + - sgData.GridLineWidth * (sgData.Columns.Count-1); -{$ENDIF} + w := sgData.ColWidths[0] + sgData.Left * 2; + for i := 0 to sgData.Columns.Count-1 do + inc(w, sgData.Columns[i].Width); + {$IFDEF WINDOWS} + Width := Min(Screen.Width, w + 1 + IfThen(sgData.BorderStyle = bsNone, 0, 3)); + {$ELSE} + Width := Min(Screen.Width, w + sgData.GridLinedWidth * (sgData.Columns.Count-1)); + {$ENDIF} end; procedure TDataPointsEditorForm.miDeleteRowClick(Sender: TObject);