Autor Beitrag
Niko S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: So 26.08.07 12:56 
Gibts ne möglichkeit wie ich einem Fenster sage, dass es IMMER über das andere steht?

Also z.b.

Form2 steht über Form1 und Form3 über Form2.
Geht sowas?
Killian2004
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72

Vista Business x64
Delphi 7 Ent. RAD Studio 2009
BeitragVerfasst: So 26.08.07 13:32 
Wenn Du nur 2 Formen hast, dann ist die Lösung trivial:
Ändere einfach das FormStyle-Property deiner zweiten Form.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm2.FormCreate(Sender: TObject);
begin
 Form2.FormStyle := fsStayOnTop;
end;


Dann bleibt die zweite Form immer vor der ersten.
Bei mehreren Formen funktioniert dies nicht. Da müsstest du ggf. überprüfen, welche Form den aktuellen Fokus hat und dementsprechend die Fenster neu ordnen (BringToFront / SendToBack);

mfG, Killian

_________________
Die Antwort ist 17, aber wie lautet die Frage?
Niko S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: So 26.08.07 14:52 
kann man den Fokus vllt Abstellen?
Also das wenn man auf ner Form klick die kein Fokus bekommt aber dennoch was drauf passiert?
Killian2004
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72

Vista Business x64
Delphi 7 Ent. RAD Studio 2009
BeitragVerfasst: So 26.08.07 15:40 
Das weiß ich nicht. Vermute aber, dass dies nicht funktioniert, da du ja mit der Maus auf der Form Ereignisse auslöst, wodurch WindowsMessages zum System geschickt werden.

Sowie du ein Ereignis in einem anderen Fenster auslöst, wird dieses ja automatisch aktiv, das begründet sich aber auf der "Funktionsweise" vom Betriebssystem.

Darf man fragen, wozu du das ganze machst? Reine Neugier... :-)
mfG, Killian

_________________
Die Antwort ist 17, aber wie lautet die Frage?
Niko S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: So 26.08.07 15:49 
Ich will ne art Clone von nem RPG machen in 2D.
Erstmal nur so ohne i-welche Grafik Engine.
Sobald das hablwegs gut klappt muss ich mirn paar Tuts besorgn für 2D mit DelphiX oder anderen Engines.

Nur ist hald das Problem:
Wie Realisieren ich die Layer?
Weil meine Figur ist ja in der Mitte sozusagen.
top2
top1
figuren
mask2
mask1
ground

Das halt zu Realisieren Faellt mir im moment Schwer ;(
Killian2004
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72

Vista Business x64
Delphi 7 Ent. RAD Studio 2009
BeitragVerfasst: So 26.08.07 16:08 
Dass dir das schwer fällt glaube ich sofort. Du hast aber für deine "Layer" auch eine denkbar ungünstige Variante gewählt. Viele Formen für ein Spiel übereinander zu stapeln ist sehr unperformant und birgt zudem noch einige Möglichkeiten für Konflikte (Kreisabhängigkeiten, etc.)

Warum zeichnest du nicht einfach deine Graphiken auf ein TCanvas Objekt? Das wird zwar bei weitem nicht so leistungsfähig wie ein hardware-unterstütztes (OpenGL, DX) Zeichnen der Graphiken, ist aber definitiv besser als deine jetzige Variante.

Dort teilst du deine Zeichenroutine einfach in mehrere Funktionen, die nacheinander in der richtigen Reihenfolge deine Features zeichnen. Denke, dass du mit der aktuellen Methode nicht lange Freude hast.

Für mehr Informationen zum TCanvas musst du aber jemand anderes fragen, da bin ich der falsche. Ich programmiere Graphisches, wenn überhaupt, via OpenGL.

mfG, Killian

_________________
Die Antwort ist 17, aber wie lautet die Frage?