home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / PROG / PASCAL / SPEED2 / SAMPLES / PMSIMPLE / PMSIMPLE.PAS < prev   
Pascal/Delphi Source File  |  1994-10-06  |  2KB  |  139 lines

  1. PROGRAM PmSimple;
  2.  
  3. {***************************************************************************
  4. *                                                                          *
  5. *                Speed-Pascal/2 Sample program "PMSimple"                  *
  6. *                                                                          *
  7. *           (C) 1993,94 Rene Nürnberger. All rights reserved.              *
  8. *                                                                          *
  9. *                                                                          *
  10. *  This program is the simpliest Object-PM program possible                *
  11. *  It opens a PM-window and puts out the text "Hello world".               *
  12. *                                                                          *
  13. *                                                                          *
  14. ****************************************************************************}
  15.  
  16.  
  17.  
  18. USES PmObject,Crt;  {bind Units used}
  19.  
  20. TYPE TMyApplication=OBJECT(TApplication)
  21.                          CONSTRUCTOR Init;
  22.                          DESTRUCTOR Done;
  23.                          PROCEDURE DesktopRedraw(rc:RECTL;_hps:HPS;
  24.                                                  Win:HWND):VIRTUAL;
  25.                     END;
  26.  
  27. VAR
  28.    MyApp:TMyApplication;
  29.  
  30. {Implementation of the Methods}
  31. CONSTRUCTOR TMyApplication.Init;
  32. BEGIN
  33.      Inherited.Init;  {Eltern aufrufen}
  34. END;
  35.  
  36. DESTRUCTOR TMyApplication.Done;
  37. BEGIN
  38. END;
  39.  
  40. {This method is called by Object-PM whenever a WM_PAINT message occures}
  41. PROCEDURE TMyApplication.DesktopRedraw(rc:RECTL;_hps:HPS;Win:HWND);
  42. VAR pt:POINTL;
  43.     s:STRING;
  44. BEGIN
  45.      Inherited.DesktopRedraw(rc,_hps,Win);
  46.      pt.x:=50;
  47.      pt.y:=100;
  48.       s:='Hello world';
  49.      DrawStringXY(_hps,pt,s,1,length(s),CLR_BLUE,CLR_BACKGROUND);
  50. END;
  51.  
  52. BEGIN
  53.      MyApp.Init;
  54.      MyApp.Run(0,'PMSimple Demo Application',CLR_BLUE,CLR_WHITE);
  55.      MyApp.Done;
  56. END.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.