diff options
Diffstat (limited to 'unit1.pas')
-rw-r--r-- | unit1.pas | 36 |
1 files changed, 29 insertions, 7 deletions
@@ -5,18 +5,22 @@ unit unit1; interface uses - Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, raetselFileUnit; + Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, + raetselunit; type - { TForm1 } + { tForm1 } - TForm1 = class(TForm) + tForm1 = class(tForm) procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure FormShow(Sender: TObject); private { private declarations } public { public declarations } + raetsel: tRaetsel; end; var @@ -29,15 +33,33 @@ implementation uses unit2; -{ TForm1 } +// tForm1 ********************************************************************** -procedure TForm1.FormCreate(Sender: TObject); +procedure tForm1.formCreate(sender: tObject); begin + application.createForm(tForm2, form2); case form2.showmodal of - mrBuchstabenraetsel: ; - mrHochhausraetsel: ; + mrBuchstabenraetsel: + raetsel:=tBuchstabenRaetsel.create(form1); + mrHochhausraetsel: + raetsel:=tHochhausRaetsel.create(form1); + else begin + raetsel:=nil; + application.terminate; + end; end; end; +procedure tForm1.FormDestroy(Sender: TObject); +begin + raetsel.free; +end; + +procedure tForm1.FormShow(Sender: TObject); +begin + if assigned(raetsel) then + raetsel.zeichnen; +end; + end. |