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>
40 class wxListViewComboPopup : public wxListView,
45 // Initialize member variables
51 // Create popup control
52 virtual bool Create(wxWindow* parent)
54 return wxListView::Create(parent,
1,wxPoint(
0,
0),wxDefaultSize);
57 // Return pointer to the created control
58 virtual wxWindow *GetControl()
{ return this;
}
60 // Translate string into a list selection
61 virtual void SetStringValue(const wxString& s)
63 int n = wxListView::FindItem(-
1,s);
64 if ( n >=
0 && n < wxListView::GetItemCount() )
65 wxListView::Select(n);
68 // Get list selection as a string
69 virtual wxString GetStringValue() const
72 return wxListView::GetItemText(m_value);
76 // Do mouse hot-tracking (which is typical in list popups)
77 void OnMouseMove(wxMouseEvent& event)
79 // TODO: Move selection to cursor
82 // On mouse left up, set the value and close the popup
83 void OnMouseClick(wxMouseEvent& WXUNUSED(event))
85 m_value = wxListView::GetFirstSelected();
87 // TODO: Send event as well
94 int m_value; // current item index
100 BEGIN_EVENT_TABLE(wxListViewComboPopup, wxListView)
101 EVT_MOTION(wxListViewComboPopup::OnMouseMove)
102 EVT_LEFT_UP(wxListViewComboPopup::OnMouseClick)
107 Here's how you would create and populate it in a dialog constructor:
111 wxComboCtrl* comboCtrl = new wxComboCtrl(this,wxID_ANY,wxEmptyString);
113 wxListViewComboPopup* popupCtrl = new wxListViewComboPopup();
115 comboCtrl->SetPopupControl(popupCtrl);
117 // Populate using wxListView methods
118 popupCtrl->InsertItem(popupCtrl->GetItemCount(),wxT("First Item"));
119 popupCtrl->InsertItem(popupCtrl->GetItemCount(),wxT("Second Item"));
120 popupCtrl->InsertItem(popupCtrl->GetItemCount(),wxT("Third Item"));
124 \wxheading{Derived from
}
126 \helpref{wxControl
}{wxcontrol
}\\
127 \helpref{wxWindow
}{wxwindow
}\\
128 \helpref{wxEvtHandler
}{wxevthandler
}\\
129 \helpref{wxObject
}{wxobject
}
131 \wxheading{Include files
}
135 \wxheading{Window styles
}
137 \begin{twocollist
}\itemsep=
0pt
138 \twocolitem{\windowstyle{wxCB
\_READONLY}}{Text will not be editable.
}
139 \twocolitem{\windowstyle{wxCB
\_SORT}}{Sorts the entries in the list alphabetically.
}
140 \twocolitem{\windowstyle{wxTE
\_PROCESS\_ENTER}}{The control will generate
141 the event wxEVT
\_COMMAND\_TEXT\_ENTER (otherwise pressing Enter key
142 is either processed internally by the control or used for navigation between
143 dialog controls). Windows only.
}
144 \twocolitem{\windowstyle{wxCC
\_SPECIAL\_DCLICK}}{Double-clicking triggers a call
145 to popup's OnComboDoubleClick. Actual behaviour is defined by a derived
146 class. For instance, wxOwnerDrawnComboBox will cycle an item. This style only
147 applies if wxCB
\_READONLY is used as well.
}
148 \twocolitem{\windowstyle{wxCC
\_STD\_BUTTON}}{Drop button will behave
149 more like a standard push button.
}
152 See also
\helpref{window styles overview
}{windowstyles
}.
154 \wxheading{Event handling
}
157 \begin{twocollist
}\itemsep=
0pt
158 \twocolitem{{\bf EVT
\_TEXT(id, func)
}}{Process a wxEVT
\_COMMAND\_TEXT\_UPDATED event,
159 when the text changes.
}
160 \twocolitem{{\bf EVT
\_TEXT\_ENTER(id, func)
}}{Process a wxEVT
\_COMMAND\_TEXT\_ENTER event,
161 when <RETURN> is pressed in the combo control.
}
166 \helpref{wxComboBox
}{wxcombobox
},
\helpref{wxChoice
}{wxchoice
},
167 \helpref{wxOwnerDrawnComboBox
}{wxownerdrawncombobox
},
168 \rtfsp\helpref{wxComboPopup
}{wxcombopopup
},
\helpref{wxCommandEvent
}{wxcommandevent
}
170 \latexignore{\rtfignore{\wxheading{Members
}}}
173 \membersection{wxComboCtrl::wxComboCtrl
}\label{wxcomboctrlctor
}
175 \func{}{wxComboCtrl
}{\void}
179 \func{}{wxComboCtrl
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{ id
},
\rtfsp
180 \param{const wxString\&
}{value = ``"
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\param{const wxSize\&
}{ size = wxDefaultSize
},
\rtfsp
181 \param{long
}{ style =
0},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\param{const wxString\&
}{name = ``comboCtrl"
}}
183 Constructor, creating and showing a combo control.
185 \wxheading{Parameters
}
187 \docparam{parent
}{Parent window. Must not be NULL.
}
189 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
191 \docparam{value
}{Initial selection string. An empty string indicates no selection.
}
193 \docparam{pos
}{Window position.
}
195 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then the window is sized
198 \docparam{style
}{Window style. See
\helpref{wxComboCtrl
}{wxcomboctrl
}.
}
200 \docparam{validator
}{Window validator.
}
202 \docparam{name
}{Window name.
}
206 \helpref{wxComboCtrl::Create
}{wxcomboctrlcreate
},
\helpref{wxValidator
}{wxvalidator
}
209 \membersection{wxComboCtrl::
\destruct{wxComboCtrl
}}\label{wxcomboctrldtor
}
211 \func{}{\destruct{wxComboCtrl
}}{\void}
213 Destructor, destroying the combo control.
216 \membersection{wxComboCtrl::AnimateShow
}\label{wxcomboctrlanimateshow
}
218 \func{virtual bool
}{AnimateShow
}{\param{const wxRect\&
}{rect
},
\param{int
}{flags
}}
220 This member function is not normally called in application code.
221 Instead, it can be implemented in a derived class to create a
222 custom popup animation.
224 \wxheading{Parameters
}
226 Same as in
\helpref{DoShowPopup
}{wxcomboctrldoshowpopup
}.
228 \wxheading{Return value
}
230 \true if animation finishes before the function returns.
231 \false otherwise. In the latter case you need to manually call DoShowPopup
232 after the animation ends.
235 \membersection{wxComboCtrl::Create
}\label{wxcomboctrlcreate
}
237 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{ id
},
\rtfsp
238 \param{const wxString\&
}{value = ``"
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\param{const wxSize\&
}{ size = wxDefaultSize
},
\rtfsp
239 \param{long
}{ style =
0},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\param{const wxString\&
}{name = ``comboCtrl"
}}
241 Creates the combo control for two-step construction. Derived classes
242 should call or replace this function. See
\helpref{wxComboCtrl::wxComboCtrl
}{wxcomboctrlctor
}\rtfsp
246 \membersection{wxComboCtrl::Copy
}\label{wxcomboctrlcopy
}
248 \func{void
}{Copy
}{\void}
250 Copies the selected text to the clipboard.
253 \membersection{wxComboCtrl::Cut
}\label{wxcomboctrlcut
}
255 \func{void
}{Cut
}{\void}
257 Copies the selected text to the clipboard and removes the selection.
260 \membersection{wxComboCtrl::DoSetPopupControl
}\label{wxcomboctrldosetpopupcontrol
}
262 \func{void
}{DoSetPopupControl
}{\param{wxComboPopup*
}{popup
}}
264 This member function is not normally called in application code.
265 Instead, it can be implemented in a derived class to return
266 default wxComboPopup, incase
{\tt popup
} is NULL.
268 \textbf{Note:
} If you have implemented OnButtonClick to do
269 something else than show the popup, then DoSetPopupControl
270 must always return NULL.
273 \membersection{wxComboCtrl::DoShowPopup
}\label{wxcomboctrldoshowpopup
}
275 \func{virtual void
}{DoShowPopup
}{\param{const wxRect\&
}{rect
},
\param{int
}{flags
}}
277 This member function is not normally called in application code.
278 Instead, it must be called in a derived class to make sure popup
279 is properly shown after a popup animation has finished (but only
280 if
\helpref{AnimateShow
}{wxcomboctrlanimateshow
} did not finish
281 the animation within it's function scope).
283 \wxheading{Parameters
}
285 \docparam{rect
}{Position to show the popup window at, in screen coordinates.
}
287 \docparam{flags
}{Combination of any of the following:
}
289 \begin{twocollist
}\itemsep=
0pt
290 \twocolitem{{\tt wxComboCtrl::ShowAbove
}}{Popup is shown above the control instead
292 \twocolitem{{\tt wxComboCtrl::CanDeferShow
}}{Showing the popup can be deferred
293 to happen sometime after
\helpref{ShowPopup
}{wxcomboctrlshowpopup
} has finished.
294 In this case,
\helpref{AnimateShow
}{wxcomboctrlanimateshow
} must return
\false.
}
298 \membersection{wxComboCtrl::EnablePopupAnimation
}\label{wxcomboctrlenablepopupanimation
}
300 \func{void
}{EnablePopupAnimation
}{\param{bool
}{enable = true
}}
302 Enables or disables popup animation, if any, depending on the value of
306 \membersection{wxComboCtrl::GetBitmapDisabled
}\label{wxcomboctrlgetbitmapdisabled
}
308 \constfunc{const wxBitmap\&
}{GetBitmapDisabled
}{\void}
310 Returns disabled button bitmap that has been set with
311 \helpref{SetButtonBitmaps
}{wxcomboctrlsetbuttonbitmaps
}.
313 \wxheading{Return value
}
315 A reference to the disabled state bitmap.
318 \membersection{wxComboCtrl::GetBitmapHover
}\label{wxcomboctrlgetbitmaphover
}
320 \constfunc{const wxBitmap\&
}{GetBitmapHover
}{\void}
322 Returns button mouse hover bitmap that has been set with
323 \helpref{SetButtonBitmaps
}{wxcomboctrlsetbuttonbitmaps
}.
325 \wxheading{Return value
}
327 A reference to the mouse hover state bitmap.
330 \membersection{wxComboCtrl::GetBitmapNormal
}\label{wxcomboctrlgetbitmapnormal
}
332 \constfunc{const wxBitmap\&
}{GetBitmapNormal
}{\void}
334 Returns default button bitmap that has been set with
335 \helpref{SetButtonBitmaps
}{wxcomboctrlsetbuttonbitmaps
}.
337 \wxheading{Return value
}
339 A reference to the normal state bitmap.
342 \membersection{wxComboCtrl::GetBitmapPressed
}\label{wxcomboctrlgetbitmappressed
}
344 \constfunc{const wxBitmap\&
}{GetBitmapPressed
}{\void}
346 Returns depressed button bitmap that has been set with
347 \helpref{SetButtonBitmaps
}{wxcomboctrlsetbuttonbitmaps
}.
349 \wxheading{Return value
}
351 A reference to the depressed state bitmap.
354 \membersection{wxComboCtrl::GetButtonSize
}\label{wxcomboctrlgetbuttonsize
}
356 \func{wxSize
}{GetButtonSize
}{\void}
358 Returns current size of the dropdown button.
361 \membersection{wxComboCtrl::GetCustomPaintWidth
}\label{wxcomboctrlgetcustompaintwidth
}
363 \constfunc{int
}{GetCustomPaintWidth
}{\void}
365 Returns custom painted area in control.
369 \helpref{wxComboCtrl::SetCustomPaintWidth
}{wxcomboctrlsetcustompaintwidth
}.
372 \membersection{wxComboCtrl::GetFeatures
}\label{wxcomboctrlgetfeatures
}
374 \func{static int
}{GetFeatures
}{\void}
376 Returns features supported by wxComboCtrl. If needed feature is missing,
377 you need to instead use wxGenericComboCtrl, which however may lack
378 native look and feel (but otherwise sports identical API).
380 \wxheading{Return value
}
382 Value returned is a combination of following flags:
385 \begin{twocollist
}\itemsep=
0pt
386 \twocolitem{{\tt wxComboCtrlFeatures::MovableButton
}}{Button can
387 be on either side of the control.
}
388 \twocolitem{{\tt wxComboCtrlFeatures::BitmapButton
}}{Button may
389 be replaced with bitmap.
}
390 \twocolitem{{\tt wxComboCtrlFeatures::ButtonSpacing
}}{Button can
392 \twocolitem{{\tt wxComboCtrlFeatures::TextIndent
}}{SetTextIndent
394 \twocolitem{{\tt wxComboCtrlFeatures::PaintControl
}}{Combo control
395 itself can be custom painted.
}
396 \twocolitem{{\tt wxComboCtrlFeatures::PaintWritable
}}{A variable-
397 width area in front of writable combo control's textctrl can
399 \twocolitem{{\tt wxComboCtrlFeatures::Borderless
}}{wxNO
\_BORDER
401 \twocolitem{{\tt wxComboCtrlFeatures::All
}}{All of the
406 \membersection{wxComboCtrl::GetInsertionPoint
}\label{wxcomboctrlgetinsertionpoint
}
408 \constfunc{long
}{GetInsertionPoint
}{\void}
410 Returns the insertion point for the combo control's text field.
412 \textbf{Note:
} Under wxMSW, this function always returns $
0$ if the combo control
413 doesn't have the focus.
416 \membersection{wxComboCtrl::IsPopupWindowState
}\label{wxcomboctrlispopupwindowstate
}
418 \constfunc{bool
}{IsPopupWindowState
}{\param{int
}{state
}}
420 Returns
\true if the popup window is in the given state.
423 \begin{twocollist
}\itemsep=
0pt
424 \twocolitem{{\tt wxComboCtrl::Hidden
}}{Popup window is hidden.
}
425 \twocolitem{{\tt wxComboCtrl::Animating
}}{Popup window is being shown, but the
426 popup animation has not yet finished.
}
427 \twocolitem{{\tt wxComboCtrl::Visible
}}{Popup window is fully visible.
}
432 \membersection{wxComboCtrl::GetLastPosition
}\label{wxcomboctrlgetlastposition
}
434 \constfunc{long
}{GetLastPosition
}{\void}
436 Returns the last position in the combo control text field.
439 \membersection{wxComboCtrl::GetPopupControl
}\label{wxcomboctrlgetpopupcontrol
}
441 \func{wxComboPopup*
}{GetPopupControl
}{\void}
443 Returns current popup interface that has been set with SetPopupControl.
446 \membersection{wxComboCtrl::GetPopupWindow
}\label{wxcomboctrlgetpopupwindow
}
448 \constfunc{wxWindow*
}{GetPopupWindow
}{\void}
450 Returns popup window containing the popup control.
453 \membersection{wxComboCtrl::GetTextCtrl
}\label{wxcomboctrlgettextctrl
}
455 \constfunc{wxTextCtrl*
}{GetTextCtrl
}{\void}
457 Get the text control which is part of the combo control.
460 \membersection{wxComboCtrl::GetTextIndent
}\label{wxcomboctrlgettextindent
}
462 \constfunc{wxCoord
}{GetTextIndent
}{\void}
464 Returns actual indentation in pixels.
467 \membersection{wxComboCtrl::GetTextRect
}\label{wxcomboctrlgettextrect
}
469 \constfunc{const wxRect\&
}{GetTextRect
}{\void}
471 Returns area covered by the text field (includes everything except
472 borders and the dropdown button).
475 \membersection{wxComboCtrl::GetValue
}\label{wxcomboctrlgetvalue
}
477 \constfunc{wxString
}{GetValue
}{\void}
479 Returns text representation of the current value. For writable
480 combo control it always returns the value in the text field.
483 \membersection{wxComboCtrl::HidePopup
}\label{wxcomboctrlhidepopup
}
485 \func{void
}{HidePopup
}{\void}
487 Dismisses the popup window.
490 \membersection{wxComboCtrl::IsPopupShown
}\label{wxcomboctrlispopupshown
}
492 \constfunc{bool
}{IsPopupShown
}{\void}
494 Returns
\true if the popup is currently shown
497 \membersection{wxComboCtrl::OnButtonClick
}\label{wxcomboctrlonbuttonclick
}
499 \func{void
}{OnButtonClick
}{\void}
501 Implement in a derived class to define what happens on
502 dropdown button click.
504 Default action is to show the popup.
506 \textbf{Note:
} If you implement this to do something else than
507 show the popup, you must then also implement
508 \helpref{DoSetPopupControl
}{wxcomboctrldosetpopupcontrol
} to always
512 \membersection{wxComboCtrl::Paste
}\label{wxcomboctrlpaste
}
514 \func{void
}{Paste
}{\void}
516 Pastes text from the clipboard to the text field.
519 \membersection{wxComboCtrl::Remove
}\label{wxcomboctrlremove
}
521 \func{void
}{Remove
}{\param{long
}{from
},
\param{long
}{to
}}
523 Removes the text between the two positions in the combo control text field.
525 \wxheading{Parameters
}
527 \docparam{from
}{The first position.
}
529 \docparam{to
}{The last position.
}
532 \membersection{wxComboCtrl::Replace
}\label{wxcomboctrlreplace
}
534 \func{void
}{Replace
}{\param{long
}{from
},
\param{long
}{to
},
\param{const wxString\&
}{value
}}
536 Replaces the text between two positions with the given text, in the combo control text field.
538 \wxheading{Parameters
}
540 \docparam{from
}{The first position.
}
542 \docparam{to
}{The second position.
}
544 \docparam{text
}{The text to insert.
}
547 \membersection{wxComboCtrl::SetButtonBitmaps
}\label{wxcomboctrlsetbuttonbitmaps
}
549 \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
}}
551 Sets custom dropdown button graphics.
553 \wxheading{Parameters
}
555 \docparam{bmpNormal
}{Default button image.
}
556 \docparam{pushButtonBg
}{If
\true, blank push button background is painted
558 \docparam{bmpPressed
}{Depressed button image.
}
559 \docparam{bmpHover
}{Button image when mouse hovers above it. This
560 should be ignored on platforms and themes that do not generally draw
561 different kind of button on mouse hover.
}
562 \docparam{bmpDisabled
}{Disabled button image.
}
565 \membersection{wxComboCtrl::SetButtonPosition
}\label{wxcomboctrlsetbuttonposition
}
567 \func{void
}{SetButtonPosition
}{\param{int
}{width = -
1},
\param{int
}{height = -
1},
\param{int
}{side = wxRIGHT
},
\param{int
}{spacingX =
0}}
569 Sets size and position of dropdown button.
571 \wxheading{Parameters
}
573 \docparam{width
}{Button width. Value <= $
0$ specifies default.
}
574 \docparam{height
}{Button height. Value <= $
0$ specifies default.
}
575 \docparam{side
}{Indicates which side the button will be placed.
576 Value can be
{\tt wxLEFT
} or
{\tt wxRIGHT
}.
}
577 \docparam{spacingX
}{Horizontal spacing around the button. Default is $
0$.
}
580 \membersection{wxComboCtrl::SetCustomPaintWidth
}\label{wxcomboctrlsetcustompaintwidth
}
582 \func{void
}{SetCustomPaintWidth
}{\param{int
}{width
}}
584 Set width, in pixels, of custom painted area in control without
{\tt wxCB
\_READONLY}
585 style. In read-only
\helpref{wxOwnerDrawnComboBox
}{wxownerdrawncombobox
}, this is used
586 to indicate area that is not covered by the focus rectangle.
589 \membersection{wxComboCtrl::SetInsertionPoint
}\label{wxcomboctrlsetinsertionpoint
}
591 \func{void
}{SetInsertionPoint
}{\param{long
}{pos
}}
593 Sets the insertion point in the text field.
595 \wxheading{Parameters
}
597 \docparam{pos
}{The new insertion point.
}
600 \membersection{wxComboCtrl::SetInsertionPointEnd
}\label{wxcomboctrlsetinsertionpointend
}
602 \func{void
}{SetInsertionPointEnd
}{\void}
604 Sets the insertion point at the end of the combo control text field.
607 \membersection{wxComboCtrl::SetPopupAnchor
}\label{wxcomboctrlsetpopupanchor
}
609 \func{void
}{SetPopupAnchor
}{\param{int
}{anchorSide
}}
611 Set side of the control to which the popup will align itself. Valid values are
612 {\tt wxLEFT
},
{\tt wxRIGHT
} and $
0$. The default value $
0$ means that the most appropriate
613 side is used (which, currently, is always
{\tt wxLEFT
}).
616 \membersection{wxComboCtrl::SetPopupControl
}\label{wxcomboctrlsetpopupcontrol
}
618 \func{void
}{SetPopupControl
}{\param{wxComboPopup*
}{popup
}}
620 Set popup interface class derived from wxComboPopup.
621 This method should be called as soon as possible after the control
622 has been created, unless
\helpref{OnButtonClick
}{wxcomboctrlonbuttonclick
}
626 \membersection{wxComboCtrl::SetPopupExtents
}\label{wxcomboctrlsetpopupextents
}
628 \func{void
}{SetPopupExtents
}{\param{int
}{extLeft
},
\param{int
}{extRight
}}
630 Extends popup size horizontally, relative to the edges of the combo control.
632 \wxheading{Parameters
}
634 \docparam{extLeft
}{How many pixel to extend beyond the left edge of the
635 control. Default is $
0$.
}
636 \docparam{extRight
}{How many pixel to extend beyond the right edge of the
637 control. Default is $
0$.
}
641 Popup minimum width may override arguments.
643 It is up to the popup to fully take this into account.
646 \membersection{wxComboCtrl::SetPopupMaxHeight
}\label{wxcomboctrlsetpopupmaxheight
}
648 \func{void
}{SetPopupMaxHeight
}{\param{int
}{height
}}
650 Sets preferred maximum height of the popup.
654 Value -
1 indicates the default.
656 Also, popup implementation may choose to ignore this.
659 \membersection{wxComboCtrl::SetPopupMinWidth
}\label{wxcomboctrlsetpopupminwidth
}
661 \func{void
}{SetPopupMinWidth
}{\param{int
}{width
}}
663 Sets minimum width of the popup. If wider than combo control, it will extend to the left.
667 Value -
1 indicates the default.
669 Also, popup implementation may choose to ignore this.
672 \membersection{wxComboCtrl::SetSelection
}\label{wxcomboctrlsetselection
}
674 \func{void
}{SetSelection
}{\param{long
}{from
},
\param{long
}{to
}}
676 Selects the text between the two positions, in the combo control text field.
678 \wxheading{Parameters
}
680 \docparam{from
}{The first position.
}
682 \docparam{to
}{The second position.
}
685 \membersection{wxComboCtrl::SetText
}\label{wxcomboctrlsettext
}
687 \func{void
}{SetText
}{\param{const wxString\&
}{value
}}
689 Sets the text for the text field without affecting the
690 popup. Thus, unlike
\helpref{SetValue
}{wxcomboctrlsetvalue
}, it works
691 equally well with combo control using
{\tt wxCB
\_READONLY} style.
694 \membersection{wxComboCtrl::SetTextIndent
}\label{wxcomboctrlsettextindent
}
696 \func{void
}{SetTextIndent
}{\param{int
}{indent
}}
698 This will set the space in pixels between left edge of the control and the
699 text, regardless whether control is read-only or not. Value -
1 can be
700 given to indicate platform default.
703 \membersection{wxComboCtrl::SetValue
}\label{wxcomboctrlsetvalue
}
705 \func{void
}{SetValue
}{\param{const wxString\&
}{value
}}
707 Sets the text for the combo control text field.
709 {\bf NB:
} For a combo control with
{\tt wxCB
\_READONLY} style the
710 string must be accepted by the popup (for instance, exist in the dropdown
711 list), otherwise the call to SetValue() is ignored
714 \membersection{wxComboCtrl::SetValueWithEvent
}\label{wxcomboctrlsetvaluewithevent
}
716 \func{void
}{SetValueWithEvent
}{\param{const wxString\&
}{value
},
\param{bool
}{withEvent = true
}}
718 Same as SetValue, but also sends wxCommandEvent of type wxEVT
\_COMMAND\_TEXT\_UPDATED
719 if
{\tt withEvent
} is
\true.
722 \membersection{wxComboCtrl::ShowPopup
}\label{wxcomboctrlshowpopup
}
724 \func{void
}{ShowPopup
}{\void}
729 \membersection{wxComboCtrl::Undo
}\label{wxcomboctrlundo
}
731 \func{void
}{Undo
}{\void}
733 Undoes the last edit in the text field. Windows only.
736 \membersection{wxComboCtrl::UseAltPopupWindow
}\label{wxcomboctrlusealtpopupwindow
}
738 \func{void
}{UseAltPopupWindow
}{\param{bool
}{enable = true
}}
740 Enable or disable usage of an alternative popup window, which guarantees
741 ability to focus the popup control, and allows common native controls to
742 function normally. This alternative popup window is usually a wxDialog,
743 and as such, when it is shown, its parent top-level window will appear
744 as if the focus has been lost from it.