ultimatepp/reference/PrinterJob/main.cpp
cxl 2445ba04d7 Several examples fixed to compile and work in new draw
git-svn-id: svn://ultimatepp.org/upp/trunk@1386 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2009-07-08 18:44:19 +00:00

20 lines
427 B
C++

#include <CtrlLib/CtrlLib.h>
using namespace Upp;
GUI_APP_MAIN
{
PrinterJob pj;
if(PromptYesNo("Landscape?"))
pj.Landscape();
if(!PromptYesNo("Use default printer?"))
if(!pj.Execute())
return;
Draw& w = pj;
w.StartPage();
const char *text = "Hello world!";
Font font = Roman(300);
Point p = Rect(w.GetPageSize()).CenterPos(GetTextSize(text, font));
w.DrawText(p.x, p.y, "Hello world!", font);
w.EndPage();
}