home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / das_buch / tvision / demoapp / res4.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1993-05-03  |  1.4 KB  |  63 lines

  1. (* ------------------------------------------------------ *)
  2. (*                      RES4.PAS                          *)
  3. (*       Demonstration der Verwendung von Ressourcen      *)
  4. (*             (c) 1993 te-wi Verlag, München             *)
  5. (* ------------------------------------------------------ *)
  6. PROGRAM Res4;
  7.  
  8. {$A+,B-,D+,E+,F-,G-,I+,L+,N-,O-,P-,Q+,R+,S+,T-,V+,X+,Y+}
  9. {$M 16384,0,655360}
  10.  
  11. USES Objects, Drivers, Views, Menus, App;
  12.  
  13. TYPE
  14.   tAnApp = OBJECT (tApplication)
  15.     CONSTRUCTOR Init;
  16.     PROCEDURE   InitMenuBar;    VIRTUAL;
  17.     PROCEDURE   InitStatusLine; VIRTUAL;
  18.     DESTRUCTOR  Done;           VIRTUAL;
  19.   END;
  20.  
  21. VAR
  22.   ResFile : tResourceFile;
  23.  
  24.   CONSTRUCTOR tAnApp.Init;
  25.   BEGIN
  26.     RegisterMenus;
  27.     RegisterObjects;
  28.     RegisterViews;
  29.     RegisterApp;
  30.     ResFile.Init(New(pBufStream, Init('RES1.RES', stOpenRead, 1024)));
  31.  
  32.     inherited Init;
  33.   END;
  34.  
  35.   PROCEDURE tAnApp.InitMenuBar;
  36.   BEGIN
  37.     MenuBar := pMenuBar(ResFile.Get('APPMENU'));
  38.   END;
  39.  
  40.   PROCEDURE tAnApp.InitStatusLine;
  41.   BEGIN
  42.     StatusLine := pStatusLine(ResFile.Get('STATLINE'));
  43.   END;
  44.  
  45.   DESTRUCTOR tAnApp.Done;
  46.   BEGIN
  47.     ResFile.Done;
  48.     inherited Done;
  49.   END;
  50.  
  51. VAR
  52.   AnApp : tAnApp;
  53.  
  54. BEGIN
  55.   AnApp.Init;
  56.   AnApp.Run;
  57.   AnApp.Done;
  58. END.
  59. (* ------------------------------------------------------ *)
  60. (*                  Ende von RES4.PAS                     *)
  61.  
  62.  
  63.