Autor Beitrag
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Sa 25.06.05 13:22 
Ich habe bei meinem Delphi 6 Enterprise keine FontBox (Font ComboBox) gefunden!
Bin ich nur blind oder gibts die da nicht?
Wenn nicht die kann man doch schnell selbst erstellen oder? In Java habe ich das jedenfals gemacht!
JayK
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1013



BeitragVerfasst: Sa 25.06.05 13:26 
user profile iconJRegier hat folgendes geschrieben:
Ich habe bei meinem Delphi 6 Enterprise keine FontBox (Font ComboBox) gefunden!
Bin ich nur blind oder gibts die da nicht?

Weiß nicht, ob du blind bist... ;)
Beim JVCL ist eine FontComboBox dabei.
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Sa 25.06.05 13:53 
Hallo

einfach
ausblenden Delphi-Quelltext
1:
combobox1.items.assign(screen.fonts);					

und schon stehen alle Fonts in der Comboxbox. Möchtest du, das die Fontnamen in ihrer Schrift gezeichnet werden, dann kommst du mit selberzeichnen weiter. Im dEmo-Ordner gibt es ein "ownerlst"-Demo für eine Listbox, das du auch auf eine combobox übertragen kannst.

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Sa 25.06.05 14:12 
du kannst dir auch eine von www.torry.net suchen... einfach nach font combobox suchen: www.torry.net/quicks...mbobox&Title=Yes

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Sa 25.06.05 15:48 
Hey Leute Ihr seid Super! Danke für Tips! Und natürlich für Hilfsbereitschaft und Freundlichkeit! :D
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Sa 25.06.05 15:56 
user profile iconJayK hat folgendes geschrieben:

Weiß nicht, ob du blind bist... ;)
Beim JVCL ist eine FontComboBox dabei.


Hä JVCL, ich meine doch es heißt VCL! Das meiste was mit J anfängt ist in Java! :)
Aber sag auf welchem Register?
JayK
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1013



BeitragVerfasst: Sa 25.06.05 16:05 
user profile iconJRegier hat folgendes geschrieben:
Hä JVCL, ich meine doch es heißt VCL! Das meiste was mit J anfängt ist in Java! :)
Aber sag auf welchem Register?

JVCL = JEDI Visual Component Library :arrow: JVCL bei SourceForge
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Sa 25.06.05 16:36 
user profile iconKeldorn hat folgendes geschrieben:
Hallo
Im dEmo-Ordner gibt es ein "ownerlst"-Demo für eine Listbox, das du auch auf eine combobox übertragen kannst.
Mfg Frank


Hey Partners ich habe das gemacht! Aber damit die Fonts auch wircklich dargestellt werden hatte
ich csOwnerDrawFixed eingestellt aber dann sind die nicht vollständig also nur zur Hälfte teilweise
zu sehen, kein Problem :roll:) dann habe ich csOWnerDrawVariable gemacht dann werden die Schriftarten
zwar dargestellt aber ich bekomme eine Fehlermeldung Zugriffsverletzung! Woran liegts?
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Sa 25.06.05 19:27 
Wenn wir Deinen code nicht kennen, werden wir Dir das auch nicht sagen können.
Poste einfach deinen relevanten code.

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Sa 25.06.05 19:50 
user profile iconKeldorn hat folgendes geschrieben:
Wenn wir Deinen code nicht kennen, werden wir Dir das auch nicht sagen können.
Poste einfach deinen relevanten code.

Mfg Frank


Hier ist der Code
ausblenden Delphi-Quelltext
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:
procedure TForm1.FormCreate(Sender : TObject);
begin
   [...]
   FontBox.Items := Screen.Fonts;
   FontBox.ItemIndex := 0;
end;


procedure TForm1.FontBoxDrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
begin
  with FontBox.Canvas do
  begin
    FillRect(Rect);
    Font.Name := FontBox.Items[Index];
    Font.Size := 0;    // use font's preferred size
    TextOut(Rect.Left+1, Rect.Top+1, FontBox.Items[Index]);
  end;
end;

procedure TForm1.FontBoxMeasureItem(Control: TWinControl; Index: Integer;
  var Height: Integer);
begin
  with FontBox.Canvas do
  begin
    Font.Name := FontBox.Items[Index];
    Font.Size := 0;                 // use font's preferred size
    Height := TextHeight('Wg') + 2; // measure ascenders and descenders
  end;
end;


Denn habe ich aus demos Ownerlst übernommen!
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Sa 25.06.05 20:18 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.FontBoxMeasureItem(Control: TWinControl; Index: Integer;  
  var Height: Integer);  
begin  
  if index=-1 then exit;  //<<<-----
  with FontBox.Canvas do  
  ...
end;

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Sa 25.06.05 20:42 
user profile iconKeldorn hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.FontBoxMeasureItem(Control: TWinControl; Index: Integer;  
  var Height: Integer);  
begin  
  if index=-1 then exit;  //<<<-----
  with FontBox.Canvas do  
  ...
end;


Hey Danke Partner, hat geklappt! Ich Dummie! :nut:
JayK
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1013



BeitragVerfasst: Sa 25.06.05 20:44 
Ist damit erledigt? Ist immer noch als offene Frage markiert....