Follow up to rev 1156: Enhance readability of selected NULL cells with grey font color: Just use the default font color clWindowText in those cases.

User report: http://www.heidisql.com/forum/viewtopic.php?p=1753
Code inspired by: http://qc.codegear.com/wc/qcmain.aspx?d=3009
This commit is contained in:
Ansgar Becker
2008-02-12 19:49:32 +00:00
parent 30330bfea0
commit f9b6fdaf64

View File

@ -4863,7 +4863,10 @@ begin
Grid := Sender as TTntDBGrid;
if (Grid.Fields[DataCol] <> nil) and Grid.Fields[DataCol].IsNull then
begin
Grid.Canvas.Font.Color := COLOR_NULLVALUE;
if (Grid.SelectedRows.IndexOf(Grid.DataSource.DataSet.Bookmark) <> -1) or (gdSelected in State) then
Grid.Canvas.Font.Color := clWindowText
else
Grid.Canvas.Font.Color := COLOR_NULLVALUE;
// Just use the changed font color for (MEMO) and (BLOB) cells
if Grid.Fields[DataCol].DataType in [ftMemo, ftBlob] then
Grid.DefaultDrawColumnCell(Rect, DataCol, Grid.Columns[DataCol], State)