home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
yacl-012.zip
/
uidemo
/
print
/
main.cxx
next >
Wrap
C/C++ Source or Header
|
1995-04-08
|
985b
|
36 lines
// A demo of printing under Windows
//
// M. A. Sridhar
// Jan 19, 1995
#include "ui/applic.h"
#include "ui/ellipse.h"
#include "ui/font.h"
#include "ui/printjob.h"
// ======================== Main program ===========================
int UI_Application::Main (int, char* [])
{
UI_PrintJob aJob ("YACL Test Job");
aJob.Font () = UI_FontDesc (UIFont_Times, 20,
UIFont_BoldFace | UIFont_Italic);
const char* string = "Sample output from YACL";
UI_Rectangle pageRect = aJob.DrawingArea ();
long width = pageRect.Width();
long height = pageRect.Height ();
UI_Rectangle rect (width/4, height/4, width/2, height/2);
aJob.DrawEllipse (rect);
height = aJob.Font().Height();
width = aJob.TextWidth (string);
UI_Rectangle trect (pageRect.Center() - UI_Point (width/2, height/2),
width, height);
aJob.WriteString (string, trect);
return 0;
}