15#if defined(__BORLANDC__)
80 if (!PrintTemplateName.empty())
81 PrintTemplate =
TResId{PrintTemplateName.c_str()};
83 if (!SetupTemplateName.empty())
84 SetupTemplate =
TResId{SetupTemplateName.c_str()};
87 Pd.lStructSize =
sizeof Pd;
109 Pd.lpfnPrintHook =
nullptr;
110 Pd.lpfnSetupHook =
nullptr;
117 memset(&Psd, 0,
sizeof Psd);
118 Psd.lStructSize =
sizeof Psd;
131 Psd.lpfnPageSetupHook =
nullptr;
132 Psd.lpfnPagePaintHook =
nullptr;
135 Psd.rtMargin = Data.
Margin;
137 memset(&Pde, 0,
sizeof Pde);
138 Pde.lStructSize =
sizeof Pde;
148 Pde.Flags = Data.
Flags;
162 Pde.hInstance =
nullptr;
165 Pde.lpCallback =
nullptr;
166 Pde.nMaxPageRanges = 1;
167 Pde.lpPageRanges = &PdeRange;
232 Psd.hDevMode = Data.HDevMode;
233 Psd.hDevNames = Data.HDevNames;
242 Data.
Margin = Psd.rtMargin;
249 Data.HDevMode = Psd.hDevMode;
250 Data.HDevNames = Psd.hDevNames;
261 Pd.hDevMode = Data.HDevMode;
262 Pd.hDevNames = Data.HDevNames;
282 Pde.hDevMode = Data.HDevMode;
283 Pde.hDevNames = Data.HDevNames;
284 CHECK(Pde.hwndOwner);
295 Data.
Flags = Pde.Flags;
298 Data.
FromPage = Pde.lpPageRanges[0].nFromPage;
299 Data.
ToPage = Pde.lpPageRanges[0].nToPage;
300 Data.
Copies = Pde.nCopies;
317 Data.HDevMode = Pde.hDevMode;
318 Data.HDevNames = Pde.hDevNames;
330 Data.
Flags = Pd.Flags;
343 Data.HDevMode = Pd.hDevMode;
344 Data.HDevNames = Pd.hDevNames;
359 int flags = Pde.Flags;
365 return result ==
IDOK;
374 FromPage(-1), ToPage(-1),
375 MinPage(-1), MaxPage(-1),
522 return DevNames ?
reinterpret_cast<LPCTSTR>(DevNames) + DevNames->wDriverOffset :
nullptr;
531 return DevNames ?
reinterpret_cast<LPCTSTR>(DevNames) + DevNames->wDeviceOffset :
nullptr;
540 return DevNames ?
reinterpret_cast<LPCTSTR>(DevNames) + DevNames->wOutputOffset :
nullptr;
555 const int n =
static_cast<int>(
driver.length() + 1 +
device.length() + 1 +
output.length() + 1);
559 DevNames->wDefault =
false;
573 DevNames->wDriverOffset =
static_cast<WORD>(
pDriver - base);
574 DevNames->wDeviceOffset =
static_cast<WORD>(
pDevice - base);
575 DevNames->wOutputOffset =
static_cast<WORD>(
pOutput - base);
608 const auto driverNarrow = std::unique_ptr<char[]>(
is.freadString());
609 const auto deviceNarrow = std::unique_ptr<char[]>(
is.freadString());
610 const auto outputNarrow = std::unique_ptr<char[]>(
is.freadString());
619 DevNames->wDefault =
deflt;
635 is >> PageSetupFlags;
658 os.fwriteString(
_W2A(GetDriverName()));
659 os.fwriteString(
_W2A(GetDeviceName()));
660 os.fwriteString(
_W2A(GetOutputName()));
661 os << (DevNames ? DevNames->wDefault :
uint16(0));
665 int16 size =
int16(DevMode->dmSize + DevMode->dmDriverExtra);
667 os.fwriteBytes(DevMode, size);
672 os << PageSetupFlags;
TFrameWindow * GetMainWindow()
Return the current main window.
Derived from TDialog, TCommonDialog is the abstract base class for TCommonDialog objects.
virtual INT_PTR DialogFunction(TMsgId, TParam1, TParam2)
Override this to process messages within the dialog function.
static INT_PTR CALLBACK StdDlgProc(HWND, UINT, WPARAM, LPARAM) noexcept
Callback procs for hooking TDialog to native window.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
A DC class that provides access to a printer.
TPrintDialog::TData contains information required to initialize the printer dialog box with the user'...
uint32 PageSetupFlags
Additional page setup dialog flags.
LPCTSTR GetOutputName() const
Gets the name of the physical output medium.
const DEVMODE * GetDevMode() const
Gets a pointer to a DEVMODE structure (a structure containing information necessary to initialize the...
bool UseOldDialog
Flag to force use of the old print dialog under Win2K/XP/.
uint32 Error
If the dialog box is successfully executed, Error returns 0.
TPoint PaperSize
Size of the paper user has chosen.
TRect MinMargin
Minimum allowable margins of the paper.
void SetDevNames(const tstring &driver, const tstring &device, const tstring &output)
Sets the values for the DEVNAMES structure.
LPCTSTR GetDriverName() const
Gets the name of the printer device driver.
int MaxPage
MaxPage indicates the maximum number of pages that can be printed.
TPrintDC * TransferDC()
Transfers the printers device context.
void Write(opstream &os)
Writes the object to a peristent stream.
void ClearDevNames()
Accessors and mutators for the internal Win32 DEVNAMES structure.
int FromPage
FromPage indicates the beginning page to print.
LPCTSTR GetDeviceName() const
Gets the name of the output device.
uint32 Flags
Flags , which are used to initialize the printer dialog box, can be one or more of the following valu...
int ToPage
ToPage indicates the ending page to print.
void * Read(ipstream &is, uint32 version)
int MinPage
MinPage indicates the minimum number of pages that can be printed.
TRect Margin
Initial margins for the paper.
void ClearDevMode()
Accessors and mutators for the internal Win32 DEVMODE structure.
const DEVNAMES * GetDevNames() const
Gets a pointer to a DEVNAMES structure (a structure containing three strings used to specify the driv...
void Lock()
Locks memory associated with the DEVMODE and DEVNAMES structures.
int Copies
Copies indicates the actual number of pages to be printed.
void SetDevMode(const DEVMODE *devMode)
Sets the values for the DEVMODE structure.
void Unlock()
Unlocks memory associated with the DEVMODE and DEVNAMES structures.
bool DoPageSetup
Flag to do page setup?
void CmSetup()
Default processing.
auto DialogFunction(TMsgId, TParam1, TParam2) -> INT_PTR override
Returns true if a message is handled.
PRINTDLG & GetPD()
Returns the PRINTDLG structure used by the dialog.
auto DoExecute() -> int override
If no error occurs, DoExecute copies flags and print specifications into the data argument in the con...
TPrintDialog(TWindow *parent, TData &, TResId printTemplate=TResId{}, TResId setupTemplate=TResId{}, LPCTSTR title=0, TModule *=0)
Constructs a print or print setup dialog box with specified data from the TPrintDialog::TData struct ...
void SetPD(const PRINTDLG &)
Sets the PRINTDLG structure used by the dialog.
void Init()
Common initialization of the contained data structures.
bool GetDefaultPrinter()
Without displaying a dialog box, GetDefaultPrinter gets the device mode and name that are initialized...
TData & GetData()
Returns the transfer data of the dialog.
TPointer GetPointerRepresentation() const
Returns the encapsulated pointer.
static uint GetMajorVersion()
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
TApplication * GetApplication() const
Gets a pointer to the TApplication object associated with this.
TWindow * GetParentO() const
Return the OWL's parent for this window.
TModule * GetModule() const
Returns a pointer to the module object.
TResult DefaultProcessing()
Handles default processing of events, which includes continued processing of menu/accelerators comman...
HWND GetHandle() const
Returns the handle of the window.
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
Base class for writing streamable objects.
Definition of GDI DC encapsulation classes: TDC, TWindowDC, TScreenDC, TDesktopDC,...
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
Definition of class TFrameWindow.
THandle GetHandle() const
Return the instance handle of the library module represented by the TModule obect.
Object Windows Library (OWLNext Core)
UINT TMsgId
Message ID type.
LPARAM TParam2
Second parameter type.
WPARAM TParam1
First parameter type.
Definition of Print and PrintSetup common Dialogs classes.