home *** CD-ROM | disk | FTP | other *** search
- PROGRAM Gen_MDI3;
-
- USES WinTypes, WinProcs, OWindows;
-
- {$R Gen_MDI3.RES}
-
- CONST
- cm_CreateChild1 = 101;
- cm_CreateChild2 = 102;
-
- TYPE
- tMyApplication = OBJECT(tApplication)
- PROCEDURE InitMainWindow; VIRTUAL;
- END;
-
- pMyMDIWindow = ^tMyMDIWindow;
- tMyMDIWindow = OBJECT(tMDIWindow)
- FUNCTION cmCreateChild1: pWindowsObject;
- VIRTUAL cm_First + cm_CreateChild1;
- FUNCTION cmCreateChild2: pWindowsObject;
- VIRTUAL cm_First + cm_CreateChild2;
- END;
-
- pMyChild1 = ^tMyChild1;
- tMyChild1 = OBJECT(tWindow)
- PROCEDURE Paint(PaintDC: hDC; VAR PaintInfo: tPaintStruct); VIRTUAL;
- END;
-
- pMyChild2 = ^tMyChild2;
- tMyChild2 = OBJECT(tWindow)
- PROCEDURE Paint(PaintDC: hDC; VAR PaintInfo: tPaintStruct); VIRTUAL;
- END;
-
- PROCEDURE tMyChild1.Paint(PaintDC: hDC; VAR PaintInfo: tPaintStruct);
- BEGIN
- Rectangle(PaintDC, 10, 10, 100, 100);
- END;
-
- PROCEDURE tMyChild2.Paint(PaintDC: hDC; VAR PaintInfo: tPaintStruct);
- BEGIN
- Ellipse(PaintDC, 10, 10, 100, 100);
- END;
-
- FUNCTION tMyMDIWindow.cmCreateChild1: pWindowsObject;
- BEGIN
- cmCreateChild1 := Application^.MakeWindow(New(pMyChild1,
- Init(@Self, 'First MDI Child')));
- END;
-
- FUNCTION tMyMDIWindow.cmCreateChild2: pWindowsObject;
- BEGIN
- cmCreateChild2 := Application^.MakeWindow(New(pMyChild2,
- Init(@Self, 'Second MDI Child')));
- END;
-
- PROCEDURE tMyApplication.InitMainWindow;
- BEGIN
- MainWindow := New(pMyMDIWindow, Init('MDI Test Program 3',LoadMenu(hInstance, 'Generic')));
- END;
-
- VAR
- MyApp : tMyApplication;
-
- BEGIN
- MyApp.Init('MyProgram');
- MyApp.Run;
- MyApp.Done;
- END.
-