//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "PrinterOrientation.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: PrinterOrientation
// Property: Printers.TPrinter.Orientation

// BeginCode
/*
This example uses two radio buttons on a form named
Landscape and Portrait. The form also includes a button.
When the user selects an orientation by clicking one of the
radio buttons and then clicks the button to print one line
of text, the print job prints using the selected orientation:
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  Printer()->BeginDoc();
  Printer()->Canvas->TextOut(100,100,"Hi there!");
  Printer()->EndDoc();
}

void __fastcall TForm1::PortraitClick(TObject *Sender)
{
  Printer()->Orientation = poPortrait;
}

void __fastcall TForm1::LandscapeClick(TObject *Sender)
{
  Printer()->Orientation = poLandscape;
}
// EndCode
// EndExample: PrinterOrientation
//---------------------------------------------------------------------------
