comboctrl.tex
来自「Wxpython Implemented on Windows CE, Sou」· TEX 代码 · 共 635 行 · 第 1/2 页
TEX
635 行
Value returned is a combination of following flags:
\twocolwidtha{8cm}%
\begin{twocollist}\itemsep=0pt
\twocolitem{{\tt wxComboCtrlFeatures::MovableButton}}{Button can
be on either side of the control.}
\twocolitem{{\tt wxComboCtrlFeatures::BitmapButton}}{Button may
be replaced with bitmap.}
\twocolitem{{\tt wxComboCtrlFeatures::ButtonSpacing}}{Button can
have spacing.}
\twocolitem{{\tt wxComboCtrlFeatures::TextIndent}}{SetTextIndent
works.}
\twocolitem{{\tt wxComboCtrlFeatures::PaintControl}}{Combo control
itself can be custom painted.}
\twocolitem{{\tt wxComboCtrlFeatures::PaintWritable}}{A variable-
width area in front of writable combo control's textctrl can
be custom painted.}
\twocolitem{{\tt wxComboCtrlFeatures::Borderless}}{wxNO\_BORDER
window style works.}
\twocolitem{{\tt wxComboCtrlFeatures::All}}{All of the
above.}
\end{twocollist}
\membersection{wxComboCtrl::GetInsertionPoint}\label{wxcomboctrlgetinsertionpoint}
\constfunc{long}{GetInsertionPoint}{\void}
Returns the insertion point for the combo control's text field.
\textbf{Note:} Under wxMSW, this function always returns $0$ if the combo control
doesn't have the focus.
\membersection{wxComboCtrl::GetLastPosition}\label{wxcomboctrlgetlastposition}
\constfunc{long}{GetLastPosition}{\void}
Returns the last position in the combo control text field.
\membersection{wxComboCtrl::GetPopupControl}\label{wxcomboctrlgetpopupcontrol}
\func{wxComboPopup*}{GetPopupControl}{\void}
Returns current popup interface that has been set with SetPopupControl.
\membersection{wxComboCtrl::GetPopupWindow}\label{wxcomboctrlgetpopupwindow}
\constfunc{wxWindow*}{GetPopupWindow}{\void}
Returns popup window containing the popup control.
\membersection{wxComboCtrl::GetTextCtrl}\label{wxcomboctrlgettextctrl}
\constfunc{wxTextCtrl*}{GetTextCtrl}{\void}
Get the text control which is part of the combo control.
\membersection{wxComboCtrl::GetTextIndent}\label{wxcomboctrlgettextindent}
\constfunc{wxCoord}{GetTextIndent}{\void}
Returns actual indentation in pixels.
\membersection{wxComboCtrl::GetValue}\label{wxcomboctrlgetvalue}
\constfunc{wxString}{GetValue}{\void}
Returns text representation of the current value. For writable
combo control it always returns the value in the text field.
\membersection{wxComboCtrl::HidePopup}\label{wxcomboctrlhidepopup}
\func{void}{HidePopup}{\void}
Dismisses the popup window.
\membersection{wxComboCtrl::IsPopupShown}\label{wxcomboctrlispopupshown}
\constfunc{bool}{IsPopupShown}{\void}
Returns \true if the popup is currently shown
\membersection{wxComboCtrl::OnButtonClick}\label{wxcomboctrlonbuttonclick}
\func{void}{OnButtonClick}{\void}
Implement in a derived class to define what happens on
dropdown button click.
Default action is to show the popup.
\membersection{wxComboCtrl::Paste}\label{wxcomboctrlpaste}
\func{void}{Paste}{\void}
Pastes text from the clipboard to the text field.
\membersection{wxComboCtrl::Remove}\label{wxcomboctrlremove}
\func{void}{Remove}{\param{long }{from}, \param{long }{to}}
Removes the text between the two positions in the combo control text field.
\wxheading{Parameters}
\docparam{from}{The first position.}
\docparam{to}{The last position.}
\membersection{wxComboCtrl::Replace}\label{wxcomboctrlreplace}
\func{void}{Replace}{\param{long }{from}, \param{long }{to}, \param{const wxString\& }{value}}
Replaces the text between two positions with the given text, in the combo control text field.
\wxheading{Parameters}
\docparam{from}{The first position.}
\docparam{to}{The second position.}
\docparam{text}{The text to insert.}
\membersection{wxComboCtrl::SetButtonBitmaps}\label{wxcomboctrlsetbuttonbitmaps}
\func{void}{SetButtonBitmaps}{\param{const wxBitmap\& }{bmpNormal}, \param{bool }{pushButtonBg = false}, \param{const wxBitmap\& }{bmpPressed = wxNullBitmap}, \param{const wxBitmap\& }{bmpHover = wxNullBitmap}, \param{const wxBitmap\& }{bmpDisabled = wxNullBitmap}}
Sets custom dropdown button graphics.
\wxheading{Parameters}
\docparam{bmpNormal}{Default button image.}
\docparam{pushButtonBg}{If \true, blank push button background is painted
below the image.}
\docparam{bmpPressed}{Depressed button image.}
\docparam{bmpHover}{Button image when mouse hovers above it. This
should be ignored on platforms and themes that do not generally draw
different kind of button on mouse hover.}
\docparam{bmpDisabled}{Disabled button image.}
\membersection{wxComboCtrl::SetButtonPosition}\label{wxcomboctrlsetbuttonposition}
\func{void}{SetButtonPosition}{\param{int }{width = -1}, \param{int }{height = -1}, \param{int }{side = wxRIGHT}, \param{int }{spacingX = 0}}
Sets size and position of dropdown button.
\wxheading{Parameters}
\docparam{width}{Button width. Value <= $0$ specifies default.}
\docparam{height}{Button height. Value <= $0$ specifies default.}
\docparam{side}{Indicates which side the button will be placed.
Value can be {\tt wxLEFT} or {\tt wxRIGHT}.}
\docparam{spacingX}{Horizontal spacing around the button. Default is $0$.}
\membersection{wxComboCtrl::SetCustomPaintWidth}\label{wxcomboctrlsetcustompaintwidth}
\func{void}{SetCustomPaintWidth}{\param{int }{width}}
Set width, in pixels, of custom painted area in control without {\tt wxCB\_READONLY}
style. In read-only \helpref{wxOwnerDrawnComboBox}{wxownerdrawncombobox}, this is used
to indicate area that is not covered by the focus rectangle.
\membersection{wxComboCtrl::SetInsertionPoint}\label{wxcomboctrlsetinsertionpoint}
\func{void}{SetInsertionPoint}{\param{long }{pos}}
Sets the insertion point in the text field.
\wxheading{Parameters}
\docparam{pos}{The new insertion point.}
\membersection{wxComboCtrl::SetInsertionPointEnd}\label{wxcomboctrlsetinsertionpointend}
\func{void}{SetInsertionPointEnd}{\void}
Sets the insertion point at the end of the combo control text field.
\membersection{wxComboCtrl::SetPopupAnchor}\label{wxcomboctrlsetpopupanchor}
\func{void}{SetPopupAnchor}{\param{int }{anchorSide}}
Set side of the control to which the popup will align itself. Valid values are
{\tt wxLEFT}, {\tt wxRIGHT} and $0$. The default value $0$ means that the most appropriate
side is used (which, currently, is always {\tt wxLEFT}).
\membersection{wxComboCtrl::SetPopupControl}\label{wxcomboctrlsetpopupcontrol}
\func{void}{SetPopupControl}{\param{wxComboPopup* }{popup}}
Set popup interface class derived from wxComboPopup.
This method should be called as soon as possible after the control
has been created, unless \helpref{OnButtonClick}{wxcomboctrlonbuttonclick}
has been overridden.
\membersection{wxComboCtrl::SetPopupExtents}\label{wxcomboctrlsetpopupextents}
\func{void}{SetPopupExtents}{\param{int }{extLeft}, \param{int }{extRight}}
Extends popup size horizontally, relative to the edges of the combo control.
\wxheading{Parameters}
\docparam{extLeft}{How many pixel to extend beyond the left edge of the
control. Default is $0$.}
\docparam{extRight}{How many pixel to extend beyond the right edge of the
control. Default is $0$.}
\wxheading{Remarks}
Popup minimum width may override arguments.
It is up to the popup to fully take this into account.
\membersection{wxComboCtrl::SetPopupMaxHeight}\label{wxcomboctrlsetpopupmaxheight}
\func{void}{SetPopupMaxHeight}{\param{int }{height}}
Sets preferred maximum height of the popup.
\wxheading{Remarks}
Value -1 indicates the default.
Also, popup implementation may choose to ignore this.
\membersection{wxComboCtrl::SetPopupMinWidth}\label{wxcomboctrlsetpopupminwidth}
\func{void}{SetPopupMinWidth}{\param{int }{width}}
Sets minimum width of the popup. If wider than combo control, it will extend to the left.
\wxheading{Remarks}
Value -1 indicates the default.
Also, popup implementation may choose to ignore this.
\membersection{wxComboCtrl::SetSelection}\label{wxcomboctrlsetselection}
\func{void}{SetSelection}{\param{long }{from}, \param{long }{to}}
Selects the text between the two positions, in the combo control text field.
\wxheading{Parameters}
\docparam{from}{The first position.}
\docparam{to}{The second position.}
\membersection{wxComboCtrl::SetText}\label{wxcomboctrlsettext}
\func{void}{SetText}{\param{const wxString\& }{value}}
Sets the text for the text field without affecting the
popup. Thus, unlike \helpref{SetValue}{wxcomboctrlsetvalue}, it works
equally well with combo control using {\tt wxCB\_READONLY} style.
\membersection{wxComboCtrl::SetTextIndent}\label{wxcomboctrlsettextindent}
\func{void}{SetTextIndent}{\param{int }{indent}}
This will set the space in pixels between left edge of the control and the
text, regardless whether control is read-only or not. Value -1 can be
given to indicate platform default.
\membersection{wxComboCtrl::SetValue}\label{wxcomboctrlsetvalue}
\func{void}{SetValue}{\param{const wxString\& }{value}}
Sets the text for the combo control text field.
{\bf NB:} For a combo control with {\tt wxCB\_READONLY} style the
string must be accepted by the popup (for instance, exist in the dropdown
list), otherwise the call to SetValue() is ignored
\membersection{wxComboCtrl::ShowPopup}\label{wxcomboctrlshowpopup}
\func{void}{ShowPopup}{\void}
Show the popup.
\membersection{wxComboCtrl::Undo}\label{wxcomboctrlundo}
\func{void}{Undo}{\void}
Undoes the last edit in the text field. Windows only.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?