dialog.tex

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

TEX
513
字号
\func{int}{GetReturnCode}{\void}

Gets the return code for this window.

\wxheading{Remarks}

A return code is normally associated with a modal dialog, where \helpref{wxDialog::ShowModal}{wxdialogshowmodal} returns
a code to the application.

\wxheading{See also}

\helpref{wxDialog::SetReturnCode}{wxdialogsetreturncode}, \helpref{wxDialog::ShowModal}{wxdialogshowmodal},\rtfsp
\helpref{wxDialog::EndModal}{wxdialogendmodal}


\membersection{wxDialog::GetToolBar}\label{wxdialoggettoolbar}

\constfunc{wxToolBar*}{GetToolBar}{\void}

On PocketPC, a dialog is automatically provided with an empty toolbar. GetToolBar
allows you to access the toolbar and add tools to it. Removing tools and adding
arbitrary controls are not currently supported.

This function is not available on any other platform.


\membersection{wxDialog::Iconize}\label{wxdialogiconized}

\func{void}{Iconize}{\param{const bool}{ iconize}}

Iconizes or restores the dialog. Windows only.

\wxheading{Parameters}

\docparam{iconize}{If true, iconizes the dialog box; if false, shows and restores it.}

\wxheading{Remarks}

Note that in Windows, iconization has no effect since dialog boxes cannot be
iconized. However, applications may need to explicitly restore dialog
boxes under Motif which have user-iconizable frames, and under Windows
calling {\tt Iconize(false)} will bring the window to the front, as does
\rtfsp{\tt Show(true)}.


\membersection{wxDialog::IsIconized}\label{wxdialogisiconized}

\constfunc{bool}{IsIconized}{\void}

Returns true if the dialog box is iconized. Windows only.

\wxheading{Remarks}

Always returns false under Windows since dialogs cannot be iconized.


\membersection{wxDialog::IsModal}\label{wxdialogismodal}

\constfunc{bool}{IsModal}{\void}

Returns true if the dialog box is modal, false otherwise.


\membersection{wxDialog::OnApply}\label{wxdialogonapply}

\func{void}{OnApply}{\param{wxCommandEvent\& }{event}}

The default handler for the wxID\_APPLY identifier.

\wxheading{Remarks}

This function calls \helpref{wxWindow::Validate}{wxwindowvalidate} and \helpref{wxWindow::TransferDataFromWindow}{wxwindowtransferdatafromwindow}.

\wxheading{See also}

\helpref{wxDialog::OnOK}{wxdialogonok}, \helpref{wxDialog::OnCancel}{wxdialogoncancel}


\membersection{wxDialog::OnCancel}\label{wxdialogoncancel}

\func{void}{OnCancel}{\param{wxCommandEvent\& }{event}}

The default handler for the wxID\_CANCEL identifier.

\wxheading{Remarks}

The function either calls {\bf EndModal(wxID\_CANCEL)} if the dialog is modal, or
sets the return value to wxID\_CANCEL and calls {\bf Show(false)} if the dialog is modeless.

\wxheading{See also}

\helpref{wxDialog::OnOK}{wxdialogonok}, \helpref{wxDialog::OnApply}{wxdialogonapply}


\membersection{wxDialog::OnOK}\label{wxdialogonok}

\func{void}{OnOK}{\param{wxCommandEvent\& }{event}}

The default handler for the wxID\_OK identifier.

\wxheading{Remarks}

The function calls
\rtfsp\helpref{wxWindow::Validate}{wxwindowvalidate}, then \helpref{wxWindow::TransferDataFromWindow}{wxwindowtransferdatafromwindow}.
If this returns true, the function either calls {\bf EndModal(wxID\_OK)} if the dialog is modal, or
sets the return value to wxID\_OK and calls {\bf Show(false)} if the dialog is modeless.

\wxheading{See also}

\helpref{wxDialog::OnCancel}{wxdialogoncancel}, \helpref{wxDialog::OnApply}{wxdialogonapply}


\membersection{wxDialog::OnSysColourChanged}\label{wxdialogonsyscolourchanged}

\func{void}{OnSysColourChanged}{\param{wxSysColourChangedEvent\& }{event}}

The default handler for wxEVT\_SYS\_COLOUR\_CHANGED.

\wxheading{Parameters}

\docparam{event}{The colour change event.}

\wxheading{Remarks}

Changes the dialog's colour to conform to the current settings (Windows only).
Add an event table entry for your dialog class if you wish the behaviour
to be different (such as keeping a user-defined
background colour). If you do override this function, call wxEvent::Skip to
propagate the notification to child windows and controls.

\wxheading{See also}

\helpref{wxSysColourChangedEvent}{wxsyscolourchangedevent}


\membersection{wxDialog::SetAffirmativeId}\label{wxdialogsetaffirmativeid}

\func{void}{SetAffirmativeId}{\param{int }{id}}

Sets the identifier to be used when the user presses an OK button in a PocketPC titlebar.
By default, this is wxID\_OK.

\wxheading{See also}

\helpref{wxDialog::GetAffirmativeId}{wxdialoggetaffirmativeid}


\membersection{wxDialog::SetEscapeId}\label{wxdialogsetescapeid}

\func{void}{SetEscapeId}{\param{int }{id}}

Sets the identifier to be used when the user presses \texttt{\textsc{ESC}}
button in the dialog. By default, this is \texttt{wxID\_ANY} meaning that
the first suitable button is used: if there a \texttt{wxID\_CANCEL} button, it
is activated, otherwise \texttt{wxID\_OK} button is activated if present.
Another possible special value for \arg{id} is \texttt{wxID\_NONE} meaning that
\texttt{\textsc{ESC}} presses should be ignored. If another value is given, it
is interpreted as the id of the button to map the escape key to.


\membersection{wxDialog::SetIcon}\label{wxdialogseticon}

\func{void}{SetIcon}{\param{const wxIcon\& }{icon}}

Sets the icon for this dialog.

\wxheading{Parameters}

\docparam{icon}{The icon to associate with this dialog.}

See also \helpref{wxIcon}{wxicon}.


\membersection{wxDialog::SetIcons}\label{wxdialogseticons}

\func{void}{SetIcons}{\param{const wxIconBundle\& }{icons}}

Sets the icons for this dialog.

\wxheading{Parameters}

\docparam{icons}{The icons to associate with this dialog.}

See also \helpref{wxIconBundle}{wxiconbundle}.


\membersection{wxDialog::SetModal}\label{wxdialogsetmodal}

\func{void}{SetModal}{\param{const bool}{ flag}}

{\bf NB:} This function is deprecated and doesn't work for all ports, just use
\helpref{ShowModal}{wxdialogshowmodal} to show a modal dialog instead.

Allows the programmer to specify whether the dialog box is modal (wxDialog::Show blocks control
until the dialog is hidden) or modeless (control returns immediately).

\wxheading{Parameters}

\docparam{flag}{If true, the dialog will be modal, otherwise it will be modeless.}


\membersection{wxDialog::SetReturnCode}\label{wxdialogsetreturncode}

\func{void}{SetReturnCode}{\param{int }{retCode}}

Sets the return code for this window.

\wxheading{Parameters}

\docparam{retCode}{The integer return code, usually a control identifier.}

\wxheading{Remarks}

A return code is normally associated with a modal dialog, where \helpref{wxDialog::ShowModal}{wxdialogshowmodal} returns
a code to the application. The function \helpref{wxDialog::EndModal}{wxdialogendmodal} calls {\bf SetReturnCode}.

\wxheading{See also}

\helpref{wxDialog::GetReturnCode}{wxdialoggetreturncode}, \helpref{wxDialog::ShowModal}{wxdialogshowmodal},\rtfsp
\helpref{wxDialog::EndModal}{wxdialogendmodal}


\membersection{wxDialog::Show}\label{wxdialogshow}

\func{bool}{Show}{\param{const bool}{ show}}

Hides or shows the dialog.

\wxheading{Parameters}

\docparam{show}{If true, the dialog box is shown and brought to the front;
otherwise the box is hidden. If false and the dialog is
modal, control is returned to the calling program.}

\wxheading{Remarks}

The preferred way of dismissing a modal dialog is to use \helpref{wxDialog::EndModal}{wxdialogendmodal}.


\membersection{wxDialog::ShowModal}\label{wxdialogshowmodal}

\func{int}{ShowModal}{\void}

Shows a modal dialog. Program flow does not return until the dialog has been dismissed with\rtfsp
\helpref{wxDialog::EndModal}{wxdialogendmodal}.

\wxheading{Return value}

The return value is the value set with \helpref{wxDialog::SetReturnCode}{wxdialogsetreturncode}.

\wxheading{See also}

\helpref{wxDialog::EndModal}{wxdialogendmodal},\rtfsp
\helpref{wxDialog:GetReturnCode}{wxdialoggetreturncode},\rtfsp
\helpref{wxDialog::SetReturnCode}{wxdialogsetreturncode}

⌨️ 快捷键说明

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