From b12dffeafad4f54638c0ce56e048e368cfeadea1 Mon Sep 17 00:00:00 2001 From: alexs75 Date: Mon, 27 May 2019 06:13:32 +0000 Subject: [PATCH] RxFPC:RxDBGrid - fix cell background color on empty dataset git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6955 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/rx/trunk/languages/rxconst.uk.po | 2 +- components/rx/trunk/languages/rxdconst.es.po | 2 +- components/rx/trunk/rxdb/rxdbgrid.pas | 40 ++++++++++---------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/components/rx/trunk/languages/rxconst.uk.po b/components/rx/trunk/languages/rxconst.uk.po index 12ca2d946..f76f0e3a2 100644 --- a/components/rx/trunk/languages/rxconst.uk.po +++ b/components/rx/trunk/languages/rxconst.uk.po @@ -210,7 +210,7 @@ msgid "Question" msgstr "" #: rxconst.sreqvalue -#, fuzzy, object-pascal-format +#, object-pascal-format, fuzzy #| msgid "Error. Expected value for filed %s." msgid "Error. Expected value for field %s." msgstr "Поле %s. Вимагається значення" diff --git a/components/rx/trunk/languages/rxdconst.es.po b/components/rx/trunk/languages/rxdconst.es.po index 0048577a0..53e7dd090 100644 --- a/components/rx/trunk/languages/rxdconst.es.po +++ b/components/rx/trunk/languages/rxdconst.es.po @@ -75,7 +75,7 @@ msgid "Data changed. Save?" msgstr "Dato cambiado. Salvar?" #: rxdconst.sdatabasename -#, fuzzy, object-pascal-format +#, object-pascal-format, fuzzy #| msgid "Database loocked: %s" msgid "Database locked: %s" msgstr "Base de Dato bloqueada: %s" diff --git a/components/rx/trunk/rxdb/rxdbgrid.pas b/components/rx/trunk/rxdb/rxdbgrid.pas index 312babd86..504aa3048 100644 --- a/components/rx/trunk/rxdb/rxdbgrid.pas +++ b/components/rx/trunk/rxdb/rxdbgrid.pas @@ -4700,26 +4700,26 @@ begin CalcCellExtent(acol, arow, aRect); PrepareCanvas(aCol, aRow, aState); + if FGroupItems.Active and Assigned(FGroupItemDrawCur) then + begin + gRect:=aRect; + aRect.Bottom:=aRect.Bottom - DefaultRowHeight - 1; + gRect.Top:=aRect.Bottom; + gRect.Bottom:=gRect.Bottom - 2; + end; + + if Assigned(FOnGetCellProps) and not (gdSelected in aState) then + begin + FBackground := Canvas.Brush.Color; + FOnGetCellProps(Self, GetFieldFromGridColumn(aCol), Canvas.Font, FBackground); + Canvas.Brush.Color := FBackground; + end; + Canvas.FillRect(aRect); + + DrawCellGrid(aCol, aRow, aRect, aState); + if DataSetNotEmpty then begin - if FGroupItems.Active and Assigned(FGroupItemDrawCur) then - begin - gRect:=aRect; - aRect.Bottom:=aRect.Bottom - DefaultRowHeight - 1; - gRect.Top:=aRect.Bottom; - gRect.Bottom:=gRect.Bottom - 2; - end; - - if Assigned(FOnGetCellProps) and not (gdSelected in aState) then - begin - FBackground := Canvas.Brush.Color; - FOnGetCellProps(Self, GetFieldFromGridColumn(aCol), Canvas.Font, FBackground); - Canvas.Brush.Color := FBackground; - end; - Canvas.FillRect(aRect); - - DrawCellGrid(aCol, aRow, aRect, aState); - RxColumn := TRxColumn(ColumnFromGridColumn(aCol)); if Assigned(RxColumn) and Assigned(RxColumn.Field) and Assigned(RxColumn.ImageList) then @@ -4730,8 +4730,7 @@ begin DrawCellBitmap(RxColumn, aRect, aState, AImageIndex); end else - DefaultDrawCellData(aCol, aRow, aRect, aState) - ; + DefaultDrawCellData(aCol, aRow, aRect, aState); if FGroupItems.Active and Assigned(FGroupItemDrawCur) then begin @@ -4752,6 +4751,7 @@ begin if C.FGroupParam.FValueType <> fvtNon then WriteTextHeader(Canvas, gRect, C.FGroupParam.DisplayText, C.FGroupParam.Alignment); end; + end; end else