window.tex

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

TEX
1,841
字号

Returns the background style of the window. The background style indicates
whether background colour should be determined by the system (wxBG\_STYLE\_SYSTEM),
be set to a specific colour (wxBG\_STYLE\_COLOUR), or should be left to the
application to implement (wxBG\_STYLE\_CUSTOM).

On GTK+, use of wxBG\_STYLE\_CUSTOM allows the flicker-free drawing of a custom
background, such as a tiled bitmap. Currently the style has no effect on other platforms.

\wxheading{See also}

\helpref{wxWindow::SetBackgroundColour}{wxwindowsetbackgroundcolour},\rtfsp
\helpref{wxWindow::GetForegroundColour}{wxwindowgetforegroundcolour},\rtfsp
\helpref{wxWindow::SetBackgroundStyle}{wxwindowsetbackgroundstyle}

\membersection{wxWindow::GetBestFittingSize}\label{wxwindowgetbestfittingsize}

\constfunc{wxSize}{GetBestFittingSize}{\void}

Merges the window's best size into the min size and returns the result.

\wxheading{See also}

\helpref{wxWindow::GetBestSize}{wxwindowgetbestsize},\rtfsp
\helpref{wxWindow::SetBestFittingSize}{wxwindowsetbestfittingsize},\rtfsp
\helpref{wxWindow::SetSizeHints}{wxwindowsetsizehints}


\membersection{wxWindow::GetBestSize}\label{wxwindowgetbestsize}

\constfunc{wxSize}{GetBestSize}{\void}

This functions returns the best acceptable minimal size for the window. For
example, for a static control, it will be the minimal size such that the
control label is not truncated. For windows containing subwindows (typically
\helpref{wxPanel}{wxpanel}), the size returned by this function will be the
same as the size the window would have had after calling
\helpref{Fit}{wxwindowfit}.


\membersection{wxWindow::GetCapture}\label{wxwindowgetcapture}

\func{static wxWindow *}{GetCapture}{\void}

Returns the currently captured window.

\wxheading{See also}

\helpref{wxWindow::HasCapture}{wxwindowhascapture},
\helpref{wxWindow::CaptureMouse}{wxwindowcapturemouse},
\helpref{wxWindow::ReleaseMouse}{wxwindowreleasemouse},
\helpref{wxMouseCaptureChangedEvent}{wxmousecapturechangedevent}


\membersection{wxWindow::GetCaret}\label{wxwindowgetcaret}

\constfunc{wxCaret *}{GetCaret}{\void}

Returns the \helpref{caret}{wxcaret} associated with the window.


\membersection{wxWindow::GetCharHeight}\label{wxwindowgetcharheight}

\constfunc{virtual int}{GetCharHeight}{\void}

Returns the character height for this window.


\membersection{wxWindow::GetCharWidth}\label{wxwindowgetcharwidth}

\constfunc{virtual int}{GetCharWidth}{\void}

Returns the average character width for this window.


\membersection{wxWindow::GetChildren}\label{wxwindowgetchildren}

\func{wxWindowList\&}{GetChildren}{\void}

\constfunc{const wxWindowList\&}{GetChildren}{\void}

Returns a reference to the list of the window's children. \texttt{wxWindowList} 
is a type-safe \helpref{wxList}{wxlist}-like class whose elements are of type
\texttt{wxWindow *}.


\membersection{wxWindow::GetClassDefaultAttributes}\label{wxwindowgetclassdefaultattributes}

\func{static wxVisualAttributes}{GetClassDefaultAttributes}{\param{wxWindowVariant}{ variant = \texttt{wxWINDOW\_VARIANT\_NORMAL}}}

Returns the default font and colours which are used by the control. This is
useful if you want to use the same font or colour in your own control as in a
standard control -- which is a much better idea than hard coding specific
colours or fonts which might look completely out of place on the users
system, especially if it uses themes.

The \arg{variant} parameter is only relevant under Mac currently and is
ignore under other platforms. Under Mac, it will change the size of the
returned font. See \helpref{wxWindow::SetWindowVariant}{wxwindowsetwindowvariant}
for more about this.

This static method is ``overridden'' in many derived classes and so calling,
for example, \helpref{wxButton}{wxbutton}::GetClassDefaultAttributes() will typically
return the values appropriate for a button which will be normally different
from those returned by, say, \helpref{wxListCtrl}{wxlistctrl}::GetClassDefaultAttributes().

The \texttt{wxVisualAttributes} structure has at least the fields
\texttt{font}, \texttt{colFg} and \texttt{colBg}. All of them may be invalid
if it was not possible to determine the default control appearance or,
especially for the background colour, if the field doesn't make sense as is
the case for \texttt{colBg} for the controls with themed background.

\wxheading{See also}

\helpref{InheritAttributes}{wxwindowinheritattributes}


\membersection{wxWindow::GetClientSize}\label{wxwindowgetclientsize}

\constfunc{void}{GetClientSize}{\param{int* }{width}, \param{int* }{height}}

\perlnote{In wxPerl this method takes no parameter and returns
a 2-element list {\tt (width, height)}.}

\constfunc{wxSize}{GetClientSize}{\void}

This gets the size of the window `client area' in pixels.
The client area is the area which may be drawn on by the programmer,
excluding title bar, border, scrollbars, etc.

\wxheading{Parameters}

\docparam{width}{Receives the client width in pixels.}

\docparam{height}{Receives the client height in pixels.}

\pythonnote{In place of a single overloaded method name, wxPython
implements the following methods:\par
\indented{2cm}{\begin{twocollist}
\twocolitem{{\bf GetClientSizeTuple()}}{Returns a 2-tuple of (width, height)}
\twocolitem{{\bf GetClientSize()}}{Returns a wxSize object}
\end{twocollist}}
}

\wxheading{See also}

\helpref{GetSize}{wxwindowgetsize},\rtfsp
\helpref{GetVirtualSize}{wxwindowgetvirtualsize}



\membersection{wxWindow::GetConstraints}\label{wxwindowgetconstraints}

\constfunc{wxLayoutConstraints*}{GetConstraints}{\void}

Returns a pointer to the window's layout constraints, or NULL if there are none.


\membersection{wxWindow::GetContainingSizer}\label{wxwindowgetcontainingsizer}

\constfunc{const wxSizer *}{GetContainingSizer}{\void}

Return the sizer that this window is a member of, if any, otherwise
{\tt NULL}.


\membersection{wxWindow::GetCursor}\label{wxwindowgetcursor}

\constfunc{const wxCursor\&}{GetCursor}{\void}

Return the cursor associated with this window.

\wxheading{See also}

\helpref{wxWindow::SetCursor}{wxwindowsetcursor}


\membersection{wxWindow::GetDefaultAttributes}\label{wxwindowgetdefaultattributes}

\constfunc{virtual wxVisualAttributes}{GetDefaultAttributes}{\void}

Currently this is the same as calling
\helpref{GetClassDefaultAttributes}{wxwindowgetclassdefaultattributes}(\helpref{GetWindowVariant}{wxwindowgetwindowvariant}()).

One advantage of using this function compared to the static version is that
the call is automatically dispatched to the correct class (as usual with
virtual functions) and you don't have to specify the class name explicitly.

The other one is that in the future this function could return different
results, for example it might return a different font for an ``Ok'' button
than for a generic button if the users GUI is configured to show such buttons
in bold font. Of course, the down side is that it is impossible to call this
function without actually having an object to apply it to whereas the static
version can be used without having to create an object first.


\membersection{wxWindow::GetDropTarget}\label{wxwindowgetdroptarget}

\constfunc{wxDropTarget*}{GetDropTarget}{\void}

Returns the associated drop target, which may be NULL.

\wxheading{See also}

\helpref{wxWindow::SetDropTarget}{wxwindowsetdroptarget},
\helpref{Drag and drop overview}{wxdndoverview}


\membersection{wxWindow::GetEventHandler}\label{wxwindowgeteventhandler}

\constfunc{wxEvtHandler*}{GetEventHandler}{\void}

Returns the event handler for this window. By default, the window is its
own event handler.

\wxheading{See also}

\helpref{wxWindow::SetEventHandler}{wxwindowseteventhandler},\rtfsp
\helpref{wxWindow::PushEventHandler}{wxwindowpusheventhandler},\rtfsp
\helpref{wxWindow::PopEventHandler}{wxwindowpusheventhandler},\rtfsp
\helpref{wxEvtHandler::ProcessEvent}{wxevthandlerprocessevent},\rtfsp
\helpref{wxEvtHandler}{wxevthandler}\rtfsp


\membersection{wxWindow::GetExtraStyle}\label{wxwindowgetextrastyle}

\constfunc{long}{GetExtraStyle}{\void}

Returns the extra style bits for the window.


\membersection{wxWindow::GetFont}\label{wxwindowgetfont}

\constfunc{wxFont}{GetFont}{\void}

Returns the font for this window.

\wxheading{See also}

\helpref{wxWindow::SetFont}{wxwindowsetfont}


\membersection{wxWindow::GetForegroundColour}\label{wxwindowgetforegroundcolour}

\func{virtual wxColour}{GetForegroundColour}{\void}

Returns the foreground colour of the window.

\wxheading{Remarks}

The interpretation of foreground colour is open to interpretation according
to the window class; it may be the text colour or other colour, or it may not
be used at all.

\wxheading{See also}

\helpref{wxWindow::SetForegroundColour}{wxwindowsetforegroundcolour},\rtfsp
\helpref{wxWindow::SetBackgroundColour}{wxwindowsetbackgroundcolour},\rtfsp
\helpref{wxWindow::GetBackgroundColour}{wxwindowgetbackgroundcolour}


\membersection{wxWindow::GetGrandParent}\label{wxwindowgetgrandparent}

\constfunc{wxWindow*}{GetGrandParent}{\void}

Returns the grandparent of a window, or NULL if there isn't one.


\membersection{wxWindow::GetHandle}\label{wxwindowgethandle}

\constfunc{void*}{GetHandle}{\void}

Returns the platform-specific handle of the physical window. Cast it to an appropriate
handle, such as {\bf HWND} for Windows, {\bf Widget} for Motif, {\bf GtkWidget} for GTK or {\bf WinHandle} for PalmOS.

\pythonnote{This method will return an integer in wxPython.}

\perlnote{This method will return an integer in wxPerl.}


\membersection{wxWindow::GetHelpTextAtPoint}\label{wxwindowgethelptextatpoint}

\constfunc{virtual wxString}{GetHelpTextAtPoint}{\param{const wxPoint &}{point}, \param{wxHelpEvent::Origin }{origin}}

Gets the help text to be used as context-sensitive help for this window. This
method should be overridden if the help message depends on the position inside
the window, otherwise \helpref{GetHelpText}{wxwindowgethelptext} can be used.

\wxheading{Parameters}

\docparam{point}{Coordinates of the mouse at the moment of help event emission.}

\docparam{origin}{Help event origin, see also \helpref{wxHelpEvent::GetOrigin}{wxhelpeventgetorigin}.}

\newsince{2.7.0}


\membersection{wxWindow::GetHelpText}\label{wxwindowgethelptext}

\constfunc{virtual wxString}{GetHelpText}{\void}

Gets the help text to be used as context-sensitive help for this window.

Note that the text is actually stored by the current \helpref{wxHelpProvider}{wxhelpprovider} implementation,
and not in the window object itself.

\wxheading{See also}

\helpref{SetHelpText}{wxwindowsethelptext}, \helpref{GetHelpTextAtPoint}{wxwindowgethelptextatpoint}, \helpref{wxHelpProvider}{wxhelpprovider}


\membersection{wxWindow::GetId}\label{wxwindowgetid}

\constfunc{int}{GetId}{\void}

Returns the identifier of the window.

\wxheading{Remarks}

Each window has an integer identifier. If the application has not provided one
(or the default wxID\_ANY) an unique identifier with a negative value will be generated.

\wxheading{See also}

\helpref{wxWindow::SetId}{wxwindowsetid},\rtfsp
\helpref{Window identifiers}{windowids}


\membersection{wxWindow::GetLabel}\label{wxwindowgetlabel}

\constfunc{virtual wxString }{GetLabel}{\void}

Generic way of getting a label from any window, for
identification purposes.

\wxheading{Remarks}

The interpretation of this function differs from class to class.
For frames and dialogs, the value returned is the title. For buttons or static text controls, it is
the button text. This function can be useful for meta-programs (such as testing
tools or special-needs access programs) which need to identify windows
by name.

\membersection{wxWindow::GetMaxSize}\label{wxwindowgetmaxsize}

\constfunc{wxSize}{GetMaxSize}{\void}

Returns the maximum size of the window, an indication to the sizer layout mechanism
that this is the maximum possible size.

\membersection{wxWindow::GetMinSize}\label{wxwindowgetminsize}

\constfunc{wxSize}{GetMinSize}{\void}

Returns the minimum size of the window, an indication to the sizer layout mechanism
that this is the minimum required size.

\membersection{wxWindow::GetName}\label{wxwindowgetname}

\constfunc{virtual wxString }{GetName}{\void}

Returns the window's name.

\wxheading{Remarks}

This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate
name in the window constructor or via \helpref{wxWindow::SetName}{wxwindowsetname}.

\wxheading{See also}

⌨️ 快捷键说明

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