Autor Beitrag
kad_we
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78


D6; Turbo Delphi 2006
BeitragVerfasst: Mi 05.11.03 13:50 
Bin noch nicht ganz so erfahren in Delphi und ich will jetzt nen Chat mit Indy Clients machen. Kann mir jemand sagen, wie ich TForm durch Buffer oder ähnliches durch das Netz kriege, oder ob das außer durch nen String unmöglich ist?!?!

Danke im Vorraus
JJJ666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20

Win XP

BeitragVerfasst: Mi 05.11.03 17:09 
hmm warum willste ne TForm verschicken?is bei einem chat doch total unsinnig oder?

cya JJJ

_________________
Nicht denken, wissen!
kad_we Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78


D6; Turbo Delphi 2006
BeitragVerfasst: Do 06.11.03 18:11 
naja ist gar nicht so unsinnig, denn die Clients sollen auch in verschiedenen Farben und schriftgrößen schreiben können...
ausserdem müsste ich auch noch andere komponenten versenden,aber das geht wohl scheinbar nicht...
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Do 06.11.03 19:10 
übertrag dir doch einfach ein kommando das dir sagt, wie du die schriftgrösse und die frabe darstellen musst....

_________________
In the beginning was the word.
And the word was content-type: text/plain.
kad_we Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78


D6; Turbo Delphi 2006
BeitragVerfasst: Fr 07.11.03 09:41 
naja toll und kannst du mir sagen, wie ich die eigenschaft style verschicken soll??? das klappt nämlich nicht... hab auch schon den Admin an unserer Schule gefragt, aber der weiß auch keinen Rat... gibt es wirklich keine Lösung, ausser einen String zu senden???
Ex0rzist
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 550

Win XP Prof.
Mandrake 10.0

D6
BeitragVerfasst: Fr 07.11.03 12:33 
Das ist doch vollkommen ausreichend.

Du musst dir nur eine Prozedur schreiben, die den String auswertet und dann den entsprechenden Style setzt.
kad_we Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78


D6; Turbo Delphi 2006
BeitragVerfasst: Fr 07.11.03 12:52 
nein ist es nicht! gibt es nun eine andere Lösung, oder nicht???
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Fr 07.11.03 13:41 
Herr Gott nochmal, du bist aber ungeduldig. Es gibt dafür keine 2-Sekunden-Klick-Zusammen-Lösung. Du wirst schon ein wenig Energie und Schmalz investieren müssen. Natürlich gibt es andere Lösungen, als einen String senden, aber auch bei denen fällt Arbeit an.

Exorzist und Matze haben dir bereits einen Lösungsweg aufgezeigt, wenn du nicht weisst, wie du denn umsetzen sollst, kannst du ja danach fragen, und viele werden dir mit großem Vergnügen helfen. Aber einfach nur patzig "Reicht mir nicht, ich will nicht eine halbe Stunde coden!" brüllen bringt es doch nicht.

Cu,
Udontknow
kad_we Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78


D6; Turbo Delphi 2006
BeitragVerfasst: Fr 07.11.03 14:00 
naja ist mir schon klar... tut mir leid, aber kann man das realisieren???
ixtreme
Gast
Erhaltene Danke: 1



BeitragVerfasst: Fr 07.11.03 14:05 
ich verstehe hier echt das Problem nicht...

Du kannst doch das Aussehen des Clients durch die Verarbeitund von Strings ändern....

ansonsten muss der Client halt eine Komplette Datei empfangen die du vorher losschickst....Aber den Aufwand würde ich nicht auf mich nehmen, denn du musst ja dann die Datei zur Laufzeit compilieren und linken....

Gruß

ixtreme.de
kad_we Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78


D6; Turbo Delphi 2006
BeitragVerfasst: Fr 07.11.03 14:12 
aber es ist versammt kompliziert... gab es bis jetzt noch niemanden, der sich mal ausgiebig gedanken gemacht hat?
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Fr 07.11.03 15:04 
Wie wäre es denn, wenn du den Inhalt einer Richtext-Komponente verschickst und sie auf der Empfängerseite zum Inhalt eines Empfangs-Richtext-Editfeldes hinzufügst?. Schliesslich beinhaltet das RTF schon alle möglichen Formatierungen.

Cu,
Udontknow
kad_we Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78


D6; Turbo Delphi 2006
BeitragVerfasst: Fr 07.11.03 15:14 
meinst du, dass ein formatstring und nicht ein "normaler" string gesendet wird?
Sorryman
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52



BeitragVerfasst: Sa 08.11.03 13:59 
Mach es einfach mit nem String! Ist wohl die einfachste und schnellste Lösung.

Moderiert von user profile iconTino: Satz entfernt. Bitte sachlich bleiben!
kad_we Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78


D6; Turbo Delphi 2006
BeitragVerfasst: Sa 08.11.03 15:05 
@ sorryman gut, wenn du nett bist, schreib mir doch einfach 2 funktionen: in der einen übergibt man nen String und bekommt nen TFont raus und umgekehrt...
kongreddgrass
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 238

Win 98, Win 2000, Win Xp Prof.,Linux 8.2 Prof
Delphi 6
BeitragVerfasst: Sa 08.11.03 15:55 
Hi,
wieso machst du es mit der Schriftgröße und Style nicht so wie in dem DF?
Also So :
Man klcikt Schrift Arial an (nachher <Schrift:Arial>Hallo was machst du?</schrift>

Der Empfängerprogramm sucht den Text nach solchen Zeichen ab <...>
Je nachdem was es bedeutet setzt er beim Empfang alles um Schrift, Style...

Wäre doch die einfachste Lösung, or?

_________________
o.o
kad_we Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78


D6; Turbo Delphi 2006
BeitragVerfasst: So 09.11.03 16:07 
naja hab mir nun doch schon was eigenes ausgedacht. wird schon gehen, aber danke nochmal an alle

soll ich den sourcecode mal ins netz stellen?
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 10.11.03 09:43 
kad_we hat folgendes geschrieben:
soll ich den sourcecode mal ins netz stellen?

Einfach hier ins Forum posten. Das reicht! Danke!

Gruß
Tino
kad_we Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78


D6; Turbo Delphi 2006
BeitragVerfasst: Mo 10.11.03 11:39 
sooo. ist zwar nicht perfekt, aber es funktioniert....

verbesserungswünsche sind erwünscht

ausblenden volle Höhe 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:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
FUNCTION FonttoStr(Fonteinstellung: TFont): STRING;

VAR i: Integer;
    temps: STRING;

BEGIN
  temps := ColortoString(Fonteinstellung.Color)+ chr(13) +
  nulldran(Fonteinstellung.Size) + chr(13) + Fonteinstellung.Name;
  IF Fonteinstellung.Style = [fsBold] THEN  i := 1;
  IF Fonteinstellung.Style = [fsItalic] THEN i := 2 ELSE
  IF Fonteinstellung.Style = [fsUnderline] THEN i := 3 ELSE
  IF Fonteinstellung.Style = [fsStrikeOut] THEN i := 4 ELSE
  IF Fonteinstellung.Style = [fsBold, fsItalic] THEN i := 5 ELSE
  IF Fonteinstellung.Style = [fsBold, fsUnderline] THEN i := 6 ELSE
  IF Fonteinstellung.Style = [fsBold, fsStrikeOut] THEN i := 7 ELSE
  IF Fonteinstellung.Style = [fsItalic, fsUnderline] THEN i := 8 ELSE
  IF Fonteinstellung.Style = [fsItalic, fsStrikeOut] THEN i := 9 ELSE
  IF Fonteinstellung.Style = [fsUnderline, fsStrikeOut] THEN i := 10 ELSE
  IF Fonteinstellung.Style = [fsBold, fsItalic, fsUnderline] THEN i := 11 ELSE
  IF Fonteinstellung.Style = [fsBold, fsItalic, fsStrikeOut] THEN i := 12 ELSE
  IF Fonteinstellung.Style = [fsBold, fsUnderline, fsStrikeOut] THEN i := 13 ELSE
  IF Fonteinstellung.Style = [fsItalic, fsUnderline, fsStrikeOut] THEN i := 14 ELSE
  IF Fonteinstellung.Style = [fsBold, fsItalic, fsUnderline, fsStrikeOut] THEN i := 15;
  temps := temps + chr(13) + nulldran(i)+ chr(13);
  FonttoStr := temps;
END;

FUNCTION strtofont(fontstring: STRING): TFont;
VAR font: TFont;
    temps: string;
    i: Integer;
BEGIN
 font := Tfont.Create;
 temps := fontstring;
 font.Color := stringtocolor(copy(temps,0,search4chr(chr(13),temps)-1));
 delete(temps,1,search4chr(chr(13),temps));
 font.Size := strtoint(copy(temps,0,search4chr(chr(13),temps)-1));
 delete(temps,1,search4chr(chr(13),temps));
 font.Name := copy(temps,0,search4chr(chr(13),temps)-1);
 delete(temps,1,search4chr(chr(13),temps));
 i := strtoint(copy(temps,0,search4chr(chr(13),temps)-1));
 CASE i OF
  1: font.Style := [fsBold];
  2: font.Style := [fsItalic];
  3: font.Style := [fsUnderline];
  4: font.Style := [fsStrikeOut];
  5: font.Style := [fsBold, fsItalic];
  6: font.Style := [fsBold, fsUnderline];
  7: font.Style := [fsBold, fsStrikeOut];
  8: font.Style := [fsItalic, fsUnderline];
  9: font.Style := [fsItalic, fsStrikeOut];
 10: font.Style := [fsUnderline, fsStrikeOut];
 11: font.Style := [fsBold, fsItalic, fsUnderline];
 12: font.Style := [fsBold, fsItalic, fsStrikeOut];
 13: font.Style := [fsBold, fsUnderline, fsStrikeOut];
 14: font.Style := [fsItalic, fsUnderline, fsStrikeOut];
 15: font.Style := [fsBold, fsItalic, fsUnderline, fsStrikeOut];
 END;
 strtofont := font;
END;


achja mit case hats leider nicht geklappt...(fonttostr)

mfg kad_we
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Mo 10.11.03 12:38 
Du willst eine kompklette beschreibung von einer TForm ableitung? ...Kein problem! Streams, strings alles machbar! Vollautomatische instanzierung ist auch mit dabei :wink: :

ausblenden volle Höhe 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:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
unit mxService;

interface

uses classes, sysUtils, TypInfo;   


function SaveCompoToStream(aCompo : TComponent; aStream: TSTream; asBinary: Boolean = false): boolean;
function LoadCompoFromStream(aCompo : TComponent; aStream: TSTream; asBinary: Boolean = false): boolean;


implementation


function SaveCompoToStream(aCompo : TComponent; aStream: TSTream; asBinary: Boolean = false): boolean;
var Stream1:TMemoryStream;
    format : TStreamOriginalFormat;
begin
  result := false;
  format  := sofText;
  Stream1 := TMemoryStream.Create;
  try
    Stream1.WriteComponent(aCompo);
    Stream1.Position := 0;
    if not asBinary then
    begin
      format := sofText;
      ObjectBinaryToText(Stream1,aStream,format);
    end else Stream1.SaveToStream(aStream);    
    result := true;
  finally
    Stream1.Free;    
  end;
end;


function LoadCompoFromStream(aCompo : TComponent; aStream: TSTream; asBinary: Boolean = false): boolean;
var FileStream:TFileStream;
    MemoryStream:TMemoryStream;
    format:TStreamOriginalFormat;
begin
  result := false;   
  MemoryStream := TMemoryStream.Create;   
  try
    if not asBinary then
    begin
      format := sofBinary;
      ObjectTextToBinary(aStream,MemoryStream,format);
    end else MemoryStream.LoadFromStream(aStream);
    MemoryStream.Position := 0;     
    MemoryStream.ReadComponent(aCompo);
    result := true;
  finally               
    MemoryStream.Free;
  end;
end;
                  
end.


Diese unit ermöglicht es die DFM daten via stream zu lesen und zu schreiben.

Ein testProg:

ausblenden volle Höhe 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:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, mxService, StdCtrls;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}   

procedure TForm1.Button1Click(Sender: TObject);
var ss:TStringStream;  
    s:String;  
begin
  ss:=TStringStream.Create(s);
  try
    SaveCompoToStream(self,ss,false); // beim übertragen ins netz 'asbinary=true' weil kleiner!
    Memo1.Text := ss.DataString;
  finally
    ss.Free;
  end;      
end;

end.


Hoffe das überfordert dich nicht...aber du hast danach gefragt :wink: ...vorraussetzung ist natürlich, das die gegenseite die form-klasse kennt, sonnst müsstest du noch packages übertragen und diese dann dynamisch linken.

mfg. maximus.

_________________
mfg.
mâximôv