Autor Beitrag
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mi 26.10.05 13:42 
Ich denke der Herr meinte die von mir geposteten Units ;)
Cain Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 32

Win 2000, Win ME, Win XP
Delphi 5
BeitragVerfasst: Mi 26.10.05 14:26 
Herr von und zu Muetze.
Ich muss keine Fehlerbeschreibung abgeben, da ich keine Fehler habe.
Ich brauche halt nur nen Stück Quelltext wo verschiedene Sachen auf verschiedenen Monitoren angezeigt werden.
Und das steht hier schon nen Dutzendmal drin, aber wer nicht lesen kann....

So in der Art müßte das ungefähr aussehen

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
PROCEDURE TMonVerteilen;
VAR
  i : integer;
BEGIN
  FOR i := 0 TO Screen.MonitorCount -1 DO
  BEGIN
    MyFrames[i]:= TMonFrame.Create(Self, 'Monitor ' + IntToStr(i));
    PlaceFormOnMonitor(MyFrames[i], i);
  END;
END;

procedure PlaceFormOnMonitor(MonFrame: TFrame; MonitorNum: Integer);
var
  r: TRect;
begin
  r:= Screen.Monitors[MonitorNum].WorkareaRect;
  MonFrame.SetBounds(r.Left, r.Top, r.Right - r.Left, r.Bottom - r.Top);
end;
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Mi 26.10.05 14:40 
Mit Frames geht das nicht, du musst schon Forms nehmen. Ein Frame kann immer nur auf einem Form liegen, nicht selbst als Fenster angezeigt werden.

Stefan
Cain Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 32

Win 2000, Win ME, Win XP
Delphi 5
BeitragVerfasst: Mi 26.10.05 14:54 
Ich bin froh, dass ich Frames dynamisch erzeugen kann.
Geht das bei Forms genauso?
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Mi 26.10.05 14:55 
user profile iconCain hat folgendes geschrieben:
Ich bin froh, dass ich Frames dynamisch erzeugen kann.
Geht das bei Forms genauso?

was glaubst du was der code von mütze1 gemacht hat ?

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Cain Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 32

Win 2000, Win ME, Win XP
Delphi 5
BeitragVerfasst: Mi 26.10.05 14:57 
user profile iconretnyg hat folgendes geschrieben:
user profile iconCain hat folgendes geschrieben:
Ich bin froh, dass ich Frames dynamisch erzeugen kann.
Geht das bei Forms genauso?

was glaubst du was der code von mütze1 gemacht hat ?


Die Original Form auf allen drei Monitoren anzeigen.
Ich will aber auf jedem ne andere.
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Mi 26.10.05 14:59 
Ja, klar - der Code, den Muetze1 gepostet hat, tut das doch.

Stefan
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Mi 26.10.05 15:00 
user profile iconCain hat folgendes geschrieben:

Die Original Form auf allen drei Monitoren anzeigen.
Ich will aber auf jedem ne andere.

ne, er createt eine form pro schirm.

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Cain Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 32

Win 2000, Win ME, Win XP
Delphi 5
BeitragVerfasst: Mi 26.10.05 15:02 
user profile iconStefan.Buchholtz hat folgendes geschrieben:
Ja, klar - der Code, den Muetze1 gepostet hat, tut das doch.

Stefan


Tut er nicht.
Der Code von Muetze zeigt Form1 auf allen x Monitoren an, aber ich will dynamisch erzeugte Forms haben.

Muetze hätte das ausgegeben:
Monitor[1] zeigt Form1
Monitor[2] zeigt Form1
etc....

Ich will aber das so haben:

Monitor[1] zeigt Form3
Monitor[2] zeigt Form1
Monitor[3] zeigt Form2
oder so....
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Mi 26.10.05 15:05 
Ohne auf die meiner Ansicht nach kriminelle with *.Create - Konstruktion einzugehen...

Das Stück Code erzeugt 3 eigenständige TForm-Instanzen auf 3 Monitoren. Die zeigen natürlich bei unverändertem Code das selbe, nämlich nichts, an. Da ist aber deiner Kreativität freien Lauf gelassen, in die Forms was nettes reinzusetzen, wie Frames z.B.

_________________
Bravery calls my name in the sound of the wind in the night...
Cain Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 32

Win 2000, Win ME, Win XP
Delphi 5
BeitragVerfasst: Mi 26.10.05 15:05 
user profile iconretnyg hat folgendes geschrieben:
user profile iconCain hat folgendes geschrieben:

Die Original Form auf allen drei Monitoren anzeigen.
Ich will aber auf jedem ne andere.

ne, er createt eine form pro schirm.


Was glaubst du, was er mit der entsprechenden Zeile kreiert???

ausblenden Delphi-Quelltext
1:
With TForm.Create(Self) Do					


Er erstellt das eigentliche Formular (Self) auf allen Monitoren.....
Woher sollte er auch andere Forms haben? Herzaubern?
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Mi 26.10.05 15:08 
Besuch mal einen Grundkurs Delphi... Seitwann Generiert man mit TForm.Create( self ) eine neue Instanz von self???

_________________
Bravery calls my name in the sound of the wind in the night...
Cain Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 32

Win 2000, Win ME, Win XP
Delphi 5
BeitragVerfasst: Mi 26.10.05 15:10 
user profile iconnoidic hat folgendes geschrieben:
Besuch mal einen Grundkurs Delphi... Seitwann Generiert man mit TForm.Create( self ) eine neue Instanz von self???


Tut es ja eben nicht.
Das ist ja mein Problem....
Das Programm soll pro Monitor eine neue Form ausgeben....
Der Quelltext von Mütze nützt dafür nichts.
Weder ändert sich die Caption, noch Passt sich das dem Monitor an (müßte ja maximiert sein) noch ist der Index richtig, weil der Counter nur bis eine Zahl unter dem MonCount laufen darf.
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Mi 26.10.05 15:13 
user profile iconCain hat folgendes geschrieben:
user profile iconStefan.Buchholtz hat folgendes geschrieben:
Ja, klar - der Code, den Muetze1 gepostet hat, tut das doch.

Stefan


Tut er nicht.
Der Code von Muetze zeigt Form1 auf allen x Monitoren an, aber ich will dynamisch erzeugte Forms haben.

Muetze hätte das ausgegeben:
Monitor[1] zeigt Form1
Monitor[2] zeigt Form1
etc....

Ich will aber das so haben:

Monitor[1] zeigt Form3
Monitor[2] zeigt Form1
Monitor[3] zeigt Form2
oder so....


Das sollte mit den ganzen bis jetzt geposteten Beispielen und Erklärungen wirklich kein Problem mehr sein:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
  Form1 := TForm1.create(nil);  
  Form2 := TForm2.Create(nil);
  Form3 := TForm3.Create(nil);
  
  PlaceFormOnMonitor(Form3, 0);
  PlaceFormOnMonitor(Form1, 1);
  PlaceFormOnMonitor(From2, 2);


Nach der ganzen Diskussion würde ich sagen, dir fehlen noch ein paar Delphi-Grundlagen - vielleicht solltest du dir mal einige Tutorials anschauen oder ein gutes Delphi-Buch besorgen.

Stefan
Cain Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 32

Win 2000, Win ME, Win XP
Delphi 5
BeitragVerfasst: Mi 26.10.05 15:16 
Wir nähern uns der Sache.
Nur leider ist das nicht dynamisch....

Außerdem kann das gar nicht so einfach sein, wenn immer noch keiner von euch, das herausgefunden hat, wie es aussehen sollte.

Auf falsche Fährten bin ich schon von alleine gekommen.
Nur der richtige Weg ist mir, wie keinem von euch, bisher nicht eingefallen.


So klappt es zum Beispiel leider nicht um die Sache dynamisch zu machen:
ausblenden Delphi-Quelltext
1:
2:
FOR i:= 0 TO Pred(Screen.MonitorCount) DO
  Format('Form%d', [i+1]):= Format('TForm%d', [i+1]).Create(NIL);


Dein PlaceFormOnMonitor war ja sonst ideal
Cain Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 32

Win 2000, Win ME, Win XP
Delphi 5
BeitragVerfasst: Mi 26.10.05 15:37 
Jetzt habe ich es fast....

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
PROCEDURE TMonVerteilen.FormCreate(Sender: TObject);
VAR
  i : integer;
BEGIN
  FOR i:= 0 TO Pred(Screen.MonitorCount) DO
  BEGIN
     MyForms[i+1]:= TMonitorForm.Create(Self, Format('Form%d', [i+1]));
     PlaceFormOnMonitor(MyForms[i], i);
  END;
END


Der Counter läuft zwar noch über aber das dürfte es gewesen sein....
Oder fällt jemanden noch ein gravierender Fehler auf?

Nun gut.
Danke jedenfalls schonmal für eure tatkräftige Hilfe.
Ich mach jetzt erstmal Feierabend....
Muetze1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 346



BeitragVerfasst: Mi 26.10.05 19:57 
user profile iconnoidic hat folgendes geschrieben:
Ohne auf die meiner Ansicht nach kriminelle with *.Create - Konstruktion einzugehen...


War nur als schnelles Beispiel gemacht - wollte da nun nicht noch extra Var's anlegen...

_________________
49 63 68 68 61 62 65 6B 65 69 6E 65 41 68 6E 75 6E 67 21
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Mi 26.10.05 23:09 
ich habe die Suche in: Delphi-Forum, Delphi-Library RETMONITORTOOLS gerade anhand der hier gewonnenen erkenntnisse von grund auf neugeschrieben.
wäre nett wenn jemand die unit testen könnte ;)

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...