window.tex
来自「Wxpython Implemented on Windows CE, Sou」· TEX 代码 · 共 1,841 行 · 第 1/5 页
TEX
1,841 行
\wxheading{See also}
\helpref{Window deletion overview}{windowdeletionoverview},\rtfsp
\helpref{wxWindow::Destroy}{wxwindowdestroy},\rtfsp
\helpref{wxCloseEvent}{wxcloseevent}
\membersection{wxWindow::ConvertDialogToPixels}\label{wxwindowconvertdialogtopixels}
\func{wxPoint}{ConvertDialogToPixels}{\param{const wxPoint\&}{ pt}}
\func{wxSize}{ConvertDialogToPixels}{\param{const wxSize\&}{ sz}}
Converts a point or size from dialog units to pixels.
For the x dimension, the dialog units are multiplied by the average character width
and then divided by 4.
For the y dimension, the dialog units are multiplied by the average character height
and then divided by 8.
\wxheading{Remarks}
Dialog units are used for maintaining a dialog's proportions even if the font changes.
You can also use these functions programmatically. A convenience macro is defined:
{\small
\begin{verbatim}
#define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt)
\end{verbatim}
}
\wxheading{See also}
\helpref{wxWindow::ConvertPixelsToDialog}{wxwindowconvertpixelstodialog}
\pythonnote{In place of a single overloaded method name, wxPython
implements the following methods:\par
\indented{2cm}{\begin{twocollist}
\twocolitem{{\bf ConvertDialogPointToPixels(point)}}{Accepts and returns a wxPoint}
\twocolitem{{\bf ConvertDialogSizeToPixels(size)}}{Accepts and returns a wxSize}
\end{twocollist}}
Additionally, the following helper functions are defined:\par
\indented{2cm}{\begin{twocollist}
\twocolitem{{\bf wxDLG\_PNT(win, point)}}{Converts a wxPoint from dialog
units to pixels}
\twocolitem{{\bf wxDLG\_SZE(win, size)}}{Converts a wxSize from dialog
units to pixels}
\end{twocollist}}
}
\membersection{wxWindow::ConvertPixelsToDialog}\label{wxwindowconvertpixelstodialog}
\func{wxPoint}{ConvertPixelsToDialog}{\param{const wxPoint\&}{ pt}}
\func{wxSize}{ConvertPixelsToDialog}{\param{const wxSize\&}{ sz}}
Converts a point or size from pixels to dialog units.
For the x dimension, the pixels are multiplied by 4 and then divided by the average
character width.
For the y dimension, the pixels are multiplied by 8 and then divided by the average
character height.
\wxheading{Remarks}
Dialog units are used for maintaining a dialog's proportions even if the font changes.
\wxheading{See also}
\helpref{wxWindow::ConvertDialogToPixels}{wxwindowconvertdialogtopixels}
\pythonnote{In place of a single overloaded method name, wxPython implements the following methods:\par
\indented{2cm}{\begin{twocollist}
\twocolitem{{\bf ConvertDialogPointToPixels(point)}}{Accepts and returns a wxPoint}
\twocolitem{{\bf ConvertDialogSizeToPixels(size)}}{Accepts and returns a wxSize}
\end{twocollist}}
}
\membersection{wxWindow::Destroy}\label{wxwindowdestroy}
\func{virtual bool}{Destroy}{\void}
Destroys the window safely. Use this function instead of the delete operator, since
different window classes can be destroyed differently. Frames and dialogs
are not destroyed immediately when this function is called -- they are added
to a list of windows to be deleted on idle time, when all the window's events
have been processed. This prevents problems with events being sent to non-existent
windows.
\wxheading{Return value}
{\tt true} if the window has either been successfully deleted, or it has been added
to the list of windows pending real deletion.
\membersection{wxWindow::DestroyChildren}\label{wxwindowdestroychildren}
\func{virtual void}{DestroyChildren}{\void}
Destroys all children of a window. Called automatically by the destructor.
\membersection{wxWindow::Disable}\label{wxwindowdisable}
\func{bool}{Disable}{\void}
Disables the window, same as \helpref{Enable({\tt false})}{wxwindowenable}.
\wxheading{Return value}
Returns {\tt true} if the window has been disabled, {\tt false} if it had been
already disabled before the call to this function.
\membersection{wxWindow::DoGetBestSize}\label{wxwindowdogetbestsize}
\constfunc{virtual wxSize}{DoGetBestSize}{\void}
Gets the size which best suits the window: for a control, it would be
the minimal size which doesn't truncate the control, for a panel - the
same size as it would have after a call to \helpref{Fit()}{wxwindowfit}.
\membersection{wxWindow::DoUpdateWindowUI}\label{wxwindowdoupdatewindowui}
\func{virtual void}{DoUpdateWindowUI}{\param{wxUpdateUIEvent\&}{ event}}
Does the window-specific updating after processing the update event.
This function is called by \helpref{wxWindow::UpdateWindowUI}{wxwindowupdatewindowui}
in order to check return values in the \helpref{wxUpdateUIEvent}{wxupdateuievent} and
act appropriately. For example, to allow frame and dialog title updating, wxWidgets
implements this function as follows:
\begin{verbatim}
// do the window-specific processing after processing the update event
void wxTopLevelWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
{
if ( event.GetSetEnabled() )
Enable(event.GetEnabled());
if ( event.GetSetText() )
{
if ( event.GetText() != GetTitle() )
SetTitle(event.GetText());
}
}
\end{verbatim}
\membersection{wxWindow::DragAcceptFiles}\label{wxwindowdragacceptfiles}
\func{virtual void}{DragAcceptFiles}{\param{bool}{ accept}}
Enables or disables eligibility for drop file events (OnDropFiles).
\wxheading{Parameters}
\docparam{accept}{If {\tt true}, the window is eligible for drop file events. If {\tt false}, the window
will not accept drop file events.}
\wxheading{Remarks}
Windows only.
\membersection{wxWindow::Enable}\label{wxwindowenable}
\func{virtual bool}{Enable}{\param{bool}{ enable = {\tt true}}}
Enable or disable the window for user input. Note that when a parent window is
disabled, all of its children are disabled as well and they are reenabled again
when the parent is.
\wxheading{Parameters}
\docparam{enable}{If {\tt true}, enables the window for input. If {\tt false}, disables the window.}
\wxheading{Return value}
Returns {\tt true} if the window has been enabled or disabled, {\tt false} if
nothing was done, i.e. if the window had already been in the specified state.
\wxheading{See also}
\helpref{wxWindow::IsEnabled}{wxwindowisenabled},\rtfsp
\helpref{wxWindow::Disable}{wxwindowdisable},\rtfsp
\helpref{wxRadioBox::Enable}{wxradioboxenable}
\membersection{wxWindow::FindFocus}\label{wxwindowfindfocus}
\func{static wxWindow*}{FindFocus}{\void}
Finds the window or control which currently has the keyboard focus.
\wxheading{Remarks}
Note that this is a static function, so it can be called without needing a wxWindow pointer.
\wxheading{See also}
\helpref{wxWindow::SetFocus}{wxwindowsetfocus}
\membersection{wxWindow::FindWindow}\label{wxwindowfindwindow}
\constfunc{wxWindow*}{FindWindow}{\param{long}{ id}}
Find a child of this window, by identifier.
\constfunc{wxWindow*}{FindWindow}{\param{const wxString\&}{ name}}
Find a child of this window, by name.
\pythonnote{In place of a single overloaded method name, wxPython
implements the following methods:\par
\indented{2cm}{\begin{twocollist}
\twocolitem{{\bf FindWindowById(id)}}{Accepts an integer}
\twocolitem{{\bf FindWindowByName(name)}}{Accepts a string}
\end{twocollist}}
}
\membersection{wxWindow::FindWindowById}\label{wxwindowfindwindowbyid}
\func{static wxWindow*}{FindWindowById}{\param{long}{ id}, \param{wxWindow*}{ parent = NULL}}
Find the first window with the given {\it id}.
If {\it parent} is NULL, the search will start from all top-level
frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy.
The search is recursive in both cases.
\wxheading{See also}
\helpref{FindWindow}{wxwindowfindwindow}
\membersection{wxWindow::FindWindowByLabel}\label{wxwindowfindwindowbylabel}
\func{static wxWindow*}{FindWindowByLabel}{\param{const wxString\&}{ label}, \param{wxWindow*}{ parent = NULL}}
Find a window by its label. Depending on the type of window, the label may be a window title
or panel item label. If {\it parent} is NULL, the search will start from all top-level
frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy.
The search is recursive in both cases.
\wxheading{See also}
\helpref{FindWindow}{wxwindowfindwindow}
\membersection{wxWindow::FindWindowByName}\label{wxwindowfindwindowbyname}
\func{static wxWindow*}{FindWindowByName}{\param{const wxString\&}{ name}, \param{wxWindow*}{ parent = NULL}}
Find a window by its name (as given in a window constructor or {\bf Create} function call).
If {\it parent} is NULL, the search will start from all top-level
frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy.
The search is recursive in both cases.
If no window with such name is found,
\helpref{FindWindowByLabel}{wxwindowfindwindowbylabel} is called.
\wxheading{See also}
\helpref{FindWindow}{wxwindowfindwindow}
\membersection{wxWindow::Fit}\label{wxwindowfit}
\func{virtual void}{Fit}{\void}
Sizes the window so that it fits around its subwindows. This function won't do
anything if there are no subwindows and will only really work correctly if the
sizers are used for the subwindows layout. Also, if the window has exactly one
subwindow it is better (faster and the result is more precise as Fit adds some
margin to account for fuzziness of its calculations) to call
\begin{verbatim}
window->SetClientSize(child->GetSize());
\end{verbatim}
instead of calling Fit.
\membersection{wxWindow::FitInside}\label{wxwindowfitinside}
\func{virtual void}{FitInside}{\void}
Similar to \helpref{Fit}{wxwindowfit}, but sizes the interior (virtual) size
of a window. Mainly useful with scrolled windows to reset scrollbars after
sizing changes that do not trigger a size event, and/or scrolled windows without
an interior sizer. This function similarly won't do anything if there are no
subwindows.
\membersection{wxWindow::Freeze}\label{wxwindowfreeze}
\func{virtual void}{Freeze}{\void}
Freezes the window or, in other words, prevents any updates from taking place
on screen, the window is not redrawn at all. \helpref{Thaw}{wxwindowthaw} must
be called to reenable window redrawing. Calls to these two functions may be
nested.
This method is useful for visual appearance optimization (for example, it
is a good idea to use it before doing many large text insertions in a row into
a wxTextCtrl under wxGTK) but is not implemented on all platforms nor for all
controls so it is mostly just a hint to wxWidgets and not a mandatory
directive.
\wxheading{See also}
\helpref{wxWindowUpdateLocker}{wxwindowupdatelocker}
\membersection{wxWindow::GetAcceleratorTable}\label{wxwindowgetacceleratortable}
\constfunc{wxAcceleratorTable*}{GetAcceleratorTable}{\void}
Gets the accelerator table for this window. See \helpref{wxAcceleratorTable}{wxacceleratortable}.
\membersection{wxWindow::GetAccessible}\label{wxwindowgetaccessible}
\func{wxAccessible*}{GetAccessible}{\void}
Returns the accessible object for this window, if any.
See also \helpref{wxAccessible}{wxaccessible}.
\membersection{wxWindow::GetAdjustedBestSize}\label{wxwindowgetadjustedbestsize}
\constfunc{wxSize}{GetAdjustedBestSize}{\void}
This method is similar to \helpref{GetBestSize}{wxwindowgetbestsize}, except
in one thing. GetBestSize should return the minimum untruncated size of the
window, while this method will return the largest of BestSize and any user
specified minimum size. ie. it is the minimum size the window should currently
be drawn at, not the minimal size it can possibly tolerate.
\membersection{wxWindow::GetBackgroundColour}\label{wxwindowgetbackgroundcolour}
\constfunc{virtual wxColour}{GetBackgroundColour}{\void}
Returns the background colour of the window.
\wxheading{See also}
\helpref{wxWindow::SetBackgroundColour}{wxwindowsetbackgroundcolour},\rtfsp
\helpref{wxWindow::SetForegroundColour}{wxwindowsetforegroundcolour},\rtfsp
\helpref{wxWindow::GetForegroundColour}{wxwindowgetforegroundcolour}
\membersection{wxWindow::GetBackgroundStyle}\label{wxwindowgetbackgroundstyle}
\constfunc{virtual wxBackgroundStyle}{GetBackgroundStyle}{\void}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?