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
}}{wxNO
\_BORDER
405 \twocolitem{{\tt wxComboCtrlFeatures::All
}}{All of the
410 \membersection{wxComboCtrl::GetInsertionPoint
}\label{wxcomboctrlgetinsertionpoint
}
412 \constfunc{long
}{GetInsertionPoint
}{\void}
414 Returns the insertion point for the combo control's text field.
416 \textbf{Note:
} Under wxMSW, this function always returns $
0$ if the combo control
417 doesn't have the focus.
420 \membersection{wxComboCtrl::IsPopupWindowState
}\label{wxcomboctrlispopupwindowstate
}
422 \constfunc{bool
}{IsPopupWindowState
}{\param{int
}{state
}}
424 Returns
\true if the popup window is in the given state.
427 \begin{twocollist
}\itemsep=
0pt
428 \twocolitem{{\tt wxComboCtrl::Hidden
}}{Popup window is hidden.
}
429 \twocolitem{{\tt wxComboCtrl::Animating
}}{Popup window is being shown, but the
430 popup animation has not yet finished.
}
431 \twocolitem{{\tt wxComboCtrl::Visible
}}{Popup window is fully visible.
}
436 \membersection{wxComboCtrl::GetLastPosition
}\label{wxcomboctrlgetlastposition
}
438 \constfunc{long
}{GetLastPosition
}{\void}
440 Returns the last position in the combo control text field.
443 \membersection{wxComboCtrl::GetPopupControl
}\label{wxcomboctrlgetpopupcontrol
}
445 \func{wxComboPopup*
}{GetPopupControl
}{\void}
447 Returns current popup interface that has been set with SetPopupControl.
450 \membersection{wxComboCtrl::GetPopupWindow
}\label{wxcomboctrlgetpopupwindow
}
452 \constfunc{wxWindow*
}{GetPopupWindow
}{\void}
454 Returns popup window containing the popup control.
457 \membersection{wxComboCtrl::GetTextCtrl
}\label{wxcomboctrlgettextctrl
}
459 \constfunc{wxTextCtrl*
}{GetTextCtrl
}{\void}
461 Get the text control which is part of the combo control.
464 \membersection{wxComboCtrl::GetTextIndent
}\label{wxcomboctrlgettextindent
}
466 \constfunc{wxCoord
}{GetTextIndent
}{\void}
468 Returns actual indentation in pixels.
471 \membersection{wxComboCtrl::GetTextRect
}\label{wxcomboctrlgettextrect
}
473 \constfunc{const wxRect\&
}{GetTextRect
}{\void}
475 Returns area covered by the text field (includes everything except
476 borders and the dropdown button).
479 \membersection{wxComboCtrl::GetValue
}\label{wxcomboctrlgetvalue
}
481 \constfunc{wxString
}{GetValue
}{\void}
483 Returns text representation of the current value. For writable
484 combo control it always returns the value in the text field.
487 \membersection{wxComboCtrl::HidePopup
}\label{wxcomboctrlhidepopup
}
489 \func{void
}{HidePopup
}{\void}
491 Dismisses the popup window.
494 \membersection{wxComboCtrl::IsPopupShown
}\label{wxcomboctrlispopupshown
}
496 \constfunc{bool
}{IsPopupShown
}{\void}
498 Returns
\true if the popup is currently shown
501 \membersection{wxComboCtrl::OnButtonClick
}\label{wxcomboctrlonbuttonclick
}
503 \func{void
}{OnButtonClick
}{\void}
505 Implement in a derived class to define what happens on
506 dropdown button click.
508 Default action is to show the popup.
510 \textbf{Note:
} If you implement this to do something else than
511 show the popup, you must then also implement
512 \helpref{DoSetPopupControl
}{wxcomboctrldosetpopupcontrol
} to always
516 \membersection{wxComboCtrl::Paste
}\label{wxcomboctrlpaste
}
518 \func{void
}{Paste
}{\void}
520 Pastes text from the clipboard to the text field.
523 \membersection{wxComboCtrl::Remove
}\label{wxcomboctrlremove
}
525 \func{void
}{Remove
}{\param{long
}{from
},
\param{long
}{to
}}
527 Removes the text between the two positions in the combo control text field.
529 \wxheading{Parameters
}
531 \docparam{from
}{The first position.
}
533 \docparam{to
}{The last position.
}
536 \membersection{wxComboCtrl::Replace
}\label{wxcomboctrlreplace
}
538 \func{void
}{Replace
}{\param{long
}{from
},
\param{long
}{to
},
\param{const wxString\&
}{value
}}
540 Replaces the text between two positions with the given text, in the combo control text field.
542 \wxheading{Parameters
}
544 \docparam{from
}{The first position.
}
546 \docparam{to
}{The second position.
}
548 \docparam{text
}{The text to insert.
}
551 \membersection{wxComboCtrl::SetButtonBitmaps
}\label{wxcomboctrlsetbuttonbitmaps
}
553 \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
}}
555 Sets custom dropdown button graphics.
557 \wxheading{Parameters
}
559 \docparam{bmpNormal
}{Default button image.
}
560 \docparam{pushButtonBg
}{If
\true, blank push button background is painted
562 \docparam{bmpPressed
}{Depressed button image.
}
563 \docparam{bmpHover
}{Button image when mouse hovers above it. This
564 should be ignored on platforms and themes that do not generally draw
565 different kind of button on mouse hover.
}
566 \docparam{bmpDisabled
}{Disabled button image.
}
569 \membersection{wxComboCtrl::SetButtonPosition
}\label{wxcomboctrlsetbuttonposition
}
571 \func{void
}{SetButtonPosition
}{\param{int
}{width = -
1},
\param{int
}{height = -
1},
\param{int
}{side = wxRIGHT
},
\param{int
}{spacingX =
0}}
573 Sets size and position of dropdown button.
575 \wxheading{Parameters
}
577 \docparam{width
}{Button width. Value <= $
0$ specifies default.
}
578 \docparam{height
}{Button height. Value <= $
0$ specifies default.
}
579 \docparam{side
}{Indicates which side the button will be placed.
580 Value can be
{\tt wxLEFT
} or
{\tt wxRIGHT
}.
}
581 \docparam{spacingX
}{Horizontal spacing around the button. Default is $
0$.
}
584 \membersection{wxComboCtrl::SetCustomPaintWidth
}\label{wxcomboctrlsetcustompaintwidth
}
586 \func{void
}{SetCustomPaintWidth
}{\param{int
}{width
}}
588 Set width, in pixels, of custom painted area in control without
{\tt wxCB
\_READONLY}
589 style. In read-only
\helpref{wxOwnerDrawnComboBox
}{wxownerdrawncombobox
}, this is used
590 to indicate area that is not covered by the focus rectangle.
593 \membersection{wxComboCtrl::SetInsertionPoint
}\label{wxcomboctrlsetinsertionpoint
}
595 \func{void
}{SetInsertionPoint
}{\param{long
}{pos
}}
597 Sets the insertion point in the text field.
599 \wxheading{Parameters
}
601 \docparam{pos
}{The new insertion point.
}
604 \membersection{wxComboCtrl::SetInsertionPointEnd
}\label{wxcomboctrlsetinsertionpointend
}
606 \func{void
}{SetInsertionPointEnd
}{\void}
608 Sets the insertion point at the end of the combo control text field.
611 \membersection{wxComboCtrl::SetPopupAnchor
}\label{wxcomboctrlsetpopupanchor
}
613 \func{void
}{SetPopupAnchor
}{\param{int
}{anchorSide
}}
615 Set side of the control to which the popup will align itself. Valid values are
616 {\tt wxLEFT
},
{\tt wxRIGHT
} and $
0$. The default value $
0$ means that the most appropriate
617 side is used (which, currently, is always
{\tt wxLEFT
}).
620 \membersection{wxComboCtrl::SetPopupControl
}\label{wxcomboctrlsetpopupcontrol
}
622 \func{void
}{SetPopupControl
}{\param{wxComboPopup*
}{popup
}}
624 Set popup interface class derived from wxComboPopup.
625 This method should be called as soon as possible after the control
626 has been created, unless
\helpref{OnButtonClick
}{wxcomboctrlonbuttonclick
}
630 \membersection{wxComboCtrl::SetPopupExtents
}\label{wxcomboctrlsetpopupextents
}
632 \func{void
}{SetPopupExtents
}{\param{int
}{extLeft
},
\param{int
}{extRight
}}
634 Extends popup size horizontally, relative to the edges of the combo control.
636 \wxheading{Parameters
}
638 \docparam{extLeft
}{How many pixel to extend beyond the left edge of the
639 control. Default is $
0$.
}
640 \docparam{extRight
}{How many pixel to extend beyond the right edge of the
641 control. Default is $
0$.
}
645 Popup minimum width may override arguments.
647 It is up to the popup to fully take this into account.
650 \membersection{wxComboCtrl::SetPopupMaxHeight
}\label{wxcomboctrlsetpopupmaxheight
}
652 \func{void
}{SetPopupMaxHeight
}{\param{int
}{height
}}
654 Sets preferred maximum height of the popup.
658 Value -
1 indicates the default.
660 Also, popup implementation may choose to ignore this.
663 \membersection{wxComboCtrl::SetPopupMinWidth
}\label{wxcomboctrlsetpopupminwidth
}
665 \func{void
}{SetPopupMinWidth
}{\param{int
}{width
}}
667 Sets minimum width of the popup. If wider than combo control, it will extend to the left.
671 Value -
1 indicates the default.
673 Also, popup implementation may choose to ignore this.
676 \membersection{wxComboCtrl::SetSelection
}\label{wxcomboctrlsetselection
}
678 \func{void
}{SetSelection
}{\param{long
}{from
},
\param{long
}{to
}}
680 Selects the text between the two positions, in the combo control text field.
682 \wxheading{Parameters
}
684 \docparam{from
}{The first position.
}
686 \docparam{to
}{The second position.
}
689 \membersection{wxComboCtrl::SetText
}\label{wxcomboctrlsettext
}
691 \func{void
}{SetText
}{\param{const wxString\&
}{value
}}
693 Sets the text for the text field without affecting the
694 popup. Thus, unlike
\helpref{SetValue
}{wxcomboctrlsetvalue
}, it works
695 equally well with combo control using
{\tt wxCB
\_READONLY} style.
698 \membersection{wxComboCtrl::SetTextIndent
}\label{wxcomboctrlsettextindent
}
700 \func{void
}{SetTextIndent
}{\param{int
}{indent
}}
702 This will set the space in pixels between left edge of the control and the
703 text, regardless whether control is read-only or not. Value -
1 can be
704 given to indicate platform default.
707 \membersection{wxComboCtrl::SetValue
}\label{wxcomboctrlsetvalue
}
709 \func{void
}{SetValue
}{\param{const wxString\&
}{value
}}
711 Sets the text for the combo control text field.
713 {\bf NB:
} For a combo control with
{\tt wxCB
\_READONLY} style the
714 string must be accepted by the popup (for instance, exist in the dropdown
715 list), otherwise the call to SetValue() is ignored
718 \membersection{wxComboCtrl::SetValueWithEvent
}\label{wxcomboctrlsetvaluewithevent
}
720 \func{void
}{SetValueWithEvent
}{\param{const wxString\&
}{value
},
\param{bool
}{withEvent = true
}}
722 Same as SetValue, but also sends wxCommandEvent of type wxEVT
\_COMMAND\_TEXT\_UPDATED
723 if
{\tt withEvent
} is
\true.
726 \membersection{wxComboCtrl::ShowPopup
}\label{wxcomboctrlshowpopup
}
728 \func{void
}{ShowPopup
}{\void}
733 \membersection{wxComboCtrl::Undo
}\label{wxcomboctrlundo
}
735 \func{void
}{Undo
}{\void}
737 Undoes the last edit in the text field. Windows only.
740 \membersection{wxComboCtrl::UseAltPopupWindow
}\label{wxcomboctrlusealtpopupwindow
}
742 \func{void
}{UseAltPopupWindow
}{\param{bool
}{enable = true
}}
744 Enable or disable usage of an alternative popup window, which guarantees
745 ability to focus the popup control, and allows common native controls to
746 function normally. This alternative popup window is usually a wxDialog,
747 and as such, when it is shown, its parent top-level window will appear
748 as if the focus has been lost from it.