Find a better fix for the black focus rectangle plus fix another graphical glitch for MEMO and BLOB cells, which didn't get covered completely by the (NULL). This fix just leaves the (MEMO) and only uses the grey color for it.

This commit is contained in:
Ansgar Becker
2007-12-05 00:36:03 +00:00
parent 367cb4cc40
commit db48c82110
2 changed files with 7 additions and 4 deletions

View File

@ -79,7 +79,7 @@ const
// Used by ListViews and Grids
COLOR_SORTCOLUMN_ASC = $00F7F7F7; // light grey
COLOR_SORTCOLUMN_DESC = $00EEEEEE; // medium grey
COLOR_NULLVALUE = $00A0A0A0; // darker gray
COLOR_NULLVALUE = $00707070; // darker gray
ORDER_ASC = 0; // Used for tag-value of "Direction"-button
ORDER_DESC = 1; // dito
TXT_ASC = 'ASC'; // Used for caption of "Direction"-button

View File

@ -4920,9 +4920,12 @@ begin
if (Grid.Fields[DataCol] <> nil) and Grid.Fields[DataCol].IsNull then
begin
Grid.Canvas.Font.Color := COLOR_NULLVALUE;
Grid.Canvas.TextOut(Rect.Left+2, Rect.Top+2, '(NULL)');
// Reset font color, so the focus rectangle in this cell displays as dotted rectangle
Grid.Canvas.Font.Color := clWindowText;
// 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)
// ... while the natively displayed datatypes get a grey (NULL)
else
Grid.Canvas.TextOut(Rect.Left+2, Rect.Top+2, '(NULL)');
end;
end;