home *** CD-ROM | disk | FTP | other *** search
- PROGRAM Gen_MDI2;
-
- USES WinTypes, WinProcs, OWindows;
-
- {$R Gen_MDI.RES}
-
- TYPE
- tMyApplication = OBJECT(tApplication)
- PROCEDURE InitMainWindow; VIRTUAL;
- END;
-
- pMyMDIWindow = ^tMyMDIWindow;
- tMyMDIWindow = OBJECT(tMDIWindow)
- FUNCTION CreateChild: pWindowsObject; VIRTUAL;
- END;
-
- pMyChild = ^tMyChild;
- tMyChild = OBJECT(tWindow)
- PROCEDURE Paint(PaintDC: hDC; VAR PaintInfo: tPaintStruct); VIRTUAL;
- END;
-
- PROCEDURE tMyChild.Paint(PaintDC: hDC; VAR PaintInfo: tPaintStruct);
- BEGIN
- Rectangle(PaintDC, 10, 10, 100, 100);
- END;
-
- FUNCTION tMyMDIWindow.CreateChild: pWindowsObject;
- BEGIN
- CreateChild := Application^.MakeWindow(New(pMyChild,
- Init(@Self, 'New MDI Child')));
- END;
-
- PROCEDURE tMyApplication.InitMainWindow;
- BEGIN
- MainWindow := New(pMyMDIWindow, Init('MDI Test Program 2',LoadMenu(hInstance, 'Generic')));
- END;
-
- VAR
- MyApp : tMyApplication;
-
- BEGIN
- MyApp.Init('MyProgram');
- MyApp.Run;
- MyApp.Done;
- END.
-