Autor Beitrag
Biarchiv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: Di 05.01.10 18:04 
Hallo,

wenn man die Größe oder Farbe speichern will, kann man ein ini.WriteInteger oder ini.ReadInteger bei ini files benutzen. Was muss man aber bei den Fonta (Schriftart) nehmen, damit ich auch die Schriftart wiedergeben kann?

ausblenden Delphi-Quelltext
1:
2:
3:
  ??? := FontDialog1.Font; // Schriftart
  integer := FontDialog1.Font.Size; // ini.WriteInteger, ini.ReadInteger
  integer := FontDialog1.Font.Color; // ini.WriteInteger, ini.ReadInteger
Frühlingsrolle
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 05.01.10 19:08 
- Nachträglich durch die Entwickler-Ecke gelöscht -
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Di 05.01.10 21:12 
ausblenden Delphi-Quelltext
1:
2:
3:
String  := FontDialog1.Font.Name; // Schriftart
  integer := FontDialog1.Font.Size; // ini.WriteInteger, ini.ReadInteger
  integer := FontDialog1.Font.Color; // ini.WriteInteger, ini.ReadInteger
colaka
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 200
Erhaltene Danke: 4

Win XP, W7
Delphi 2005 Prof.
BeitragVerfasst: Fr 08.01.10 07:33 
Hallo,

eine ausführliche Antwort auf diese Frage findest Du unter folgendem Link:

swissdelphicenter.ch...showcode.php?id=2149

Gruß Ebi
Reinhard Kern
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 591
Erhaltene Danke: 14



BeitragVerfasst: Fr 08.01.10 11:49 
Hallo,

ich habe den Stil einfach in den Fontstring eingefügt und setze das mit folgenden Schnipseln zusammen/auseinander:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
 {...}
 with SetupControl as TEdit do
  begin
  newtext := '--' + ShortStr (Text);
  if fsBold in Font.Style then newtext[1] := 'b';
  if fsItalic in Font.Style then newtext[2] := 'i';
  end;
 {...}
 with SetupControl as TEdit do
  begin
  ItemStr := GetItemStr (pRecord);
  Font.Style := [];
  if ItemStr[1] = 'b' then Font.Style := [fsBold];
  if ItemStr[2] = 'i' then
     Font.Style := Font.Style + [fsItalic];
  Delete (ItemStr,1,2);
  Font.Name := ItemStr;
  Text := ItemStr;
  end;


Die Fontgrösse ist sowieso eine einfache Zahl.

Gruss Reinhard