print.tex

来自「Wxpython Implemented on Windows CE, Sou」· TEX 代码 · 共 1,214 行 · 第 1/3 页

TEX
1,214
字号
\section{\class{wxPrintData}}\label{wxprintdata}

This class holds a variety of information related to printers and
printer device contexts. This class is used to create a wxPrinterDC
and a wxPostScriptDC. It is also used as a data member of wxPrintDialogData
and wxPageSetupDialogData, as part of the mechanism for transferring data
between the print dialogs and the application.

\wxheading{Derived from}

\helpref{wxObject}{wxobject}

\wxheading{Include files}

<wx/cmndata.h>

\wxheading{See also}

\helpref{wxPrintDialog}{wxprintdialog}, 
\helpref{wxPageSetupDialog}{wxpagesetupdialog}, 
\helpref{wxPrintDialogData}{wxprintdialogdata}, 
\helpref{wxPageSetupDialogData}{wxpagesetupdialogdata}, 
\helpref{wxPrintDialog Overview}{wxprintdialogoverview}, 
\helpref{wxPrinterDC}{wxprinterdc}, 
\helpref{wxPostScriptDC}{wxpostscriptdc}

\wxheading{Remarks}

The following functions are specific to PostScript printing
and have not yet been documented:

\begin{verbatim}
const wxString& GetPrinterCommand() const ;
const wxString& GetPrinterOptions() const ;
const wxString& GetPreviewCommand() const ;
const wxString& GetFilename() const ;
const wxString& GetFontMetricPath() const ;
double GetPrinterScaleX() const ;
double GetPrinterScaleY() const ;
long GetPrinterTranslateX() const ;
long GetPrinterTranslateY() const ;
// wxPRINT_MODE_PREVIEW, wxPRINT_MODE_FILE, wxPRINT_MODE_PRINTER
wxPrintMode GetPrintMode() const ;

void SetPrinterCommand(const wxString& command) ;
void SetPrinterOptions(const wxString& options) ;
void SetPreviewCommand(const wxString& command) ;
void SetFilename(const wxString& filename) ;
void SetFontMetricPath(const wxString& path) ;
void SetPrinterScaleX(double x) ;
void SetPrinterScaleY(double y) ;
void SetPrinterScaling(double x, double y) ;
void SetPrinterTranslateX(long x) ;
void SetPrinterTranslateY(long y) ;
void SetPrinterTranslation(long x, long y) ;
void SetPrintMode(wxPrintMode printMode) ;
\end{verbatim}

\latexignore{\rtfignore{\wxheading{Members}}}


\membersection{wxPrintData::wxPrintData}\label{wxprintdatactor}

\func{}{wxPrintData}{\void}

Default constructor.

\func{}{wxPrintData}{\param{const wxPrintData\&}{ data}}

Copy constructor.


\membersection{wxPrintData::\destruct{wxPrintData}}\label{wxprintdatadtor}

\func{}{\destruct{wxPrintData}}{\void}

Destructor.


\membersection{wxPrintData::GetCollate}\label{wxprintdatagetcollate}

\constfunc{bool}{GetCollate}{\void}

Returns true if collation is on.


\membersection{wxPrintData::GetBin}\label{wxprintdatagetbin}

\constfunc{wxPrintBin}{GetBin}{\void}

Returns the current bin (papersource). By default, the system is left to select
the bin (\texttt{wxPRINTBIN\_DEFAULT} is returned).

See \helpref{SetBin()}{wxprintdatasetbin} for the full list of bin values.


\membersection{wxPrintData::GetColour}\label{wxprintdatagetcolour}

\constfunc{bool}{GetColour}{\void}

Returns true if colour printing is on.


\membersection{wxPrintData::GetDuplex}\label{wxprintdatagetduplex}

\constfunc{wxDuplexMode}{GetDuplex}{\void}

Returns the duplex mode. One of wxDUPLEX\_SIMPLEX, wxDUPLEX\_HORIZONTAL, wxDUPLEX\_VERTICAL.


\membersection{wxPrintData::GetNoCopies}\label{wxprintdatagetnocopies}

\constfunc{int}{GetNoCopies}{\void}

Returns the number of copies requested by the user.


\membersection{wxPrintData::GetOrientation}\label{wxprintdatagetorientation}

\constfunc{int}{GetOrientation}{\void}

Gets the orientation. This can be wxLANDSCAPE or wxPORTRAIT.


\membersection{wxPrintData::GetPaperId}\label{wxprintdatagetpaperid}

\constfunc{wxPaperSize}{GetPaperId}{\void}

Returns the paper size id. For more information, see \helpref{wxPrintData::SetPaperId}{wxprintdatasetpaperid}.


\membersection{wxPrintData::GetPrinterName}\label{wxprintdatagetprintername}

\constfunc{const wxString\&}{GetPrinterName}{\void}

Returns the printer name. If the printer name is the empty string, it indicates that the default
printer should be used.


\membersection{wxPrintData::GetQuality}\label{wxprintdatagetquality}

\constfunc{wxPrintQuality}{GetQuality}{\void}

Returns the current print quality. This can be a positive integer, denoting the number of dots per inch, or
one of the following identifiers:

\begin{verbatim}
wxPRINT_QUALITY_HIGH
wxPRINT_QUALITY_MEDIUM
wxPRINT_QUALITY_LOW
wxPRINT_QUALITY_DRAFT
\end{verbatim}

On input you should pass one of these identifiers, but on return you may get back a positive integer
indicating the current resolution setting.


\membersection{wxPrintData::Ok}\label{wxprintdataok}

\constfunc{bool}{Ok}{\void}

Returns true if the print data is valid for using in print dialogs.
This can return false on Windows if the current printer is not set, for example.
On all other platforms, it returns true.


\membersection{wxPrintData::SetBin}\label{wxprintdatasetbin}

\func{void}{SetBin}{\param{wxPrintBin }{flag}}

Sets the current bin. Possible values are:

\small{
\begin{verbatim}
enum wxPrintBin
{
    wxPRINTBIN_DEFAULT,

    wxPRINTBIN_ONLYONE,
    wxPRINTBIN_LOWER,
    wxPRINTBIN_MIDDLE,
    wxPRINTBIN_MANUAL,
    wxPRINTBIN_ENVELOPE,
    wxPRINTBIN_ENVMANUAL,
    wxPRINTBIN_AUTO,
    wxPRINTBIN_TRACTOR,
    wxPRINTBIN_SMALLFMT,
    wxPRINTBIN_LARGEFMT,
    wxPRINTBIN_LARGECAPACITY,
    wxPRINTBIN_CASSETTE,
    wxPRINTBIN_FORMSOURCE,

    wxPRINTBIN_USER,
};
\end{verbatim}
}


\membersection{wxPrintData::SetCollate}\label{wxprintdatasetcollate}

\func{void}{SetCollate}{\param{bool }{flag}}

Sets collation to on or off.


\membersection{wxPrintData::SetColour}\label{wxprintdatasetcolour}

\func{void}{SetColour}{\param{bool }{flag}}

Sets colour printing on or off.


\membersection{wxPrintData::SetDuplex}\label{wxprintdatasetduplex}

\func{void}{SetDuplex}{\param{wxDuplexMode}{ mode}}

Returns the duplex mode. One of wxDUPLEX\_SIMPLEX, wxDUPLEX\_HORIZONTAL, wxDUPLEX\_VERTICAL.


\membersection{wxPrintData::SetNoCopies}\label{wxprintdatasetnocopies}

\func{void}{SetNoCopies}{\param{int }{n}}

Sets the default number of copies to be printed out.


\membersection{wxPrintData::SetOrientation}\label{wxprintdatasetorientation}

\func{void}{SetOrientation}{\param{int }{orientation}}

Sets the orientation. This can be wxLANDSCAPE or wxPORTRAIT.


\membersection{wxPrintData::SetPaperId}\label{wxprintdatasetpaperid}

\func{void}{SetPaperId}{\param{wxPaperSize}{ paperId}}

\index{wxPaperSize}Sets the paper id. This indicates the type of paper to be used. For a mapping between
paper id, paper size and string name, see wxPrintPaperDatabase in {\tt paper.h} (not yet documented).

{\it paperId} can be one of:

{\small
\begin{verbatim}
    wxPAPER_NONE,               // Use specific dimensions
    wxPAPER_LETTER,             // Letter, 8 1/2 by 11 inches
    wxPAPER_LEGAL,              // Legal, 8 1/2 by 14 inches
    wxPAPER_A4,                 // A4 Sheet, 210 by 297 millimeters
    wxPAPER_CSHEET,             // C Sheet, 17 by 22 inches
    wxPAPER_DSHEET,             // D Sheet, 22 by 34 inches
    wxPAPER_ESHEET,             // E Sheet, 34 by 44 inches
    wxPAPER_LETTERSMALL,        // Letter Small, 8 1/2 by 11 inches
    wxPAPER_TABLOID,            // Tabloid, 11 by 17 inches
    wxPAPER_LEDGER,             // Ledger, 17 by 11 inches
    wxPAPER_STATEMENT,          // Statement, 5 1/2 by 8 1/2 inches
    wxPAPER_EXECUTIVE,          // Executive, 7 1/4 by 10 1/2 inches
    wxPAPER_A3,                 // A3 sheet, 297 by 420 millimeters
    wxPAPER_A4SMALL,            // A4 small sheet, 210 by 297 millimeters
    wxPAPER_A5,                 // A5 sheet, 148 by 210 millimeters
    wxPAPER_B4,                 // B4 sheet, 250 by 354 millimeters
    wxPAPER_B5,                 // B5 sheet, 182-by-257-millimeter paper
    wxPAPER_FOLIO,              // Folio, 8-1/2-by-13-inch paper
    wxPAPER_QUARTO,             // Quarto, 215-by-275-millimeter paper
    wxPAPER_10X14,              // 10-by-14-inch sheet
    wxPAPER_11X17,              // 11-by-17-inch sheet
    wxPAPER_NOTE,               // Note, 8 1/2 by 11 inches
    wxPAPER_ENV_9,              // #9 Envelope, 3 7/8 by 8 7/8 inches
    wxPAPER_ENV_10,             // #10 Envelope, 4 1/8 by 9 1/2 inches
    wxPAPER_ENV_11,             // #11 Envelope, 4 1/2 by 10 3/8 inches
    wxPAPER_ENV_12,             // #12 Envelope, 4 3/4 by 11 inches
    wxPAPER_ENV_14,             // #14 Envelope, 5 by 11 1/2 inches
    wxPAPER_ENV_DL,             // DL Envelope, 110 by 220 millimeters
    wxPAPER_ENV_C5,             // C5 Envelope, 162 by 229 millimeters
    wxPAPER_ENV_C3,             // C3 Envelope, 324 by 458 millimeters
    wxPAPER_ENV_C4,             // C4 Envelope, 229 by 324 millimeters
    wxPAPER_ENV_C6,             // C6 Envelope, 114 by 162 millimeters
    wxPAPER_ENV_C65,            // C65 Envelope, 114 by 229 millimeters
    wxPAPER_ENV_B4,             // B4 Envelope, 250 by 353 millimeters
    wxPAPER_ENV_B5,             // B5 Envelope, 176 by 250 millimeters
    wxPAPER_ENV_B6,             // B6 Envelope, 176 by 125 millimeters
    wxPAPER_ENV_ITALY,          // Italy Envelope, 110 by 230 millimeters
    wxPAPER_ENV_MONARCH,        // Monarch Envelope, 3 7/8 by 7 1/2 inches
    wxPAPER_ENV_PERSONAL,       // 6 3/4 Envelope, 3 5/8 by 6 1/2 inches
    wxPAPER_FANFOLD_US,         // US Std Fanfold, 14 7/8 by 11 inches
    wxPAPER_FANFOLD_STD_GERMAN, // German Std Fanfold, 8 1/2 by 12 inches
    wxPAPER_FANFOLD_LGL_GERMAN, // German Legal Fanfold, 8 1/2 by 13 inches

Windows 95 only:
    wxPAPER_ISO_B4,             // B4 (ISO) 250 x 353 mm
    wxPAPER_JAPANESE_POSTCARD,  // Japanese Postcard 100 x 148 mm
    wxPAPER_9X11,               // 9 x 11 in
    wxPAPER_10X11,              // 10 x 11 in
    wxPAPER_15X11,              // 15 x 11 in
    wxPAPER_ENV_INVITE,         // Envelope Invite 220 x 220 mm
    wxPAPER_LETTER_EXTRA,       // Letter Extra 9 \275 x 12 in
    wxPAPER_LEGAL_EXTRA,        // Legal Extra 9 \275 x 15 in
    wxPAPER_TABLOID_EXTRA,      // Tabloid Extra 11.69 x 18 in
    wxPAPER_A4_EXTRA,           // A4 Extra 9.27 x 12.69 in
    wxPAPER_LETTER_TRANSVERSE,  // Letter Transverse 8 \275 x 11 in
    wxPAPER_A4_TRANSVERSE,      // A4 Transverse 210 x 297 mm
    wxPAPER_LETTER_EXTRA_TRANSVERSE, // Letter Extra Transverse 9\275 x 12 in
    wxPAPER_A_PLUS,             // SuperA/SuperA/A4 227 x 356 mm
    wxPAPER_B_PLUS,             // SuperB/SuperB/A3 305 x 487 mm
    wxPAPER_LETTER_PLUS,        // Letter Plus 8.5 x 12.69 in
    wxPAPER_A4_PLUS,            // A4 Plus 210 x 330 mm
    wxPAPER_A5_TRANSVERSE,      // A5 Transverse 148 x 210 mm
    wxPAPER_B5_TRANSVERSE,      // B5 (JIS) Transverse 182 x 257 mm
    wxPAPER_A3_EXTRA,           // A3 Extra 322 x 445 mm
    wxPAPER_A5_EXTRA,           // A5 Extra 174 x 235 mm
    wxPAPER_B5_EXTRA,           // B5 (ISO) Extra 201 x 276 mm
    wxPAPER_A2,                 // A2 420 x 594 mm
    wxPAPER_A3_TRANSVERSE,      // A3 Transverse 297 x 420 mm
    wxPAPER_A3_EXTRA_TRANSVERSE // A3 Extra Transverse 322 x 445 mm
\end{verbatim}
}


\membersection{wxPrintData::SetPrinterName}\label{wxprintdatasetprintername}

\func{void}{SetPrinterName}{\param{const wxString\& }{printerName}}

Sets the printer name. This can be the empty string to indicate that the default
printer should be used.


\membersection{wxPrintData::SetQuality}\label{wxprintdatasetquality}

\func{void}{SetQuality}{\param{wxPrintQuality}{ quality}}

Sets the desired print quality. This can be a positive integer, denoting the number of dots per inch, or
one of the following identifiers:

\begin{verbatim}
wxPRINT_QUALITY_HIGH
wxPRINT_QUALITY_MEDIUM
wxPRINT_QUALITY_LOW
wxPRINT_QUALITY_DRAFT
\end{verbatim}

On input you should pass one of these identifiers, but on return you may get back a positive integer
indicating the current resolution setting.


\membersection{wxPrintData::operator $=$}\label{wxprintdataassign}

\func{void}{operator $=$}{\param{const wxPrintData\&}{ data}}

Assigns print data to this object.

\func{void}{operator $=$}{\param{const wxPrintSetupData\&}{ data}}

Assigns print setup data to this object. wxPrintSetupData is deprecated,
but retained for backward compatibility.

\section{\class{wxPrintDialog}}\label{wxprintdialog}

This class represents the print and print setup common dialogs.
You may obtain a \helpref{wxPrinterDC}{wxprinterdc} device context from
a successfully dismissed print dialog.

\wxheading{Derived from}

\helpref{wxDialog}{wxdialog}\\
\helpref{wxWindow}{wxwindow}\\
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}

\wxheading{Include files}

<wx/printdlg.h>

\wxheading{See also}

\helpref{wxPrintDialog Overview}{wxprintdialogoverview}

\latexignore{\rtfignore{\wxheading{Members}}}


\membersection{wxPrintDialog::wxPrintDialog}\label{wxprintdialogctor}

\func{}{wxPrintDialog}{\param{wxWindow* }{parent}, \param{wxPrintDialogData* }{data = NULL}}

Constructor. Pass a parent window, and optionally a pointer to a block of print
data, which will be copied to the print dialog's print data.

\wxheading{See also}

\helpref{wxPrintDialogData}{wxprintdialogdata}


\membersection{wxPrintDialog::\destruct{wxPrintDialog}}\label{wxprintdialogdtor}

\func{}{\destruct{wxPrintDialog}}{\void}

Destructor. If wxPrintDialog::GetPrintDC has {\it not} been called,
the device context obtained by the dialog (if any) will be deleted.


\membersection{wxPrintDialog::GetPrintDialogData}\label{wxprintdialoggetprintdialogdata}

\func{wxPrintDialogData\&}{GetPrintDialogData}{\void}

Returns the \helpref{print dialog data}{wxprintdialogdata} associated with the print dialog.


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?