initial commit
[rofl0r-KOL.git] / demos / frames / Unit1.pas
blobd9076f1c9ca104a5adb17c1cf51d1dca5a65d189
1 { KOL MCK } // Do not remove this line!
2 {$DEFINE KOL_MCK}
3 unit Unit1;
5 interface
7 {$IFDEF KOL_MCK}
8 uses Windows, Messages, ShellAPI, KOL {$IFNDEF KOL_MCK}, mirror, Classes,
9 mckCtrls, Controls {$ENDIF};
10 {$ELSE}
11 {$I uses.inc}
12 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
13 mirror, mckCtrls;
14 {$ENDIF}
16 type
17 {$IFDEF KOL_MCK}
18 {$I MCKfakeClasses.inc}
19 PForm1 = ^TForm1;
20 TForm1 = object(TObj)
21 Form: PControl;
22 {$ELSE not_KOL_MCK}
23 TForm1 = class(TForm)
24 {$ENDIF KOL_MCK}
25 KOLProject1: TKOLProject;
26 KOLForm1: TKOLForm;
27 Panel1: TKOLPanel;
28 Button1: TKOLButton;
29 Button2: TKOLButton;
30 Panel2: TKOLPanel;
31 procedure Button1Click(Sender: PObj);
32 procedure Button2Click(Sender: PObj);
33 private
34 { Private declarations }
35 public
36 { Public declarations }
37 Frame: PObj;
38 end;
40 var
41 Form1 {$IFDEF KOL_MCK} : PForm1 {$ELSE} : TForm1 {$ENDIF} ;
43 {$IFDEF KOL_MCK}
44 procedure NewForm1( var Result: PForm1; AParent: PControl );
45 {$ENDIF}
47 implementation
49 uses Unit2;
51 {$IFNDEF KOL_MCK} {$R *.DFM} {$ENDIF}
53 {$IFDEF KOL_MCK}
54 {$I Unit1_1.inc}
55 {$ENDIF}
57 procedure TForm1.Button1Click(Sender: PObj);
58 begin
59 NewForm2( PForm2( Frame ), Panel2 );
60 end;
62 procedure TForm1.Button2Click(Sender: PObj);
63 begin
64 if Frame <> nil then
65 PForm2( Frame ).Form.Free;
66 end;
68 end.