Hallo Delphis,
wie komme ich an die TitleFontColor Eigenschaft in einer von DBGrids abgeleiteten Komponente heran.
Ich zeichne die Titelzeile im DrawCell selbst. Manchmal ist die Font Farbe die gleiche wie die eines selektieren Datensatzes.
Meine, Sie sollte eigendlich schwarz sein, ist aber weiß.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46:
| procedure TDBGridTS.DrawCell(ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); begin if ARow = 0 then begin with canvas do begin brush.color := FTitleBGColor; fillrect(Rect); pen.color := clBtnHighLight; moveto(Rect.Left, pred(Rect.Bottom)); lineto(Rect.Left, Rect.Top); lineto(Rect.Right, Rect.Top); pen.color := clBTnShadow; moveto(succ(Rect.Left), pred(Rect.Bottom)); lineto(pred(Rect.Right), pred(Rect.Bottom)); lineto(pred(Rect.Right), Rect.Top); if (TitleClickColumnSort = True) and (SortArrowVisible = True) then begin if SortColumnIndex = (aCol - 1) then begin if SortArrowAlign = alRight then begin draw(Rect.right - 5 - bmArrow.Width , Rect.top + (Rect.Bottom-Rect.Top-bmArrow.Height) div 2, bmArrow); dec(Rect.Right, bmArrow.width + 5); end else begin draw(Rect.left + 5 , Rect.top + (Rect.Bottom-Rect.Top-bmArrow.Height) div 2, bmArrow); inc(Rect.Left, bmArrow.width + 5); end; end; end; inflaterect(Rect, -2, -2); if aCol > 0 then begin drawtext(handle, PChar(columns[aCol - 1].FieldName), -1, Rect, DT_SingleLine or DT_VCenter); end; end; end else inherited; end; |
Schöner währe es ntürlich zu verstehen warum das hier schief geht. Beteiligt sind auch noch titleclick und drawcolumncell. Es sollen Multiselect, Rowselect und AlwaysShowSelection benutzbar sein. Daran liegts aber glaub ich auch nicht, habs ausprobiert.
Hat jemand eine Idee?