Einzelnen Beitrag anzeigen

Whookie

Registriert seit: 3. Mai 2006
Ort: Graz
441 Beiträge
 
Delphi 10.3 Rio
 
#2

AW: Syles in eigener Komponente verwenden.

  Alt 14. Dez 2016, 10:13
Wenn es nur um Farben geht mache ich das in etwa so:

Delphi-Quellcode:
  { Set the color of label text }
  if (StyleServices.Enabled) And (seFont In StyleElements) then
  begin
    if not Enabled then
      Canvas.Font.Color := StyleServices.GetStyleFontColor(sfWindowTextDisabled)
    else
      Canvas.Font.Color := StyleServices.GetStyleFontColor(sfWindowTextNormal);
  end
  else
  begin
    if not Enabled then
      Canvas.Font.Color := clGrayText
    else
      Canvas.Font.Color := iColr;
  end;

  Canvas.TextOut(xo+CDO, yo+CDO, Text);
Für alles andere bieten die StyleServices natürlich auch Funktionen und Konstanten (zu finden in Vcl.Themes.pas).
Whookie

Software isn't released ... it is allowed to escape!

Geändert von Whookie (14. Dez 2016 um 10:19 Uhr) Grund: Alle nötigen Funktionen und Konstanten sind in der Vcl.Themes.pas zu finden
  Mit Zitat antworten Zitat