1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxComboCtrl docs
4 %% Author: Jaakko Salli
8 %% Copyright: (c) Jaakko Salli
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxComboCtrl
}}\label{wxcomboctrl
}
14 A combo control is a generic combobox that allows totally
15 custom popup. In addition it has other customization features.
16 For instance, position and size of the dropdown button
19 \wxheading{Setting Custom Popup for wxComboCtrl
}
21 wxComboCtrl needs to be told somehow which control to use
22 and this is done by SetPopupControl(). However, we need
23 something more than just a wxControl in this method as,
24 for example, we need to call SetStringValue("initial text value")
25 and wxControl doesn't have such method. So we also need a
26 \helpref{wxComboPopup
}{wxcombopopup
} which is an interface which
27 must be implemented by a control to be usable as a popup.
29 We couldn't derive wxComboPopup from wxControl as this would make it
30 impossible to have a class deriving from a wxWidgets control and from
31 it, so instead it is just a mix-in.
33 Here's a minimal sample of
\helpref{wxListView
}{wxlistview
} popup:
38 #include <wx/listctrl.h>
41 \helpref{wxCore
}{librarieslist
}
44 class wxListViewComboPopup : public wxListView,
49 // Initialize member variables
55 // Create popup control
56 virtual bool Create(wxWindow* parent)
58 return wxListView::Create(parent,
1,wxPoint(
0,
0),wxDefaultSize);
61 // Return pointer to the created control
62 virtual wxWindow *GetControl()
{ return this;
}
64 // Translate string into a list selection
65 virtual void SetStringValue(const wxString& s)
67 int n = wxListView::FindItem(-
1,s);
68 if ( n >=
0 && n < wxListView::GetItemCount() )
69 wxListView::Select(n);
72 // Get list selection as a string
73 virtual wxString GetStringValue() const
76 return wxListView::GetItemText(m_value);
80 // Do mouse hot-tracking (which is typical in list popups)
81 void OnMouseMove(wxMouseEvent& event)
83 // TODO: Move selection to cursor
86 // On mouse left up, set the value and close the popup
87 void OnMouseClick(wxMouseEvent& WXUNUSED(event))
89 m_value = wxListView::GetFirstSelected();
91 // TODO: Send event as well
98 int m_value; // current item index
101 DECLARE_EVENT_TABLE()
104 BEGIN_EVENT_TABLE(wxListViewComboPopup, wxListView)
105 EVT_MOTION(wxListViewComboPopup::OnMouseMove)
106 EVT_LEFT_UP(wxListViewComboPopup::OnMouseClick)
111 Here's how you would create and populate it in a dialog constructor:
115 wxComboCtrl* comboCtrl = new wxComboCtrl(this,wxID_ANY,wxEmptyString);
117 wxListViewComboPopup* popupCtrl = new wxListViewComboPopup();
119 comboCtrl->SetPopupControl(popupCtrl);
121 // Populate using wxListView methods
122 popupCtrl->InsertItem(popupCtrl->GetItemCount(),wxT("First Item"));
123 popupCtrl->InsertItem(popupCtrl->GetItemCount(),wxT("Second Item"));
124 popupCtrl->InsertItem(popupCtrl->GetItemCount(),wxT("Third Item"));
128 \wxheading{Derived from
}
130 \helpref{wxControl
}{wxcontrol
}\\
131 \helpref{wxWindow
}{wxwindow
}\\
132 \helpref{wxEvtHandler
}{wxevthandler
}\\
133 \helpref{wxObject
}{wxobject
}
135 \wxheading{Include files
}
139 \wxheading{Window styles
}
141 \begin{twocollist
}\itemsep=
0pt
142 \twocolitem{\windowstyle{wxCB
\_READONLY}}{Text will not be editable.
}
143 \twocolitem{\windowstyle{wxCB
\_SORT}}{Sorts the entries in the list alphabetically.
}
144 \twocolitem{\windowstyle{wxTE
\_PROCESS\_ENTER}}{The control will generate
145 the event wxEVT
\_COMMAND\_TEXT\_ENTER (otherwise pressing Enter key
146 is either processed internally by the control or used for navigation between
147 dialog controls). Windows only.
}
148 \twocolitem{\windowstyle{wxCC
\_SPECIAL\_DCLICK}}{Double-clicking triggers a call
149 to popup's OnComboDoubleClick. Actual behaviour is defined by a derived
150 class. For instance, wxOwnerDrawnComboBox will cycle an item. This style only
151 applies if wxCB
\_READONLY is used as well.
}
152 \twocolitem{\windowstyle{wxCC
\_STD\_BUTTON}}{Drop button will behave
153 more like a standard push button.
}
156 See also
\helpref{window styles overview
}{windowstyles
}.
158 \wxheading{Event handling
}
161 \begin{twocollist
}\itemsep=
0pt
162 \twocolitem{{\bf EVT
\_TEXT(id, func)
}}{Process a wxEVT
\_COMMAND\_TEXT\_UPDATED event,
163 when the text changes.
}
164 \twocolitem{{\bf EVT
\_TEXT\_ENTER(id, func)
}}{Process a wxEVT
\_COMMAND\_TEXT\_ENTER event,
165 when <RETURN> is pressed in the combo control.
}
170 \helpref{wxComboBox
}{wxcombobox
},
\helpref{wxChoice
}{wxchoice
},
171 \helpref{wxOwnerDrawnComboBox
}{wxownerdrawncombobox
},
172 \rtfsp\helpref{wxComboPopup
}{wxcombopopup
},
\helpref{wxCommandEvent
}{wxcommandevent
}
174 \latexignore{\rtfignore{\wxheading{Members
}}}
177 \membersection{wxComboCtrl::wxComboCtrl
}\label{wxcomboctrlctor
}
179 \func{}{wxComboCtrl
}{\void}
183 \func{}{wxComboCtrl
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{ id
},
\rtfsp
184 \param{const wxString\&
}{value = ``"
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\param{const wxSize\&
}{ size = wxDefaultSize
},
\rtfsp
185 \param{long
}{ style =
0},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\param{const wxString\&
}{name = ``comboCtrl"
}}
187 Constructor, creating and showing a combo control.
189 \wxheading{Parameters
}
191 \docparam{parent
}{Parent window. Must not be NULL.
}
193 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
195 \docparam{value
}{Initial selection string. An empty string indicates no selection.
}
197 \docparam{pos
}{Window position.
}
199 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then the window is sized
202 \docparam{style
}{Window style. See
\helpref{wxComboCtrl
}{wxcomboctrl
}.
}
204 \docparam{validator
}{Window validator.
}
206 \docparam{name
}{Window name.
}
210 \helpref{wxComboCtrl::Create
}{wxcomboctrlcreate
},
\helpref{wxValidator
}{wxvalidator
}
213 \membersection{wxComboCtrl::
\destruct{wxComboCtrl
}}\label{wxcomboctrldtor
}
215 \func{}{\destruct{wxComboCtrl
}}{\void}
217 Destructor, destroying the combo control.
220 \membersection{wxComboCtrl::AnimateShow
}\label{wxcomboctrlanimateshow
}
222 \func{virtual bool
}{AnimateShow
}{\param{const wxRect\&
}{rect
},
\param{int
}{flags
}}
224 This member function is not normally called in application code.
225 Instead, it can be implemented in a derived class to create a
226 custom popup animation.
228 \wxheading{Parameters
}
230 Same as in
\helpref{DoShowPopup
}{wxcomboctrldoshowpopup
}.
232 \wxheading{Return value
}
234 \true if animation finishes before the function returns.
235 \false otherwise. In the latter case you need to manually call DoShowPopup
236 after the animation ends.
239 \membersection{wxComboCtrl::Create
}\label{wxcomboctrlcreate
}
241 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{ id
},
\rtfsp
242 \param{const wxString\&
}{value = ``"
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\param{const wxSize\&
}{ size = wxDefaultSize
},
\rtfsp
243 \param{long
}{ style =
0},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\param{const wxString\&
}{name = ``comboCtrl"
}}
245 Creates the combo control for two-step construction. Derived classes
246 should call or replace this function. See
\helpref{wxComboCtrl::wxComboCtrl
}{wxcomboctrlctor
}\rtfsp
250 \membersection{wxComboCtrl::Copy
}\label{wxcomboctrlcopy
}
252 \func{void
}{Copy
}{\void}
254 Copies the selected text to the clipboard.
257 \membersection{wxComboCtrl::Cut
}\label{wxcomboctrlcut
}
259 \func{void
}{Cut
}{\void}
261 Copies the selected text to the clipboard and removes the selection.
264 \membersection{wxComboCtrl::DoSetPopupControl
}\label{wxcomboctrldosetpopupcontrol
}
266 \func{void
}{DoSetPopupControl
}{\param{wxComboPopup*
}{popup
}}
268 This member function is not normally called in application code.
269 Instead, it can be implemented in a derived class to return
270 default wxComboPopup, incase
{\tt popup
} is NULL.
272 \textbf{Note:
} If you have implemented OnButtonClick to do
273 something else than show the popup, then DoSetPopupControl
274 must always return NULL.
277 \membersection{wxComboCtrl::DoShowPopup
}\label{wxcomboctrldoshowpopup
}
279 \func{virtual void
}{DoShowPopup
}{\param{const wxRect\&
}{rect
},
\param{int
}{flags
}}
281 This member function is not normally called in application code.
282 Instead, it must be called in a derived class to make sure popup
283 is properly shown after a popup animation has finished (but only
284 if
\helpref{AnimateShow
}{wxcomboctrlanimateshow
} did not finish
285 the animation within it's function scope).
287 \wxheading{Parameters
}
289 \docparam{rect
}{Position to show the popup window at, in screen coordinates.
}
291 \docparam{flags
}{Combination of any of the following:
}
293 \begin{twocollist
}\itemsep=
0pt
294 \twocolitem{{\tt wxComboCtrl::ShowAbove
}}{Popup is shown above the control instead
296 \twocolitem{{\tt wxComboCtrl::CanDeferShow
}}{Showing the popup can be deferred
297 to happen sometime after
\helpref{ShowPopup
}{wxcomboctrlshowpopup
} has finished.
298 In this case,
\helpref{AnimateShow
}{wxcomboctrlanimateshow
} must return
\false.
}
302 \membersection{wxComboCtrl::EnablePopupAnimation
}\label{wxcomboctrlenablepopupanimation
}
304 \func{void
}{EnablePopupAnimation
}{\param{bool
}{enable = true
}}
306 Enables or disables popup animation, if any, depending on the value of
310 \membersection{wxComboCtrl::GetBitmapDisabled
}\label{wxcomboctrlgetbitmapdisabled
}
312 \constfunc{const wxBitmap\&
}{GetBitmapDisabled
}{\void}
314 Returns disabled button bitmap that has been set with
315 \helpref{SetButtonBitmaps
}{wxcomboctrlsetbuttonbitmaps
}.
317 \wxheading{Return value
}
319 A reference to the disabled state bitmap.
322 \membersection{wxComboCtrl::GetBitmapHover
}\label{wxcomboctrlgetbitmaphover
}
324 \constfunc{const wxBitmap\&
}{GetBitmapHover
}{\void}
326 Returns button mouse hover bitmap that has been set with
327 \helpref{SetButtonBitmaps
}{wxcomboctrlsetbuttonbitmaps
}.
329 \wxheading{Return value
}
331 A reference to the mouse hover state bitmap.
334 \membersection{wxComboCtrl::GetBitmapNormal
}\label{wxcomboctrlgetbitmapnormal
}
336 \constfunc{const wxBitmap\&
}{GetBitmapNormal
}{\void}
338 Returns default button bitmap that has been set with
339 \helpref{SetButtonBitmaps
}{wxcomboctrlsetbuttonbitmaps
}.
341 \wxheading{Return value
}
343 A reference to the normal state bitmap.
346 \membersection{wxComboCtrl::GetBitmapPressed
}\label{wxcomboctrlgetbitmappressed
}
348 \constfunc{const wxBitmap\&
}{GetBitmapPressed
}{\void}
350 Returns depressed button bitmap that has been set with
351 \helpref{SetButtonBitmaps
}{wxcomboctrlsetbuttonbitmaps
}.
353 \wxheading{Return value
}
355 A reference to the depressed state bitmap.
358 \membersection{wxComboCtrl::GetButtonSize
}\label{wxcomboctrlgetbuttonsize
}
360 \func{wxSize
}{GetButtonSize
}{\void}
362 Returns current size of the dropdown button.
365 \membersection{wxComboCtrl::GetCustomPaintWidth
}\label{wxcomboctrlgetcustompaintwidth
}
367 \constfunc{int
}{GetCustomPaintWidth
}{\void}
369 Returns custom painted area in control.
373 \helpref{wxComboCtrl::SetCustomPaintWidth
}{wxcomboctrlsetcustompaintwidth
}.
376 \membersection{wxComboCtrl::GetFeatures
}\label{wxcomboctrlgetfeatures
}
378 \func{static int
}{GetFeatures
}{\void}
380 Returns features supported by wxComboCtrl. If needed feature is missing,
381 you need to instead use wxGenericComboCtrl, which however may lack
382 native look and feel (but otherwise sports identical API).
384 \wxheading{Return value
}
386 Value returned is a combination of following flags:
389 \begin{twocollist
}\itemsep=
0pt
390 \twocolitem{{\tt wxComboCtrlFeatures::MovableButton
}}{Button can
391 be on either side of the control.
}
392 \twocolitem{{\tt wxComboCtrlFeatures::BitmapButton
}}{Button may
393 be replaced with bitmap.
}
394 \twocolitem{{\tt wxComboCtrlFeatures::ButtonSpacing
}}{Button can
396 \twocolitem{{\tt wxComboCtrlFeatures::TextIndent
}}{SetTextIndent
398 \twocolitem{{\tt wxComboCtrlFeatures::PaintControl
}}{Combo control
399 itself can be custom painted.
}
400 \twocolitem{{\tt wxComboCtrlFeatures::PaintWritable
}}{A variable-
401 width area in front of writable combo control's textctrl can
403 \twocolitem{{\tt wxComboCtrlFeatures::Borderless
}}{wxBORDER
\_NONE window style works.
}
404 \twocolitem{{\tt wxComboCtrlFeatures::All
}}{All of the
409 \membersection{wxComboCtrl::GetInsertionPoint
}\label{wxcomboctrlgetinsertionpoint
}
411 \constfunc{long
}{GetInsertionPoint
}{\void}
413 Returns the insertion point for the combo control's text field.
415 \textbf{Note:
} Under wxMSW, this function always returns $
0$ if the combo control
416 doesn't have the focus.
419 \membersection{wxComboCtrl::IsPopupWindowState
}\label{wxcomboctrlispopupwindowstate
}
421 \constfunc{bool
}{IsPopupWindowState
}{\param{int
}{state
}}
423 Returns
\true if the popup window is in the given state.
426 \begin{twocollist
}\itemsep=
0pt
427 \twocolitem{{\tt wxComboCtrl::Hidden
}}{Popup window is hidden.
}
428 \twocolitem{{\tt wxComboCtrl::Animating
}}{Popup window is being shown, but the
429 popup animation has not yet finished.
}
430 \twocolitem{{\tt wxComboCtrl::Visible
}}{Popup window is fully visible.
}
435 \membersection{wxComboCtrl::GetLastPosition
}\label{wxcomboctrlgetlastposition
}
437 \constfunc{long
}{GetLastPosition
}{\void}
439 Returns the last position in the combo control text field.
442 \membersection{wxComboCtrl::GetPopupControl
}\label{wxcomboctrlgetpopupcontrol
}
444 \func{wxComboPopup*
}{GetPopupControl
}{\void}
446 Returns current popup interface that has been set with SetPopupControl.
449 \membersection{wxComboCtrl::GetPopupWindow
}\label{wxcomboctrlgetpopupwindow
}
451 \constfunc{wxWindow*
}{GetPopupWindow
}{\void}
453 Returns popup window containing the popup control.
456 \membersection{wxComboCtrl::GetTextCtrl
}\label{wxcomboctrlgettextctrl
}
458 \constfunc{wxTextCtrl*
}{GetTextCtrl
}{\void}
460 Get the text control which is part of the combo control.
463 \membersection{wxComboCtrl::GetTextIndent
}\label{wxcomboctrlgettextindent
}
465 \constfunc{wxCoord
}{GetTextIndent
}{\void}
467 Returns actual indentation in pixels.
470 \membersection{wxComboCtrl::GetTextRect
}\label{wxcomboctrlgettextrect
}
472 \constfunc{const wxRect\&
}{GetTextRect
}{\void}
474 Returns area covered by the text field (includes everything except
475 borders and the dropdown button).
478 \membersection{wxComboCtrl::GetValue
}\label{wxcomboctrlgetvalue
}
480 \constfunc{wxString
}{GetValue
}{\void}
482 Returns text representation of the current value. For writable
483 combo control it always returns the value in the text field.
486 \membersection{wxComboCtrl::HidePopup
}\label{wxcomboctrlhidepopup
}
488 \func{void
}{HidePopup
}{\void}
490 Dismisses the popup window.
493 \membersection{wxComboCtrl::IsPopupShown
}\label{wxcomboctrlispopupshown
}
495 \constfunc{bool
}{IsPopupShown
}{\void}
497 Returns
\true if the popup is currently shown
500 \membersection{wxComboCtrl::OnButtonClick
}\label{wxcomboctrlonbuttonclick
}
502 \func{void
}{OnButtonClick
}{\void}
504 Implement in a derived class to define what happens on
505 dropdown button click.
507 Default action is to show the popup.
509 \textbf{Note:
} If you implement this to do something else than
510 show the popup, you must then also implement
511 \helpref{DoSetPopupControl
}{wxcomboctrldosetpopupcontrol
} to always
515 \membersection{wxComboCtrl::Paste
}\label{wxcomboctrlpaste
}
517 \func{void
}{Paste
}{\void}
519 Pastes text from the clipboard to the text field.
522 \membersection{wxComboCtrl::Remove
}\label{wxcomboctrlremove
}
524 \func{void
}{Remove
}{\param{long
}{from
},
\param{long
}{to
}}
526 Removes the text between the two positions in the combo control text field.
528 \wxheading{Parameters
}
530 \docparam{from
}{The first position.
}
532 \docparam{to
}{The last position.
}
535 \membersection{wxComboCtrl::Replace
}\label{wxcomboctrlreplace
}
537 \func{void
}{Replace
}{\param{long
}{from
},
\param{long
}{to
},
\param{const wxString\&
}{value
}}
539 Replaces the text between two positions with the given text, in the combo control text field.
541 \wxheading{Parameters
}
543 \docparam{from
}{The first position.
}
545 \docparam{to
}{The second position.
}
547 \docparam{text
}{The text to insert.
}
550 \membersection{wxComboCtrl::SetButtonBitmaps
}\label{wxcomboctrlsetbuttonbitmaps
}
552 \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
}}
554 Sets custom dropdown button graphics.
556 \wxheading{Parameters
}
558 \docparam{bmpNormal
}{Default button image.
}
559 \docparam{pushButtonBg
}{If
\true, blank push button background is painted
561 \docparam{bmpPressed
}{Depressed button image.
}
562 \docparam{bmpHover
}{Button image when mouse hovers above it. This
563 should be ignored on platforms and themes that do not generally draw
564 different kind of button on mouse hover.
}
565 \docparam{bmpDisabled
}{Disabled button image.
}
568 \membersection{wxComboCtrl::SetButtonPosition
}\label{wxcomboctrlsetbuttonposition
}
570 \func{void
}{SetButtonPosition
}{\param{int
}{width = -
1},
\param{int
}{height = -
1},
\param{int
}{side = wxRIGHT
},
\param{int
}{spacingX =
0}}
572 Sets size and position of dropdown button.
574 \wxheading{Parameters
}
576 \docparam{width
}{Button width. Value <= $
0$ specifies default.
}
577 \docparam{height
}{Button height. Value <= $
0$ specifies default.
}
578 \docparam{side
}{Indicates which side the button will be placed.
579 Value can be
{\tt wxLEFT
} or
{\tt wxRIGHT
}.
}
580 \docparam{spacingX
}{Horizontal spacing around the button. Default is $
0$.
}
583 \membersection{wxComboCtrl::SetCustomPaintWidth
}\label{wxcomboctrlsetcustompaintwidth
}
585 \func{void
}{SetCustomPaintWidth
}{\param{int
}{width
}}
587 Set width, in pixels, of custom painted area in control without
{\tt wxCB
\_READONLY}
588 style. In read-only
\helpref{wxOwnerDrawnComboBox
}{wxownerdrawncombobox
}, this is used
589 to indicate area that is not covered by the focus rectangle.
592 \membersection{wxComboCtrl::SetInsertionPoint
}\label{wxcomboctrlsetinsertionpoint
}
594 \func{void
}{SetInsertionPoint
}{\param{long
}{pos
}}
596 Sets the insertion point in the text field.
598 \wxheading{Parameters
}
600 \docparam{pos
}{The new insertion point.
}
603 \membersection{wxComboCtrl::SetInsertionPointEnd
}\label{wxcomboctrlsetinsertionpointend
}
605 \func{void
}{SetInsertionPointEnd
}{\void}
607 Sets the insertion point at the end of the combo control text field.
610 \membersection{wxComboCtrl::SetPopupAnchor
}\label{wxcomboctrlsetpopupanchor
}
612 \func{void
}{SetPopupAnchor
}{\param{int
}{anchorSide
}}
614 Set side of the control to which the popup will align itself. Valid values are
615 {\tt wxLEFT
},
{\tt wxRIGHT
} and $
0$. The default value $
0$ means that the most appropriate
616 side is used (which, currently, is always
{\tt wxLEFT
}).
619 \membersection{wxComboCtrl::SetPopupControl
}\label{wxcomboctrlsetpopupcontrol
}
621 \func{void
}{SetPopupControl
}{\param{wxComboPopup*
}{popup
}}
623 Set popup interface class derived from wxComboPopup.
624 This method should be called as soon as possible after the control
625 has been created, unless
\helpref{OnButtonClick
}{wxcomboctrlonbuttonclick
}
629 \membersection{wxComboCtrl::SetPopupExtents
}\label{wxcomboctrlsetpopupextents
}
631 \func{void
}{SetPopupExtents
}{\param{int
}{extLeft
},
\param{int
}{extRight
}}
633 Extends popup size horizontally, relative to the edges of the combo control.
635 \wxheading{Parameters
}
637 \docparam{extLeft
}{How many pixel to extend beyond the left edge of the
638 control. Default is $
0$.
}
639 \docparam{extRight
}{How many pixel to extend beyond the right edge of the
640 control. Default is $
0$.
}
644 Popup minimum width may override arguments.
646 It is up to the popup to fully take this into account.
649 \membersection{wxComboCtrl::SetPopupMaxHeight
}\label{wxcomboctrlsetpopupmaxheight
}
651 \func{void
}{SetPopupMaxHeight
}{\param{int
}{height
}}
653 Sets preferred maximum height of the popup.
657 Value -
1 indicates the default.
659 Also, popup implementation may choose to ignore this.
662 \membersection{wxComboCtrl::SetPopupMinWidth
}\label{wxcomboctrlsetpopupminwidth
}
664 \func{void
}{SetPopupMinWidth
}{\param{int
}{width
}}
666 Sets minimum width of the popup. If wider than combo control, it will extend to the left.
670 Value -
1 indicates the default.
672 Also, popup implementation may choose to ignore this.
675 \membersection{wxComboCtrl::SetSelection
}\label{wxcomboctrlsetselection
}
677 \func{void
}{SetSelection
}{\param{long
}{from
},
\param{long
}{to
}}
679 Selects the text between the two positions, in the combo control text field.
681 \wxheading{Parameters
}
683 \docparam{from
}{The first position.
}
685 \docparam{to
}{The second position.
}
688 \membersection{wxComboCtrl::SetText
}\label{wxcomboctrlsettext
}
690 \func{void
}{SetText
}{\param{const wxString\&
}{value
}}
692 Sets the text for the text field without affecting the
693 popup. Thus, unlike
\helpref{SetValue
}{wxcomboctrlsetvalue
}, it works
694 equally well with combo control using
{\tt wxCB
\_READONLY} style.
697 \membersection{wxComboCtrl::SetTextIndent
}\label{wxcomboctrlsettextindent
}
699 \func{void
}{SetTextIndent
}{\param{int
}{indent
}}
701 This will set the space in pixels between left edge of the control and the
702 text, regardless whether control is read-only or not. Value -
1 can be
703 given to indicate platform default.
706 \membersection{wxComboCtrl::SetValue
}\label{wxcomboctrlsetvalue
}
708 \func{void
}{SetValue
}{\param{const wxString\&
}{value
}}
710 Sets the text for the combo control text field.
712 {\bf NB:
} For a combo control with
{\tt wxCB
\_READONLY} style the
713 string must be accepted by the popup (for instance, exist in the dropdown
714 list), otherwise the call to SetValue() is ignored
717 \membersection{wxComboCtrl::SetValueWithEvent
}\label{wxcomboctrlsetvaluewithevent
}
719 \func{void
}{SetValueWithEvent
}{\param{const wxString\&
}{value
},
\param{bool
}{withEvent = true
}}
721 Same as SetValue, but also sends wxCommandEvent of type wxEVT
\_COMMAND\_TEXT\_UPDATED
722 if
{\tt withEvent
} is
\true.
725 \membersection{wxComboCtrl::ShowPopup
}\label{wxcomboctrlshowpopup
}
727 \func{void
}{ShowPopup
}{\void}
732 \membersection{wxComboCtrl::Undo
}\label{wxcomboctrlundo
}
734 \func{void
}{Undo
}{\void}
736 Undoes the last edit in the text field. Windows only.
739 \membersection{wxComboCtrl::UseAltPopupWindow
}\label{wxcomboctrlusealtpopupwindow
}
741 \func{void
}{UseAltPopupWindow
}{\param{bool
}{enable = true
}}
743 Enable or disable usage of an alternative popup window, which guarantees
744 ability to focus the popup control, and allows common native controls to
745 function normally. This alternative popup window is usually a wxDialog,
746 and as such, when it is shown, its parent top-level window will appear
747 as if the focus has been lost from it.