Hi all,
I'm using D2006:XP-SP2.
My VCL (based on TStringGrid) implements a column's header sorting. That is, when the user clicks on the first row, the grid is sorted according to values of the specified column (FixedCols+FixedRows).
Ascending and Descending are possible and to show the order used, I'm printing a little arrow on the right corner of the cell clicked (font Marlett char '5'+'6') within OnDrawCell event.
This is working fine for all my forms (~30) except one:
'5'/'6' is displayed in Tahoma Font instead of Marlett. Here's my code:
------------------------------
procedure MyGrid.DrawCell(ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
inherited;
Canvas.Font.Name := 'Marlett';
if iColSort < 0 then
DrawText(Canvas.Handle, '5', -1, Rect,
DT_SINGLELINE or DT_CENTER or DT_VCENTER)
else if iColSort > 0 then
DrawText(Canvas.Handle, '6', -1, Rect,
DT_SINGLELINE or DT_CENTER or DT_VCENTER);
Canvas.Font.Name := 'Tahoma';
end;
------------------------------
If I set DefaultDrawing to False (while everywhere else is True), it's working fine... But I would like to keep DefaultDrawing to True to be more consistent in my code.
Thanks a lot for reading,
Rej Cloutier
I'm using D2006:XP-SP2.
My VCL (based on TStringGrid) implements a column's header sorting. That is, when the user clicks on the first row, the grid is sorted according to values of the specified column (FixedCols+FixedRows).
Ascending and Descending are possible and to show the order used, I'm printing a little arrow on the right corner of the cell clicked (font Marlett char '5'+'6') within OnDrawCell event.
This is working fine for all my forms (~30) except one:
'5'/'6' is displayed in Tahoma Font instead of Marlett. Here's my code:
------------------------------
procedure MyGrid.DrawCell(ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
inherited;
Canvas.Font.Name := 'Marlett';
if iColSort < 0 then
DrawText(Canvas.Handle, '5', -1, Rect,
DT_SINGLELINE or DT_CENTER or DT_VCENTER)
else if iColSort > 0 then
DrawText(Canvas.Handle, '6', -1, Rect,
DT_SINGLELINE or DT_CENTER or DT_VCENTER);
Canvas.Font.Name := 'Tahoma';
end;
------------------------------
If I set DefaultDrawing to False (while everywhere else is True), it's working fine... But I would like to keep DefaultDrawing to True to be more consistent in my code.
Thanks a lot for reading,
Rej Cloutier