home *** CD-ROM | disk | FTP | other *** search
- program Beispiel9;
-
- uses GDecl,
- GEvent,
- GViews,
- GDlg,
- GApp,
- Graph;
-
-
- const cmStandard = 101;
-
- type TApplication=object(TApp)
- procedure SetDesktopFrame(Titel:string);virtual;
- procedure SetDesktopBackground; virtual;
- procedure InitMenuBar; virtual;
- procedure HandleEvent; virtual;
- procedure NewWindow;
- end;
-
- PNewDTBgrd=^TNewDTBgrd;
- TNewDTBgrd=object(TDsktpBgrd)
- procedure Draw;virtual;
- end;
-
- var MyProg:TApplication;
-
- {Implementation TApplication}
-
- procedure TApplication.SetDesktopFrame(Titel:string);
- var R:TRect;
- begin
- with Desktop^ do
- begin
- GetBounds(R);
- Frame:=new(PFrame, Init(R,R,Titel,winDouble+winPanel+winMenu));
- Frame^.Palette:=Palette1;
- List^.InsertItem(Frame);
- end;
- end;
-
- procedure TApplication.SetDesktopBackground;
- var R:TRect;
- NBgrd:PNewDTBgrd;
- begin
- with Desktop^ do
- begin
- R:=Frame^.Area;
- NBgrd:=new(PNewDTBgrd, Init(R));
- NBgrd^.Palette[7]:=#14;
- NBgrd^.Palette[8]:=#7;
- List^.InsertItem(NBgrd);
- end;
- end;
-
- procedure TApplication.InitMenuBar;
- begin
- Palette[1]:=#14;
- Palette[5]:=#14;
- Palette[4]:=#4;
- Palette[12]:=#4;
- MainMenu('~F~enster',0);
- SubMenu('~S~tandard-Fenster',cmStandard,0,0,false,false);
- SubMenu('E~x~it Alt-X',cmCloseApplication,0,altX,false,false);
- end;
-
- procedure TApplication.HandleEvent;
- begin
- Heap^.ShowHeapStatus(523,8,White);
- TProgram.HandleEvent;
- case Event.Command of
- cmStandard : NewWindow;
- end; {case}
- end;
-
-
- procedure TApplication.NewWindow;
- var R:TRect;
- Window:PWindow;
- begin
- R.Assign(60,80,440,280);
- Window:=new(PWindow, Init(R,'Beispiel 9 : Window',winDouble+winPanel+winMenu+winKey));
- InsertDesktop(Window);
- end;
-
-
- {Implementation TNewDTBgrd}
-
- procedure TNewDTBgrd.Draw;
- begin
- with Border do
- begin
- SetFillStyle(SolidFill,GetPalColor(7));
- Bar(A.x,A.y,B.x,A.y+20);
- SetFillStyle(SolidFill,GetPalColor(8));
- Bar(A.x,A.y+22,B.x,B.y);
- end;
- end;
-
-
- begin
- MyProg.Init('Beispiel 9');
- MyProg.Run;
- MyProg.Done;
- end.