Delphi-PRAXiS
Seite 3 von 3     123   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi FontDialog (https://www.delphipraxis.net/3881-fontdialog.html)

Pseudemys Nelsoni 20. Dez 2003 13:49

Re: FontDialog
 
also ich habs nochmal versucht...

die werte die bei dir nicht gingen, musst du vorher mit "IntToStr" umwandeln

dann gehts

dopeline 20. Dez 2003 14:00

Re: FontDialog
 
also bei font.pitch und font.styte funktioniert die varianta mit IntToStr nicht, leider... welche nehme ich da?


Gruß, dopeline

Pseudemys Nelsoni 20. Dez 2003 14:51

Re: FontDialog
 
keine ahnung ob delphi das umwandeln kann, aber du kannst dir auch selbst eine funktion schreiben die das umwandelt.

Delphi-Quellcode:
function PitchToStr(f: TFont): string;
begin
  if f.Pitch = fpDefault then result := 'fpDefault';
  if f.Pitch = fpFixed then result := 'fpFixed';
  if f.Pitch = fpVariable then result := 'fpVariable';
end;
und dann müsste das mit:

Delphi-Quellcode:
settings.WriteString('Font', 'Pitch', PitchToStr(FontDialogTabelle.Font));
gehen

Robert_G 20. Dez 2003 15:52

Re: FontDialog
 
Die Farben bekommt ihr mit "ColorToString" in einen String und mit "StringToColor" wieder zurück konvertiert.
Außerdem könntest du ja noch ein Umkehrung von "PitchToStr" zum Auslesen aus der Ini schreiben.

Gruß Robert :hi:

Pseudemys Nelsoni 20. Dez 2003 16:05

Re: FontDialog
 
Dachte das er dann vielleicht selbst drauf kommt^^

also um den string wieder in Pitch zu bekommen:

Delphi-Quellcode:
function StrToPitch(s: string): TFont;
begin
  if s = 'fpDefault' then result.pitch := fpDefault;
  if s = 'fpFixed' then result.pitch := fpFixed;
  if s = 'fpVariable' then result.pitch := fpVariable;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:39 Uhr.
Seite 3 von 3     123   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz