Autor Beitrag
Mitmischer 1703
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Mo 07.09.09 18:07 
Hi DF!

Ich habe hier zwei böse RichEdits, die nicht tun was ich will. Ich will, dass beide das ganze Formular einnehmen (nach Größenänderung) und die Kanten dabei aneinander stoßen, d. h. jedes RichEdit bekommt 50% des Platzes. Nur leider funzt das nicht. Hier mein Code :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
with Input, Output do
  begin
    Top := 0;
    Width := MainForm.ClientWidth div 2;
  end;
  Output.Left := Width;


Könnt ihr mir helfen?

_________________
Die Lösung ist nicht siebzehn.
FinnO
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1331
Erhaltene Danke: 123

Mac OSX, Arch
TypeScript (Webstorm), Kotlin, Clojure (IDEA), Golang (VSCode)
BeitragVerfasst: Mo 07.09.09 18:30 
da könnte man mit Constraints arbeiten... bei dem einen alles außer left, bei dem anderen alles außer right fixen.
Mitmischer 1703 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Mo 07.09.09 19:37 
Okay, jetz sieht das ganze so aus.

Alles wunderbar, aber die Grenze zwischen In- und Output ist nicht mittig! Input hat vieeeel zu wenig Platz. Wie kann ich das fixen?
Einloggen, um Attachments anzusehen!
_________________
Die Lösung ist nicht siebzehn.
FinnO
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1331
Erhaltene Danke: 123

Mac OSX, Arch
TypeScript (Webstorm), Kotlin, Clojure (IDEA), Golang (VSCode)
BeitragVerfasst: Mo 07.09.09 19:39 
naja, wenn du am Anfang beides in der Mitte ausgerichtet hast... Ansonsten Die Constraints vertauschen?! zeig mal deine Einstellungen.
Mitmischer 1703 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Mo 07.09.09 19:40 
Welche?

Input und Output alle Anchors an?

Mit einmal Rechts und einmal Links hatte ich kein Glück

_________________
Die Lösung ist nicht siebzehn.
FinnO
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1331
Erhaltene Danke: 123

Mac OSX, Arch
TypeScript (Webstorm), Kotlin, Clojure (IDEA), Golang (VSCode)
BeitragVerfasst: Mo 07.09.09 19:51 
*nachdenk*

kommst wohl doch nicht um ein "OnResize" Event drum rum.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
  Input.Width := Clientwidth div 2;
  
  Output.Left := Input.Width + Distance;
  Output.Width := Input.Width - Distance - DistanceRight;
Mitmischer 1703 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Mo 07.09.09 19:53 
Sieht gut aus :zustimm:

Aber was ist DistanceRight?

_________________
Die Lösung ist nicht siebzehn.
Mitmischer 1703 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Mo 07.09.09 19:56 
Klappt! Danke!

_________________
Die Lösung ist nicht siebzehn.
FinnO
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1331
Erhaltene Danke: 123

Mac OSX, Arch
TypeScript (Webstorm), Kotlin, Clojure (IDEA), Golang (VSCode)
BeitragVerfasst: Mo 07.09.09 20:04 
DistancRight ist der Abstand zum rechten Formularrand...
SvenAbeln
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 334
Erhaltene Danke: 3



BeitragVerfasst: Di 08.09.09 13:06 
user profile iconMitmischer 1703 hat folgendes geschrieben Zum zitierten Posting springen:
[...] d. h. jedes RichEdit bekommt 50% des Platzes. Nur leider funzt das nicht. Hier mein Code :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
with Input, Output do
  begin
    Top := 0;
    Width := MainForm.ClientWidth div 2;
  end;
  Output.Left := Width;

Bei dir wird nur einem ReichEdits eine neue Breite zugewiesen. Output bekommt eine neue Breite aber Input bleibt unverändert.

Ein with mit zwei Objekten bearbeitet nicht beide Objekte auf einmal, sondern es wird so interpretiert:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
with Input do
  with Output do
    begin
      Top := 0; 
      Width := MainForm.ClientWidth div 2;    // width von Output.
[...]
Mitmischer 1703 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Di 08.09.09 15:37 
:oops: Oh

Naja, zumindest was für Delphi 10 xD

_________________
Die Lösung ist nicht siebzehn.