90 delete CurrentPreviewFont;
106 CurrentPreviewFont =
new TFont(
lf);
111 if ((
HFONT)(*CurrentPreviewFont) != PrnFont) {
112 PrnFont = (
HFONT)(*CurrentPreviewFont);
185 return tm.tmHeight < 0
187 : -(
tm.tmHeight -
tm.tmInternalLeading);
222 ::GetObject(PrnFont,
sizeof(
lf), &
lf);
228 lf.lfWidth =
tm.tmAveCharWidth;
229 lf.lfWeight =
tm.tmWeight;
230 lf.lfItalic =
tm.tmItalic;
231 lf.lfUnderline =
tm.tmUnderlined;
232 lf.lfStrikeOut =
tm.tmStruckOut;
233 lf.lfCharSet =
tm.tmCharSet;
254 lf.lfFaceName[0] = 0;
515 if (Printout.
HasPage(PageNum)) {
Class wrapper for management of color values.
static const TColor White
Static TColor object with fixed Value set by RGB(255, 255, 255).
TDC is the root class for GDI DC wrappers.
virtual bool SetViewportOrg(const TPoint &origin, TPoint *oldOrg=nullptr)
Sets this DC's viewport origin to the given origin value, and saves the previous origin in oldOrg.
int GetTextFace(int count, TCHAR *facename) const
Retrieves the typeface name for the current font on this DC.
TColor GetBkColor() const
Returns the current background color of this DC.
virtual int GetDeviceCaps(int index) const
Used under WIN3.1 or later, GetDeviceCaps returns capability information about this DC.
bool GetViewportOrg(TPoint &point) const
The first version sets in the point argument the x- and y-extents (in device-units) of this DC's view...
virtual bool ScaleWindowExt(int xNum, int xDenom, int yNum, int yDenom, TSize *oldExtent=nullptr)
Modifies this DC's window extents relative to the current values.
void SelectObject(const TBrush &brush)
Selects the given GDI brush object into this DC.
virtual bool ScaleViewportExt(int xNum, int xDenom, int yNum, int yDenom, TSize *oldExtent=nullptr)
Modifies this DC's viewport extents relative to the current values.
TEXTMETRIC GetTextMetrics() const
Functional style overload.
virtual int SetMapMode(int mode)
Sets the current window mapping mode of this DC to mode.
HANDLE GetCurrentObject(uint objectType) const
Returns a handle to the currently selected object of the given objectType associated with this DC.
virtual TColor SetBkColor(const TColor &color)
Sets the current background color of this DC to the given color value or the nearest available.
virtual bool SetWindowExt(const TSize &extent, TSize *oldExtent=nullptr)
Sets this DC's window x- and y-extents to the given extent values.
int SelectClipRgn(const TRegion ®ion)
Selects the given region as the current clipping region for this DC.
virtual void RestoreFont()
Restores the original GDI font object to this DC.
bool GetViewportExt(TSize &extent) const
The first version retrieves this DC's current viewport's x- and y-extents (in device units) and place...
virtual void SelectStockObject(int index)
Selects into the DC a predefined stock pen, brush, font, or palette.
bool GetWindowOrg(TPoint &point) const
Places in point the x- and y-coordinates of the origin of the window associated with this DC.
virtual bool OffsetViewportOrg(const TPoint &delta, TPoint *oldOrg=nullptr)
Modifies this DC's viewport origin relative to the current values.
bool GetTextMetrics(TEXTMETRIC &metrics) const
Fills the metrics structure with metrics data for the current font on this DC.
virtual TColor SetTextColor(const TColor &color)
Sets the current text color of this DC to the given color value.
TColor GetTextColor() const
Returns the current text color of this DC.
bool GetWindowExt(TSize &extent) const
Retrieves this DC's window current x- and y-extents (in device units).
bool PatBlt(int x, int y, int w, int h, uint32 rop=PATCOPY)
virtual bool SetViewportExt(const TSize &extent, TSize *oldExtent=nullptr)
Sets this DC's viewport x- and y-extents to the given extent values.
HDC GetHDC() const
Return the handle of the device context.
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
TPoint is a support class, derived from tagPOINT.
TPreviewDCBase is the base class encapsulating a 'dual' device context - i.e.
HDC GetAttributeHDC() const
Overriden to return printer's HDC.
TPrintDC & PrnDC
DC of 'real' device (aka TargetDevice) whose output we're previewing.
TPreviewDCBase(TDC &screen, TPrintDC &printdc)
Constructs a basic Preview DC.
TPreviewPage encapsulates a window which displays print-preview data.
void Paint(TDC &, bool, TRect &) override
Using a TPrintPreviewDC, 'print' the current page (PageNum) of Printout onto the window DC provided.
TPreviewPage(TWindow *parent, TPrintout &printout, TPrintDC &prndc, TSize &printExtent, int pagenum=1)
Constructs a TPreviewPage object where parent is the parent window, printout is a reference to the co...
void EvSize(uint sizeType, const TSize &size)
Invalidates the entire window when the size of the page displayed in the preview window changes.
void SetPageNumber(int newNum)
Sets newNum to the number of the page currently displayed in the preview window.
A DC class that provides access to a printer.
Derived from TPrintDC, TPrintPreviewDC maps printer device coordinates to logical screen coordinates.
~TPrintPreviewDC()
Destroys a TPrintPreviewDC object.
TColor SetBkColor(const TColor &color)
Sets the current background color of this DC to the given color value or the nearest available.
void RestoreFont()
Restores the original GDI font object to this DC.
bool ScaleWindowExt(int xNum, int xDenom, int yNum, int yDenom, TSize *oldExtent=0)
Modifies this DC's window extents relative to the current values.
virtual void ReOrg()
Gets the x- and y- extents of the viewport, equalizes the logical and screen points,...
TColor SetTextColor(const TColor &color)
Sets the current text color of this DC to the given color value.
virtual void ReScale()
Maps the points of the printer DC to the screen DC.
bool SetWindowExt(const TSize &extent, TSize *oldExtent=0)
Sets the DC's window x- and y-extents to the given extent values.
void SelectStockObject(int index)
Retrieves a handle to a predefined stock font.
TPrintPreviewDC(TDC &screen, TPrintDC &printdc, const TRect &client, const TRect &clip)
TPrintPreviewDC's constructor takes a screen DC as well as a printer DC.
virtual void SyncFont()
Sets the screen font equal to the current printer font.
bool ScaleViewportExt(int xNum, int xDenom, int yNum, int yDenom, TSize *oldExtent=0)
Modifies this DC's viewport extents relative to the current values.
bool SetViewportOrg(const TPoint &origin, TPoint *oldOrg=0)
Sets the printer DC's viewport origin to the given origin value, and saves the previous origin in old...
bool OffsetViewportOrg(const TPoint &delta, TPoint *oldOrg=0)
Modifies this DC's viewport origin relative to the current values.
int SetMapMode(int mode)
Sets the current window mapping mode of this DC to mode.
int GetDeviceCaps(int index) const
GetDeviceCaps returns capability information, such as font and pitch attributes, about the printer DC...
void SelectObject(const TFont &newFont)
Selects the given font object into this DC.
bool SetViewportExt(const TSize &extent, TSize *oldExtent=0)
Sets the screen's viewport x- and y-extents to the given extent values.
TPrintout represents the physical printed document that is to sent to a printer to be printed.
virtual void BeginDocument(int startPage, int endPage, uint flags)
The printer object's Print function calls BeginDocument once before printing each copy of a document.
virtual bool HasPage(int pageNumber)
HasPage is called after every page is printed.
virtual void EndPrinting()
The printer object's Print function calls EndPrinting after all copies of the document finish printin...
virtual void EndDocument()
The printer object's Print function calls EndDocument after each copy of the document finishes printi...
virtual void SetPrintParams(TPrintDC *dc, TSize pageSize)
SetPrintParams sets DC to dc and PageSize to pageSize.
virtual void PrintPage(int page, TRect &rect, uint flags)
PrintPage is called for every page (or band, if Banding is true) and must be overridden to print the ...
virtual void BeginPrinting()
The printer object's Print function calls BeginPrinting once at the beginning of a print job,...
TRect is a mathematical class derived from tagRect.
The tagSIZE struct is defined as.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
void SetBkgndColor(TColor color, bool shouldUpdate=true)
Sets the background color for the window.
TRect GetClientRect() const
Gets the coordinates of the window's client area (the area in a window you can use for drawing).
void EvSize(uint sizeType, const TSize &size)
Response method for an incoming WM_SIZE message.
virtual void Invalidate(bool erase=true)
Invalidates (mark for painting) the entire client area of a window.
HWND GetHandle() const
Returns the handle of the window.
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 abstract GDI object class and derived classes.
@ pfBoth
Current band accepts both text and graphics.
Object Windows Library (OWLNext Core)
int GlyphHeight(TEXTMETRIC &tm)
bool SetViewportExt(HDC hdc, int w, int h)
bool SetWindowExt(HDC hdc, int w, int h)
bool SetWindowOrg(HDC hdc, int w, int h)
bool SetViewportOrg(HDC hdc, int x, int y)
Definition of print preview classes.
Definition of Print and PrintSetup common Dialogs classes.