home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / yacl-012.zip / uidemo / print / main.cxx next >
C/C++ Source or Header  |  1995-04-08  |  985b  |  36 lines

  1.  
  2.  
  3. // A demo  of printing under Windows
  4. //
  5. // M. A. Sridhar
  6. // Jan 19, 1995
  7.  
  8. #include "ui/applic.h"
  9. #include "ui/ellipse.h"
  10. #include "ui/font.h"
  11. #include "ui/printjob.h"
  12.  
  13. // ======================== Main program ===========================
  14.  
  15.  
  16. int UI_Application::Main (int, char* [])
  17. {
  18.     UI_PrintJob aJob ("YACL Test Job");
  19.     aJob.Font () = UI_FontDesc (UIFont_Times, 20,
  20.                                 UIFont_BoldFace | UIFont_Italic);
  21.     const char* string =  "Sample output from YACL";
  22.     UI_Rectangle pageRect = aJob.DrawingArea ();
  23.     long width  = pageRect.Width();
  24.     long height = pageRect.Height ();
  25.     UI_Rectangle rect (width/4, height/4, width/2, height/2);
  26.     aJob.DrawEllipse (rect);
  27.     height = aJob.Font().Height();
  28.     width  = aJob.TextWidth (string);
  29.     UI_Rectangle trect (pageRect.Center() - UI_Point (width/2, height/2),
  30.                         width, height);
  31.     aJob.WriteString (string, trect);
  32.     return 0;
  33. }
  34.  
  35.  
  36.