Autor Beitrag
Sunus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 20



BeitragVerfasst: Mi 16.04.08 15:52 
Hi,
kann man irgend wie eine unit.pas zur Laufzeit compilieren?

Also ich meine das so:
Ich hab eine Form und da sind zwei Buttons drauf.
Der eine Button färbt den Hintergrund. Z.B. grün
ausblenden Unit1.pas
1:
2:
3:
4:
procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.Color:=clgreen;
end;

Jetzt hab ich eine zweite Unit wo
ausblenden Unit2.pas
1:
2:
3:
4:
procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.Color:=clred;
end;

steht.
Der zweite Button soll jetzt diese Unit Compiliren, so dass der erste Button dann rot färbt. Ist das irgendwie möglich?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 16.04.08 15:56 
Dann müsstest du den Compiler ja mitliefern. lagere die werte doch aus (Ini, XML, Registry, ...)

_________________
Markus Kinzler.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 16.04.08 15:58 
So ohne weiteres nicht. Was hast du denn in etwa vor? Wenn es um das bloße Anpassen der Form geht, kann man das auch anders lösen, indem man irgendwelche Parameter in geeigneten Dateien ablegt.

_________________
We are, we were and will not be.
Sunus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 20



BeitragVerfasst: Mi 16.04.08 16:03 
Eigentlich hab ich noch nichts vor. Hatte halt die Frage plotzlich im Kopf ob das irgendwie geht. Muss jetzt nicht unbedingt compiliert werden. Aber halt so mit den zwei Units.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 16.04.08 16:06 
Du könntest auch zur Laufzeit die Eventproperty umbiegen, aber in diesem Fall würde ich die werte vom Programm separieren.

_________________
Markus Kinzler.
Sunus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 20



BeitragVerfasst: Mi 16.04.08 16:10 
Sry, was? :oops:
Wie macht man Eventproperty umbiegen und werte vom Programm separieren?
Hab noch nie was davon gehört.
MAch einen neues Thema auf wenn ich nix finde.


Zuletzt bearbeitet von Sunus am Mi 16.04.08 16:31, insgesamt 1-mal bearbeitet
Sunus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 20



BeitragVerfasst: Mi 16.04.08 16:28 
Ups... falscher Button, sry :oops: :oops: :oops:
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 16.04.08 16:54 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm1.Button1Click(Sender: TObject);
begin
    Form1.Color:=clgreen;
end;

procedure TForm1.Button1Click2(Sender: TObject);
begin
    Form1.Color:=clRed;
end;

...

    Button1.onClick := Form1.Button1Click2;

_________________
Markus Kinzler.