window.tex
来自「Wxpython Implemented on Windows CE, Sou」· TEX 代码 · 共 1,841 行 · 第 1/5 页
TEX
1,841 行
\helpref{wxWindow::SetName}{wxwindowsetname}
\membersection{wxWindow::GetParent}\label{wxwindowgetparent}
\constfunc{virtual wxWindow*}{GetParent}{\void}
Returns the parent of the window, or NULL if there is no parent.
\membersection{wxWindow::GetPosition}\label{wxwindowgetposition}
\constfunc{virtual void}{GetPosition}{\param{int* }{x}, \param{int* }{y}}
\constfunc{wxPoint}{GetPosition}{\void}
This gets the position of the window in pixels, relative to the parent window
for the child windows or relative to the display origin for the top level
windows.
\wxheading{Parameters}
\docparam{x}{Receives the x position of the window if non-\NULL.}
\docparam{y}{Receives the y position of the window if non-\NULL.}
\pythonnote{In place of a single overloaded method name, wxPython
implements the following methods:\par
\indented{2cm}{\begin{twocollist}
\twocolitem{{\bf GetPosition()}}{Returns a wxPoint}
\twocolitem{{\bf GetPositionTuple()}}{Returns a tuple (x, y)}
\end{twocollist}}
}
\perlnote{In wxPerl there are two methods instead of a single overloaded
method:\par
\indented{2cm}{\begin{twocollist}
\twocolitem{{\bf GetPosition()}}{Returns a Wx::Point}
\twocolitem{{\bf GetPositionXY()}}{Returns a 2-element list
{\tt ( x, y )}}
\end{twocollist}
}}
\wxheading{See also}
\helpref{GetScreenPosition}{wxwindowgetscreenposition}
\membersection{wxWindow::GetRect}\label{wxwindowgetrect}
\constfunc{virtual wxRect}{GetRect}{\void}
Returns the size and position of the window as a \helpref{wxRect}{wxrect} object.
\wxheading{See also}
\helpref{GetScreenRect}{wxwindowgetscreenrect}
\membersection{wxWindow::GetScreenPosition}\label{wxwindowgetscreenposition}
\constfunc{virtual void}{GetScreenPosition}{\param{int* }{x}, \param{int* }{y}}
\constfunc{wxPoint}{GetScreenPosition}{\void}
Returns the window position in screen coordinates, whether the window is a
child window or a top level one.
\wxheading{Parameters}
\docparam{x}{Receives the x position of the window on the screen if non-\NULL.}
\docparam{y}{Receives the y position of the window on the screen if non-\NULL.}
\wxheading{See also}
\helpref{GetPosition}{wxwindowgetposition}
\membersection{wxWindow::GetScreenRect}\label{wxwindowgetscreenrect}
\constfunc{virtual wxRect}{GetScreenRect}{\void}
Returns the size and position of the window on the screen as a
\helpref{wxRect}{wxrect} object.
\wxheading{See also}
\helpref{GetRect}{wxwindowgetrect}
\membersection{wxWindow::GetScrollPos}\label{wxwindowgetscrollpos}
\func{virtual int}{GetScrollPos}{\param{int }{orientation}}
Returns the built-in scrollbar position.
\wxheading{See also}
See \helpref{wxWindow::SetScrollbar}{wxwindowsetscrollbar}
\membersection{wxWindow::GetScrollRange}\label{wxwindowgetscrollrange}
\func{virtual int}{GetScrollRange}{\param{int }{orientation}}
Returns the built-in scrollbar range.
\wxheading{See also}
\helpref{wxWindow::SetScrollbar}{wxwindowsetscrollbar}
\membersection{wxWindow::GetScrollThumb}\label{wxwindowgetscrollthumb}
\func{virtual int}{GetScrollThumb}{\param{int }{orientation}}
Returns the built-in scrollbar thumb size.
\wxheading{See also}
\helpref{wxWindow::SetScrollbar}{wxwindowsetscrollbar}
\membersection{wxWindow::GetSize}\label{wxwindowgetsize}
\constfunc{void}{GetSize}{\param{int* }{width}, \param{int* }{height}}
\constfunc{wxSize}{GetSize}{\void}
This gets the size of the entire window in pixels,
including title bar, border, scrollbars, etc.
\wxheading{Parameters}
\docparam{width}{Receives the window width.}
\docparam{height}{Receives the window height.}
\pythonnote{In place of a single overloaded method name, wxPython
implements the following methods:\par
\indented{2cm}{\begin{twocollist}
\twocolitem{{\bf GetSize()}}{Returns a wxSize}
\twocolitem{{\bf GetSizeTuple()}}{Returns a 2-tuple (width, height)}
\end{twocollist}}
}
\perlnote{In wxPerl there are two methods instead of a single overloaded
method:\par
\indented{2cm}{\begin{twocollist}
\twocolitem{{\bf GetSize()}}{Returns a Wx::Size}
\twocolitem{{\bf GetSizeWH()}}{Returns a 2-element list
{\tt ( width, height )}}
\end{twocollist}
}}
\wxheading{See also}
\helpref{GetClientSize}{wxwindowgetclientsize},\rtfsp
\helpref{GetVirtualSize}{wxwindowgetvirtualsize}
\membersection{wxWindow::GetSizer}\label{wxwindowgetsizer}
\constfunc{wxSizer *}{GetSizer}{\void}
Return the sizer associated with the window by a previous call to
\helpref{SetSizer()}{wxwindowsetsizer} or {\tt NULL}.
\membersection{wxWindow::GetTextExtent}\label{wxwindowgettextextent}
\constfunc{virtual void}{GetTextExtent}{\param{const wxString\& }{string}, \param{int* }{x}, \param{int* }{y},
\param{int* }{descent = NULL}, \param{int* }{externalLeading = NULL},
\param{const wxFont* }{font = NULL}, \param{bool}{ use16 = {\tt false}}}
Gets the dimensions of the string as it would be drawn on the
window with the currently selected font.
\wxheading{Parameters}
\docparam{string}{String whose extent is to be measured.}
\docparam{x}{Return value for width.}
\docparam{y}{Return value for height.}
\docparam{descent}{Return value for descent (optional).}
\docparam{externalLeading}{Return value for external leading (optional).}
\docparam{font}{Font to use instead of the current window font (optional).}
\docparam{use16}{If {\tt true}, {\it string} contains 16-bit characters. The default is {\tt false}.}
\pythonnote{In place of a single overloaded method name, wxPython
implements the following methods:\par
\indented{2cm}{\begin{twocollist}
\twocolitem{{\bf GetTextExtent(string)}}{Returns a 2-tuple, (width, height)}
\twocolitem{{\bf GetFullTextExtent(string, font=NULL)}}{Returns a
4-tuple, (width, height, descent, externalLeading) }
\end{twocollist}}
}
\perlnote{In wxPerl this method takes only the {\tt string} and optionally
{\tt font} parameters, and returns a 4-element list
{\tt ( x, y, descent, externalLeading )}.}
\membersection{wxWindow::GetToolTip}\label{wxwindowgettooltip}
\constfunc{wxToolTip*}{GetToolTip}{\void}
Get the associated tooltip or NULL if none.
\membersection{wxWindow::GetUpdateRegion}\label{wxwindowgetupdateregion}
\constfunc{virtual wxRegion}{GetUpdateRegion}{\void}
Returns the region specifying which parts of the window have been damaged. Should
only be called within an \helpref{wxPaintEvent}{wxpaintevent} handler.
\wxheading{See also}
\helpref{wxRegion}{wxregion},\rtfsp
\helpref{wxRegionIterator}{wxregioniterator}
\membersection{wxWindow::GetValidator}\label{wxwindowgetvalidator}
\constfunc{wxValidator*}{GetValidator}{\void}
Returns a pointer to the current validator for the window, or NULL if there is none.
\membersection{wxWindow::GetVirtualSize}\label{wxwindowgetvirtualsize}
\constfunc{void}{GetVirtualSize}{\param{int* }{width}, \param{int* }{height}}
\constfunc{wxSize}{GetVirtualSize}{\void}
This gets the virtual size of the window in pixels. By default it
returns the client size of the window, but after a call to
\helpref{SetVirtualSize}{wxwindowsetvirtualsize} it will return
that size.
\wxheading{Parameters}
\docparam{width}{Receives the window virtual width.}
\docparam{height}{Receives the window virtual height.}
\helpref{GetSize}{wxwindowgetsize},\rtfsp
\helpref{GetClientSize}{wxwindowgetclientsize}
\membersection{wxWindow::GetWindowStyleFlag}\label{wxwindowgetwindowstyleflag}
\constfunc{long}{GetWindowStyleFlag}{\void}
Gets the window style that was passed to the constructor or {\bf Create}
method. {\bf GetWindowStyle()} is another name for the same function.
\membersection{wxWindow::GetWindowVariant}\label{wxwindowgetwindowvariant}
\constfunc{wxWindowVariant}{GetWindowVariant}{\void}
Returns the value previously passed to
\helpref{wxWindow::SetWindowVariant}{wxwindowsetwindowvariant}.
\membersection{wxWindow::HasCapture}\label{wxwindowhascapture}
\constfunc{virtual bool}{HasCapture}{\void}
Returns {\tt true} if this window has the current mouse capture.
\wxheading{See also}
\helpref{wxWindow::CaptureMouse}{wxwindowcapturemouse},
\helpref{wxWindow::ReleaseMouse}{wxwindowreleasemouse},
\helpref{wxMouseCaptureChangedEvent}{wxmousecapturechangedevent}
\membersection{wxWindow::HasFlag}\label{wxwindowhasflag}
\constfunc{bool}{HasFlag}{\param{int }{flag}}
Returns \texttt{true} if the window has the given \arg{flag} bit set.
\membersection{wxWindow::HasScrollbar}\label{wxwindowhasscrollbar}
\constfunc{virtual bool}{HasScrollbar}{\param{int }{orient}}
Returns {\tt true} if this window has a scroll bar for this orientation.
\wxheading{Parameters}
\docparam{orient}{Orientation to check, either {\tt wxHORIZONTAL} or {\tt wxVERTICAL}.}
\membersection{wxWindow::HasTransparentBackground}\label{wxwindowhastransparentbackground}
\constfunc{virtual bool}{HasTransparentBackground}{\void}
Returns \true if this window background is transparent (as, for example, for
wxStaticText) and should show the parent window background.
This method is mostly used internally by the library itself and you normally
shouldn't have to call it. You may, however, have to override it in your
wxWindow-derived class to ensure that background is painted correctly.
\membersection{wxWindow::Hide}\label{wxwindowhide}
\func{bool}{Hide}{\void}
Equivalent to calling \helpref{Show}{wxwindowshow}({\tt false}).
\membersection{wxWindow::InheritAttributes}\label{wxwindowinheritattributes}
\func{void}{InheritAttributes}{\void}
This function is (or should be, in case of custom controls) called during
window creation to intelligently set up the window visual attributes, that is
the font and the foreground and background colours.
By ``intelligently'' the following is meant: by default, all windows use their
own \helpref{default}{wxwindowgetclassdefaultattributes} attributes. However
if some of the parents attributes are explicitly (that is, using
\helpref{SetFont}{wxwindowsetfont} and not
\helpref{SetOwnFont}{wxwindowsetownfont}) changed \emph{and} if the
corresponding attribute hadn't been explicitly set for this window itself,
then this window takes the same value as used by the parent. In addition, if
the window overrides \helpref{ShouldInheritColours}{wxwindowshouldinheritcolours}
to return \false, the colours will not be changed no matter what and only the
font might.
This rather complicated logic is necessary in order to accommodate the
different usage scenarios. The most common one is when all default attributes
are used and in this case, nothing should be inherited as in modern GUIs
different controls use different fonts (and colours) than their siblings so
they can't inherit the same value from the parent. However it was also deemed
desirable to allow to simply change the attributes of all children at once by
just changing the font or colour of their common parent, hence in this case we
do inherit the parents attributes.
\membersection{wxWindow::InitDialog}\label{wxwindowinitdialog}
\func{void}{InitDialog}{\void}
Sends an {\tt wxEVT\_INIT\_DIALOG} event, whose handler usually transfers data
to the dialog via validators.
\membersection{wxWindow::InvalidateBestSize}\label{wxwindowinvalidatebestsize}
\func{void}{InvalidateBestSize}{\void}
Resets the cached best size value so it will be recalculated the next time it is needed.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?