OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TPrintDialog::TData Class Reference

TPrintDialog::TData contains information required to initialize the printer dialog box with the user's print selections. More...

#include <owl/printdia.h>

Public Member Functions

 TData ()
 
 ~TData ()
 
void Lock ()
 Locks memory associated with the DEVMODE and DEVNAMES structures.
 
void Unlock ()
 Unlocks memory associated with the DEVMODE and DEVNAMES structures.
 
TPrintDCTransferDC ()
 Transfers the printers device context.
 
voidRead (ipstream &is, uint32 version)
 
void Write (opstream &os)
 Writes the object to a peristent stream.
 
void ClearDevMode ()
 Accessors and mutators for the internal Win32 DEVMODE structure.
 
const DEVMODEGetDevMode () const
 Gets a pointer to a DEVMODE structure (a structure containing information necessary to initialize the dialog controls).
 
DEVMODEGetDevMode ()
 Gets a pointer to a non-const DEVMODE structure (a structure containing information necessary to initialize the dialog controls).
 
void SetDevMode (const DEVMODE *devMode)
 Sets the values for the DEVMODE structure.
 
void ClearDevNames ()
 Accessors and mutators for the internal Win32 DEVNAMES structure.
 
const DEVNAMESGetDevNames () const
 Gets a pointer to a DEVNAMES structure (a structure containing three strings used to specify the driver name, the printer name, and the output port name).
 
LPCTSTR GetDriverName () const
 Gets the name of the printer device driver.
 
LPCTSTR GetDeviceName () const
 Gets the name of the output device.
 
LPCTSTR GetOutputName () const
 Gets the name of the physical output medium.
 
void SetDevNames (const tstring &driver, const tstring &device, const tstring &output)
 Sets the values for the DEVNAMES structure.
 

Public Attributes

uint32 Flags
 Flags , which are used to initialize the printer dialog box, can be one or more of the following values that control the appearance and functionality of the dialog box:
 
uint32 Error
 If the dialog box is successfully executed, Error returns 0.
 
int FromPage
 FromPage indicates the beginning page to print.
 
int ToPage
 ToPage indicates the ending page to print.
 
int MinPage
 MinPage indicates the minimum number of pages that can be printed.
 
int MaxPage
 MaxPage indicates the maximum number of pages that can be printed.
 
int Copies
 Copies indicates the actual number of pages to be printed.
 
uint32 PageSetupFlags
 Additional page setup dialog flags.
 
TPoint PaperSize
 Size of the paper user has chosen.
 
TRect MinMargin
 Minimum allowable margins of the paper.
 
TRect Margin
 Initial margins for the paper.
 
bool DoPageSetup
 Flag to do page setup?
 
bool UseOldDialog
 Flag to force use of the old print dialog under Win2K/XP/.
 

Friends

class TPrintDialog
 

Detailed Description

TPrintDialog::TData contains information required to initialize the printer dialog box with the user's print selections.

This information consists of the number of copies to be printed, the first and last pages to print, the maximum and minimum number of pages that can be printed and various flag values that indicate whether the Pages radio button is displayed, the Print to File check box is enabled, and so on.TPrintDialog uses this struct to initialize the print dialog box. Whenever the user changes the print requirements, this struct is updated.

If an error occurs, TPrintDialog::TData returns one of the common dialog extended error codes. TPrintDialog::TData also takes care of locking and unlocking memory associated with the DEVMODE and DEVNAMES structures, which contain information about the printer driver, the printer, and the output printer port.

Definition at line 58 of file printdia.h.

Constructor & Destructor Documentation

◆ TData()

owl::TPrintDialog::TData::TData ( )

Definition at line 370 of file printdia.cpp.

◆ ~TData()

owl::TPrintDialog::TData::~TData ( )

Definition at line 386 of file printdia.cpp.

Member Function Documentation

◆ ClearDevMode()

void owl::TPrintDialog::TData::ClearDevMode ( )

Accessors and mutators for the internal Win32 DEVMODE structure.

Clears device mode information (information necessary to initialize the dialog controls).

Definition at line 473 of file printdia.cpp.

◆ ClearDevNames()

void owl::TPrintDialog::TData::ClearDevNames ( )

Accessors and mutators for the internal Win32 DEVNAMES structure.

Clears the device name information (information that contains three strings used to specify the driver name, the printer name, and the output port name).

Definition at line 505 of file printdia.cpp.

◆ GetDeviceName()

LPCTSTR owl::TPrintDialog::TData::GetDeviceName ( ) const

Gets the name of the output device.

Definition at line 529 of file printdia.cpp.

◆ GetDevMode() [1/2]

DEVMODE * owl::TPrintDialog::TData::GetDevMode ( )

Gets a pointer to a non-const DEVMODE structure (a structure containing information necessary to initialize the dialog controls).

Definition at line 415 of file printdia.cpp.

◆ GetDevMode() [2/2]

const DEVMODE * owl::TPrintDialog::TData::GetDevMode ( ) const

Gets a pointer to a DEVMODE structure (a structure containing information necessary to initialize the dialog controls).

Definition at line 406 of file printdia.cpp.

◆ GetDevNames()

const DEVNAMES * owl::TPrintDialog::TData::GetDevNames ( ) const

Gets a pointer to a DEVNAMES structure (a structure containing three strings used to specify the driver name, the printer name, and the output port name).

Definition at line 424 of file printdia.cpp.

◆ GetDriverName()

LPCTSTR owl::TPrintDialog::TData::GetDriverName ( ) const

Gets the name of the printer device driver.

Definition at line 520 of file printdia.cpp.

◆ GetOutputName()

LPCTSTR owl::TPrintDialog::TData::GetOutputName ( ) const

Gets the name of the physical output medium.

Definition at line 538 of file printdia.cpp.

◆ Lock()

void owl::TPrintDialog::TData::Lock ( )

Locks memory associated with the DEVMODE and DEVNAMES structures.

Definition at line 433 of file printdia.cpp.

◆ Read()

void * owl::TPrintDialog::TData::Read ( ipstream & is,
uint32 version )

Definition at line 600 of file printdia.cpp.

References _A2W, and _USES_CONVERSION.

◆ SetDevMode()

void owl::TPrintDialog::TData::SetDevMode ( const DEVMODE * devMode)

Sets the values for the DEVMODE structure.

Definition at line 488 of file printdia.cpp.

◆ SetDevNames()

void owl::TPrintDialog::TData::SetDevNames ( const tstring & driver,
const tstring & device,
const tstring & output )

Sets the values for the DEVNAMES structure.

Definition at line 547 of file printdia.cpp.

References _tcscpy, and CHECK.

◆ TransferDC()

TPrintDC * owl::TPrintDialog::TData::TransferDC ( )

Transfers the printers device context.

Creates and returns a TPrintDC with the current settings.

Pass ownership of our hDC to the caller thru the new's TPrintDC object

Definition at line 586 of file printdia.cpp.

References owl::AutoDelete.

◆ Unlock()

void owl::TPrintDialog::TData::Unlock ( )

Unlocks memory associated with the DEVMODE and DEVNAMES structures.

Definition at line 449 of file printdia.cpp.

◆ Write()

void owl::TPrintDialog::TData::Write ( opstream & os)

Writes the object to a peristent stream.

Definition at line 648 of file printdia.cpp.

References _USES_CONVERSION, and _W2A.

Friends And Related Symbol Documentation

◆ TPrintDialog

Definition at line 191 of file printdia.h.

Member Data Documentation

◆ Copies

int owl::TPrintDialog::TData::Copies

Copies indicates the actual number of pages to be printed.

Definition at line 138 of file printdia.h.

◆ DoPageSetup

bool owl::TPrintDialog::TData::DoPageSetup

Flag to do page setup?

Definition at line 144 of file printdia.h.

◆ Error

uint32 owl::TPrintDialog::TData::Error

If the dialog box is successfully executed, Error returns 0.

Otherwise, it contains one of the following error codes.

  • CDERR_DIALOGFAILURE Failed to create a dialog box.
  • CDERR_FINDRESFAILURE Failed to find a specified resource.
  • CDERR_INITIALIZATION Failed to initialize the common dialog box function. A lack of sufficient memory can generate this error.
  • CDERR_LOCKRESOURCEFAILURE Failed to lock a specified resource.
  • CDERR_LOADRESFAILURE Failed to load a specified resource.
  • CDERR_LOADSTRFAILURE Failed to load a specified string.
  • CDERR_MEMALLOCFAILURE Unable to allocate memory for internal data structures.
  • CDERR_MEMLOCKFAILURE Unable to lock the memory associated with a handle.
  • CDERR_REGISTERMSGFAIL A message, designed for the purpose of communicating between two applications, could not be registered.
  • PDERR_CREATEICFAILURE TPrintDialog failed to create an information context.
  • PDERR_DEFAULTDIFFERENT The printer described by structure members doesn't match the default printer. This error message can occur if the user changes the printer specified in the control panel.
  • PDERR_DNDMMISMATCH The printer specified in DevMode and in DevNames is different.
  • PDERR_GETDEVMODEFAIL The printer device-driver failed to initialize the DevMode structure.
  • PDERR_INITFAILURE The TPrintDialog structure could not be initialized.
  • PDERR_LOADDRVFAILURE The specified printer's device driver could not be loaded.
  • PDERR_NODEFAULTPRN A default printer could not be identified.
  • PDERR_NODEVICES No printer drivers exist.
  • PDERR_PARSEFAILURE The string in the [devices] section of the WIN.INI file could not be parsed.
  • PDERR_PRINTERNOTFOUND The [devices] section of the WIN.INI file doesn't contain the specified printer.
  • PDERR_RETDEFFAILURE Either DevMode or DevNames contain zero.
  • PDERR_SETUPFAILURE TPrintDialog failed to load the required resources.

Definition at line 132 of file printdia.h.

◆ Flags

uint32 owl::TPrintDialog::TData::Flags

Flags , which are used to initialize the printer dialog box, can be one or more of the following values that control the appearance and functionality of the dialog box:

  • PD_ALLPAGES Indicates that the All radio button was selected when the user closed the dialog box.
  • PD_COLLATE Causes the Collate checkbox to be checked when the dialog box is created.
  • PD_DISABLEPRINTTOFILE Disables the Print to File check box.
  • PD_HIDEPRINTTOFILE Hides and disables the Print to File check box.
  • PD_NOPAGENUMS Disables the Pages radio button and the associated edit control.
  • PD_NOSELECTION Disables the Selection radio button.
  • PD_NOWARNING Prevents the warning message from being displayed when there is no default printer.
  • PD_PAGENUMS Selects the Pages radio button when the dialog box is created.
  • PD_PRINTSETUP Displays the Print Setup dialog box rather than the Print dialog box.
  • PD_PRINTTOFILE Checks the Print to File check box when the dialog box is created.
  • PD_RETURNDC Returns a device context matching the selections that the user made in the dialog box.
  • PD_RETURNDEFAULT Returns DevNames structures that are initialized for the default printer without displaying a dialog box.
  • PD_RETURNIC Returns an information context matching the selections that the user made in the dialog box.
  • PD_SELECTION Selects the Selection radio button when the dialog box is created.
  • PD_SHOWHELP Shows the Help button in the dialog box.
  • PD_USEDEVMODECOPIES If a printer driver supports multiple copies, setting this flag causes the requested number of copies to be stored in the dmCopies member of the DevMode structure and 1 in Copies. If a printer driver does not support multiple copies, setting this flag disables the Copies edit control. If this flag is not set, the number 1 is stored in DevMode and the requested number of copies in Copies.

Definition at line 97 of file printdia.h.

◆ FromPage

int owl::TPrintDialog::TData::FromPage

FromPage indicates the beginning page to print.

Definition at line 134 of file printdia.h.

◆ Margin

TRect owl::TPrintDialog::TData::Margin

Initial margins for the paper.

Definition at line 143 of file printdia.h.

◆ MaxPage

int owl::TPrintDialog::TData::MaxPage

MaxPage indicates the maximum number of pages that can be printed.

Definition at line 137 of file printdia.h.

◆ MinMargin

TRect owl::TPrintDialog::TData::MinMargin

Minimum allowable margins of the paper.

Definition at line 142 of file printdia.h.

◆ MinPage

int owl::TPrintDialog::TData::MinPage

MinPage indicates the minimum number of pages that can be printed.

Definition at line 136 of file printdia.h.

◆ PageSetupFlags

uint32 owl::TPrintDialog::TData::PageSetupFlags

Additional page setup dialog flags.

Definition at line 140 of file printdia.h.

◆ PaperSize

TPoint owl::TPrintDialog::TData::PaperSize

Size of the paper user has chosen.

Definition at line 141 of file printdia.h.

◆ ToPage

int owl::TPrintDialog::TData::ToPage

ToPage indicates the ending page to print.

Definition at line 135 of file printdia.h.

◆ UseOldDialog

bool owl::TPrintDialog::TData::UseOldDialog

Flag to force use of the old print dialog under Win2K/XP/.

Definition at line 145 of file printdia.h.


The documentation for this class was generated from the following files: