From e3a593ac0062ec784791bf60086c0faa1f1c7b80 Mon Sep 17 00:00:00 2001 From: alexs75 Date: Wed, 10 May 2017 08:30:45 +0000 Subject: [PATCH] RxFPC:fix work miltiline RxDBGrid title after 54840 git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5846 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi | 239 +++++++++--------- .../trunk/Demos/RxDBGrid_Filter/project1.lps | 150 ++++++----- components/rx/trunk/rxdb/rxdbgrid.pas | 46 ++-- 3 files changed, 224 insertions(+), 211 deletions(-) diff --git a/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi b/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi index a26a6b52e..b98305288 100644 --- a/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi +++ b/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi @@ -55,13 +55,13 @@ - + - - + + @@ -71,8 +71,8 @@ - - + + @@ -81,7 +81,7 @@ - + @@ -89,14 +89,14 @@ - + - + @@ -104,48 +104,48 @@ - + - + - + - + - + - + - + @@ -153,33 +153,33 @@ - + - + - + - + - + @@ -187,21 +187,21 @@ - + - + - + @@ -209,54 +209,54 @@ - + - + - + - + - + - + - + - + @@ -264,21 +264,21 @@ - + - + - + @@ -286,7 +286,7 @@ - + @@ -294,14 +294,14 @@ - + - + @@ -309,14 +309,14 @@ - + - + @@ -324,42 +324,42 @@ - + - + - + - + - + - + @@ -367,7 +367,7 @@ - + @@ -375,50 +375,51 @@ - + - + - + - + - + + - - - + + + - - + + @@ -427,158 +428,169 @@ - + - + - - - + + + - - + - + - - + - - + + + + + + + + + - + + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + + - - + + - - + + - - + + + + + + @@ -603,15 +615,4 @@ - - - - - - - - - - - diff --git a/components/rx/trunk/Demos/RxDBGrid_Filter/project1.lps b/components/rx/trunk/Demos/RxDBGrid_Filter/project1.lps index b247d5e49..aec55cfe9 100644 --- a/components/rx/trunk/Demos/RxDBGrid_Filter/project1.lps +++ b/components/rx/trunk/Demos/RxDBGrid_Filter/project1.lps @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + @@ -22,7 +22,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -50,10 +50,9 @@ - - - + + @@ -156,133 +155,146 @@ - - - + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/components/rx/trunk/rxdb/rxdbgrid.pas b/components/rx/trunk/rxdb/rxdbgrid.pas index 7ad3dc1d5..3a7c3ad72 100644 --- a/components/rx/trunk/rxdb/rxdbgrid.pas +++ b/components/rx/trunk/rxdb/rxdbgrid.pas @@ -777,7 +777,7 @@ type procedure FFilterColDlgButtonOnClick(Sender: TObject); procedure InternalOptimizeColumnsWidth(AColList: TList); - function IsDefaultRowHeightStored: boolean; + //function IsDefaultRowHeightStored: boolean; procedure VisualChange; override; procedure EditorWidthChanged(aCol,aWidth: Integer); override; @@ -2856,7 +2856,7 @@ begin begin if rxTit.Orientation in [toVertical270, toVertical90] then H1 := Max((tmpCanvas.TextWidth(Columns[i].Title.Caption) + - tmpCanvas.TextWidth('W')) div DefaultRowHeight, H) + tmpCanvas.TextWidth('W')) div GetDefaultRowHeight, H) else begin if rxTit.CaptionLinesCount = 0 then @@ -2906,9 +2906,9 @@ begin end; if not (rdgDisableWordWrapTitles in OptionsRx) then - RowHeights[0] := DefaultRowHeight * H + RowHeights[0] := GetDefaultRowHeight * H else - RowHeights[0] := DefaultRowHeight; + RowHeights[0] := GetDefaultRowHeight; if rdgFilter in OptionsRx then begin @@ -2918,7 +2918,7 @@ begin end else begin - RowHeights[0] := RowHeights[0] + DefaultRowHeight; + RowHeights[0] := RowHeights[0] + GetDefaultRowHeight; end; end; @@ -2958,7 +2958,7 @@ begin if Assigned(FFilterListEditor) then Result.Top := bRect.Bottom - FFilterListEditor.Height else - Result.Top := bRect.Bottom - DefaultRowHeight; + Result.Top := bRect.Bottom - GetDefaultRowHeight; end; function TRxDBGrid.getTitleRect(bRect: TRect): TRect; @@ -2967,7 +2967,7 @@ begin if Assigned(FFilterListEditor) then Result.Bottom := bRect.Bottom - FFilterListEditor.Height else - Result.Bottom := bRect.Bottom - DefaultRowHeight; + Result.Bottom := bRect.Bottom - GetDefaultRowHeight; end; procedure TRxDBGrid.OutCaptionCellText(aCol, aRow: integer; const aRect: TRect; @@ -3369,7 +3369,7 @@ begin if i 0) then @@ -4056,7 +4056,7 @@ begin ABrush := nil;//initialize, no need create everytime. R.Top := TotalYOffs; - R.Bottom := TotalYOffs + DefaultRowHeight; + R.Bottom := TotalYOffs + GetDefaultRowHeight; // R.Bottom := TotalYOffs + DefaultRowHeight * FFooterOptions.RowCount; for j:=0 to FFooterOptions.RowCount-1 do @@ -4137,7 +4137,7 @@ begin end; R.Top := R.Bottom; - R.Bottom := R.Bottom + DefaultRowHeight; + R.Bottom := R.Bottom + GetDefaultRowHeight; end; if assigned(ABrush)then FreeAndNil(ABrush); @@ -4460,7 +4460,7 @@ begin Rct := CellRect(0, 0); MPT.X := Rct.Left; if rdgFilter in FOptionsRx then - MPT.Y := Rct.Bottom - DefaultRowHeight + MPT.Y := Rct.Bottom - GetDefaultRowHeight else MPT.Y := Rct.Bottom; MPT := ClientToScreen(MPT); @@ -4714,7 +4714,7 @@ begin begin P:=GCache.MaxClientXY; with GCache do - MaxClientXY.Y:=MaxClientXY.Y - (DefaultRowHeight * FFooterOptions.RowCount + 2); + MaxClientXY.Y:=MaxClientXY.Y - (GetDefaultRowHeight * FFooterOptions.RowCount + 2); end; DoClearInvalidTitle; @@ -4744,12 +4744,12 @@ function TRxDBGrid.GetBufferCount: integer; var H:integer; begin - if DefaultRowHeight > 0 then + if GetDefaultRowHeight > 0 then begin H:=ClientHeight - GCache.FixedHeight; if FFooterOptions.Active then - H:=H - DefaultRowHeight * FFooterOptions.RowCount; - Result := H div DefaultRowHeight; + H:=H - GetDefaultRowHeight * FFooterOptions.RowCount; + Result := H div GetDefaultRowHeight; end else Result := 1; @@ -4932,12 +4932,12 @@ begin FreeMem(WA, SizeOf(integer) * AColList.Count); end; - +(* function TRxDBGrid.IsDefaultRowHeightStored: boolean; begin - Result := DefaultRowHeight = Canvas.TextHeight('Wg'); + Result := GetDefaultRowHeight = Canvas.TextHeight('Wg'); end; - +*) procedure TRxDBGrid.VisualChange; begin CalcTitle;