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

  1. {-------------------------------------------------------------------------
  2.                 HighSpeed Pascal GEM-interface demo program
  3.  
  4.                              TEXT OUTPUT DEMO
  5.  
  6.                       Copyright (c) 1990 by D-House I
  7.                             All rights reserved
  8.  
  9.                       Programmed by Martin Eskildsen
  10. -------------------------------------------------------------------------}
  11. {$R-,S-,D+}
  12.  
  13. program Texts;
  14.  
  15. uses GemAES, GemVDI, GemDecl, GemInterface;
  16.  
  17. const
  18.   NO            = 0;
  19.   YES           = 1;
  20.   CharSpace     = YES;  { use char spacing in v_justified       }
  21.   WordSpace     = YES;  { use word spacing in v_justified       }
  22.   TheText       = 'The Quick Brown Fox Jumps Over The Very Lazy Dog.'#00;
  23.  
  24. var
  25.   y             : integer;      { current text y coordinate     }
  26.   TextHeight    : integer;      { current height of text        }
  27.   dummy         : integer;
  28.  
  29. { Write TheText in the output window }
  30. procedure WriteTheMessage;
  31. begin
  32.   inc(y, TextHeight);
  33.   v_gtext(VDI_handle, OutputWindow.wX, y, TheText)
  34. end;
  35.  
  36. begin { main }
  37.   if Init_Gem then begin
  38.     Message('Welcome to the text output demonstration!');
  39.     Message('We''ll take a look at some different ways...');
  40.     Message('of putting text on the screen without GDOS.');
  41.     OpenOutputWindow;
  42.     y          := OutputWindow.wY;      { set y coord     }
  43.     TextHeight := CharDefs.h_Char;      { set text height }
  44.  
  45.     Message('First some normal text');
  46.     WriteTheMessage;
  47.  
  48.     Message('Then justified to fit window');
  49.     inc(y, TextHeight);
  50.     v_justified(VDI_handle, OutputWindow.wX, y, { x,y           }
  51.                 TheText,                        { text to write }
  52.                 OutputWindow.wW,                { field width   }
  53.                 WordSpace, CharSpace);          { spacing flags }
  54.  
  55.     Message('Now in another size...');
  56.     vst_height(VDI_handle, 19,                  { new height    }
  57.                dummy, dummy, dummy, TextHeight);
  58.     WriteTheMessage;
  59.  
  60.     Message('Style...');
  61.     vst_effects(VDI_handle, BOLD + OUTLINE);    { set text effect }
  62.     WriteTheMessage;
  63.  
  64.     Message('and finally in another size, style and rotation');
  65.     vst_height(VDI_handle, 25, dummy, dummy, dummy, TextHeight);
  66.     vst_effects(VDI_handle, SHADED);
  67.     vst_rotation(VDI_handle, 2700); 
  68.     WriteTheMessage;
  69.  
  70.     Message('That''s all folks!');
  71.     CloseOutputWindow;
  72.     Exit_Gem
  73.   end
  74. end.
  75.