home *** CD-ROM | disk | FTP | other *** search
/ Best of German Only 1 / romside_best_of_german_only_1.iso / wissen / dos / wgraph / entpack.exe / WGBSP!.EXE / BSP4.PAS < prev    next >
Pascal/Delphi Source File  |  1992-12-01  |  1KB  |  67 lines

  1. program Beispiel4;
  2.  
  3. uses GApp,
  4.      GDecl,
  5.      GViews,
  6.      graph;
  7.  
  8. type TApplication=object(TApp)
  9.        procedure SetDesktopFrame(Titel:string);virtual;
  10.        procedure SetDesktopBackground; virtual;
  11.      end;
  12.  
  13.      PNewDTBgrd=^TNewDTBgrd;
  14.      TNewDTBgrd=object(TDsktpBgrd)
  15.        procedure Draw;virtual;
  16.      end;
  17.  
  18. var MyProg:TApplication;
  19.  
  20. {Implementation TApplication}
  21.  
  22. procedure TApplication.SetDesktopFrame(Titel:string);
  23. var R:TRect;
  24. begin
  25.   with Desktop^ do
  26.    begin
  27.      GetBounds(R);
  28.      Frame:=new(PFrame, Init(R,R,Titel,winDouble+winPanel+winMenu));
  29.      Frame^.Palette:=Palette1;
  30.      List^.InsertItem(Frame);
  31.    end;
  32. end;
  33.  
  34. procedure TApplication.SetDesktopBackground;
  35. var R:TRect;
  36.     NBgrd:PNewDTBgrd;
  37. begin
  38.   with Desktop^ do
  39.    begin
  40.      R:=Frame^.Area;
  41.      NBgrd:=new(PNewDTBgrd, Init(R));
  42.      NBgrd^.Palette[7]:=#14;
  43.      NBgrd^.Palette[8]:=#10;
  44.      List^.InsertItem(NBgrd);
  45.    end;
  46. end;
  47.  
  48.  
  49. {Implementation TNewDTBgrd}
  50.  
  51. procedure TNewDTBgrd.Draw;
  52. begin
  53.   with Border do
  54.    begin
  55.      SetFillStyle(SolidFill,GetPalColor(7));
  56.      Bar(A.x,A.y,B.x,A.y+20);
  57.      SetFillStyle(HatchFill,GetPalColor(8));
  58.      Bar(A.x,A.y+22,B.x,B.y);
  59.    end;
  60. end;
  61.  
  62.  
  63. begin
  64.   MyProg.Init('Beispiel 4');
  65.   MyProg.Run;
  66.   MyProg.Done;
  67. end.