home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / HISPEED2.LZH / GEMDEMO / GEMDEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1991-07-02  |  2KB  |  56 lines

  1. {----------------------------------------------------------------------
  2.                      HighSpeed Pascal GEM Demo Program
  3.  
  4.                               version 1.24a
  5.  
  6.                      Copyright (c) 1990 D-House I Aps
  7.                              Transformervej 29
  8.                               DK-2730 Herlev
  9.                                   Denmark
  10.                           Phone (+45) 44 53 99 84
  11.                           Fax   (+45) 44 53 95 44
  12.  
  13.                       Programmed by Martin Eskildsen
  14. ----------------------------------------------------------------------}
  15.  
  16. {$D+}
  17.  
  18. program GEM_Demo;
  19.  
  20. uses GemDecl, GemAES, GemVDI, DemoInterface, DemoMenu, DemoWindows,
  21.      DemoGraphs;
  22.  
  23. { Wait for events to be present and take appropriate action }
  24. { pipe[3] holds the handle in case of window events         }
  25. procedure Dispatch;
  26. var
  27.   pipe : array [0..15] of integer;   { message pipe }
  28. begin
  29.   repeat
  30.     evnt_mesag(pipe);         { wait for an event... }
  31.     case pipe[0] of           { take action          }
  32.       MN_SELECTED  : HandleMenu   (pipe[3], pipe[4]);
  33.       WM_REDRAW    : RedrawWindow (pipe[3], pipe[4], pipe[5], pipe[6], pipe[7]);
  34.       WM_TOPPED    : TopWindow    (pipe[3]);
  35.       WM_CLOSED    : CloseWindow  (pipe[3]);
  36.       WM_FULLED    : FullWindow   (pipe[3]);
  37.       WM_SIZED     : SizeWindow   (pipe[3], pipe[6], pipe[7]);
  38.       WM_MOVED     : MoveWindow   (pipe[3], pipe[4], pipe[5])
  39.     end
  40.   until quit;
  41.   CloseTopWindow;    { make sure, the windows are closed }
  42.   CloseTopWindow
  43. end;
  44.  
  45. begin  { main program }
  46.   if Init_Gem then begin        { initialize                    }
  47.     graf_mouse(ARROW, NIL);     { arrow mouse form              }
  48.     Init_Resource;              { load and set up resources     }
  49.     MakeGraphData;              { set up data for graphics demo }
  50.     Dispatch;                   { handle the events until quit  }
  51.     End_Resource;               { remove resources              }
  52.     End_Gem                     { end GEM usage                 }
  53.   end
  54.   else FatalError('Could not initialize GEM properly!')
  55. end.
  56.