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

  1. (* ------------------------------------------------------ *)
  2. (*                      RES2.PAS                          *)
  3. (*       Demonstration der Verwendung von Ressourcen      *)
  4. (*             (c) 1993 te-wi Verlag, München             *)
  5. (* ------------------------------------------------------ *)
  6. PROGRAM Res2;
  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.     DESTRUCTOR  Done; VIRTUAL;
  18.   END;
  19.  
  20. VAR
  21.   ResFile : tResourceFile;
  22.  
  23.   CONSTRUCTOR tAnApp.Init;
  24.   BEGIN
  25.     RegisterMenus;
  26.     RegisterObjects;
  27.     RegisterViews;
  28.     RegisterApp;
  29.     inherited Init;
  30.   END;
  31.  
  32.   PROCEDURE tAnApp.InitMenuBar;
  33.   BEGIN
  34.     ResFile.Init(New(pBufStream, Init('RES1.RES', stOpenRead, 1024)));
  35.     MenuBar := pMenuBar(ResFile.Get('APPMENU'));
  36.   END;
  37.  
  38.   DESTRUCTOR tAnApp.Done;
  39.   BEGIN
  40.     ResFile.Done;
  41.     inherited Done;
  42.   END;
  43.  
  44. VAR
  45.   AnApp : tAnApp;
  46.  
  47. BEGIN
  48.   AnApp.Init;
  49.   AnApp.Run;
  50.   AnApp.Done;
  51. END.
  52. (* ------------------------------------------------------ *)
  53. (*                 Ende von RES2.PAS                      *)
  54.  
  55.