]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/comboctrl.tex
Fix "depreciated" to "deprecated".
[wxWidgets.git] / docs / latex / wx / comboctrl.tex
CommitLineData
0dfff674
WS
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: comboctrl.tex
3%% Purpose: wxComboCtrl docs
4%% Author: Jaakko Salli
5%% Modified by:
6%% Created:
7%% RCS-ID: $Id$
8%% Copyright: (c) Jaakko Salli
9%% License: wxWindows license
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxComboCtrl}}\label{wxcomboctrl}
13
14A combo control is a generic combobox that allows totally
15custom popup. In addition it has other customization features.
16For instance, position and size of the dropdown button
17can be changed.
18
19\wxheading{Setting Custom Popup for wxComboCtrl}
20
21wxComboCtrl needs to be told somehow which control to use
22and this is done by SetPopupControl(). However, we need
23something more than just a wxControl in this method as,
24for example, we need to call SetStringValue("initial text value")
25and wxControl doesn't have such method. So we also need a
26\helpref{wxComboPopup}{wxcombopopup} which is an interface which
27must be implemented by a control to be usable as a popup.
28
29We couldn't derive wxComboPopup from wxControl as this would make it
30impossible to have a class deriving from a wxWidgets control and from
31it, so instead it is just a mix-in.
32
33Here's a minimal sample of \helpref{wxListView}{wxlistview} popup:
34
35\begin{verbatim}
36
37#include <wx/combo.h>
38#include <wx/listctrl.h>
39
40class wxListViewComboPopup : public wxListView,
41 public wxComboPopup
42{
43public:
44
45 // Initialize member variables
46 virtual void Init()
47 {
48 m_value = -1;
49 }
50
51 // Create popup control
52 virtual bool Create(wxWindow* parent)
53 {
54 return wxListView::Create(parent,1,wxPoint(0,0),wxDefaultSize);
55 }
56
57 // Return pointer to the created control
58 virtual wxWindow *GetControl() { return this; }
59
60 // Translate string into a list selection
61 virtual void SetStringValue(const wxString& s)
62 {
63 int n = wxListView::FindItem(-1,s);
64 if ( n >= 0 && n < wxListView::GetItemCount() )
65 wxListView::Select(n);
66 }
67
68 // Get list selection as a string
69 virtual wxString GetStringValue() const
70 {
71 if ( m_value >= 0 )
72 return wxListView::GetItemText(m_value);
73 return wxEmptyString;
74 }
75
76 // Do mouse hot-tracking (which is typical in list popups)
77 void OnMouseMove(wxMouseEvent& event)
78 {
79 // TODO: Move selection to cursor
80 }
81
82 // On mouse left up, set the value and close the popup
83 void OnMouseClick(wxMouseEvent& WXUNUSED(event))
84 {
85 m_value = wxListView::GetFirstSelected();
86
87 // TODO: Send event as well
88
89 Dismiss();
90 }
91
92protected:
93
94 int m_value; // current item index
95
96private:
97 DECLARE_EVENT_TABLE()
98};
99
100BEGIN_EVENT_TABLE(wxListViewComboPopup, wxListView)
101 EVT_MOTION(wxListViewComboPopup::OnMouseMove)
102 EVT_LEFT_UP(wxListViewComboPopup::OnMouseClick)
103END_EVENT_TABLE()
104
105\end{verbatim}
106
107Here's how you would create and populate it in a dialog constructor:
108
109\begin{verbatim}
110
111 wxComboCtrl* comboCtrl = new wxComboCtrl(this,wxID_ANY,wxEmptyString);
112
113 wxListViewComboPopup* popupCtrl = new wxListViewComboPopup();
114
115 comboCtrl->SetPopupControl(popupCtrl);
116
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"));
121
122\end{verbatim}
123
124\wxheading{Derived from}
125
126\helpref{wxControl}{wxcontrol}\\
127\helpref{wxWindow}{wxwindow}\\
128\helpref{wxEvtHandler}{wxevthandler}\\
129\helpref{wxObject}{wxobject}
130
131\wxheading{Include files}
132
133<combo.h>
134
135\wxheading{Window styles}
136
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.}
591087ed 140\twocolitem{\windowstyle{wxTE\_PROCESS\_ENTER}}{The control will generate
0dfff674
WS
141the event wxEVT\_COMMAND\_TEXT\_ENTER (otherwise pressing Enter key
142is either processed internally by the control or used for navigation between
143dialog controls). Windows only.}
144\twocolitem{\windowstyle{wxCC\_SPECIAL\_DCLICK}}{Double-clicking triggers a call
145to popup's OnComboDoubleClick. Actual behaviour is defined by a derived
146class. For instance, wxOwnerDrawnComboBox will cycle an item. This style only
147applies if wxCB\_READONLY is used as well.}
0dfff674
WS
148\twocolitem{\windowstyle{wxCC\_STD\_BUTTON}}{Drop button will behave
149more like a standard push button.}
150\end{twocollist}
151
152See also \helpref{window styles overview}{windowstyles}.
153
154\wxheading{Event handling}
155
156\twocolwidtha{7cm}
157\begin{twocollist}\itemsep=0pt
158\twocolitem{{\bf EVT\_TEXT(id, func)}}{Process a wxEVT\_COMMAND\_TEXT\_UPDATED event,
159when the text changes.}
160\twocolitem{{\bf EVT\_TEXT\_ENTER(id, func)}}{Process a wxEVT\_COMMAND\_TEXT\_ENTER event,
161when <RETURN> is pressed in the combo control.}
162\end{twocollist}
163
164\wxheading{See also}
165
166\helpref{wxComboBox}{wxcombobox}, \helpref{wxChoice}{wxchoice},
167\helpref{wxOwnerDrawnComboBox}{wxownerdrawncombobox},
168\rtfsp\helpref{wxComboPopup}{wxcombopopup}, \helpref{wxCommandEvent}{wxcommandevent}
169
170\latexignore{\rtfignore{\wxheading{Members}}}
171
172
173\membersection{wxComboCtrl::wxComboCtrl}\label{wxcomboctrlctor}
174
175\func{}{wxComboCtrl}{\void}
176
177Default constructor.
178
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"}}
182
183Constructor, creating and showing a combo control.
184
185\wxheading{Parameters}
186
187\docparam{parent}{Parent window. Must not be NULL.}
188
189\docparam{id}{Window identifier. A value of -1 indicates a default value.}
190
191\docparam{value}{Initial selection string. An empty string indicates no selection.}
192
193\docparam{pos}{Window position.}
194
195\docparam{size}{Window size. If the default size (-1, -1) is specified then the window is sized
196appropriately.}
197
198\docparam{style}{Window style. See \helpref{wxComboCtrl}{wxcomboctrl}.}
199
200\docparam{validator}{Window validator.}
201
202\docparam{name}{Window name.}
203
204\wxheading{See also}
205
206\helpref{wxComboCtrl::Create}{wxcomboctrlcreate}, \helpref{wxValidator}{wxvalidator}
207
208
209\membersection{wxComboCtrl::\destruct{wxComboCtrl}}\label{wxcomboctrldtor}
210
211\func{}{\destruct{wxComboCtrl}}{\void}
212
213Destructor, destroying the combo control.
214
215
974a12f8
RR
216\membersection{wxComboCtrl::AnimateShow}\label{wxcomboctrlanimateshow}
217
218\func{virtual bool}{AnimateShow}{\param{const wxRect\& }{rect}, \param{int }{flags}}
219
220This member function is not normally called in application code.
221Instead, it can be implemented in a derived class to create a
222custom popup animation.
223
224\wxheading{Parameters}
225
226Same as in \helpref{DoShowPopup}{wxcomboctrldoshowpopup}.
227
228\wxheading{Return value}
229
230\true if animation finishes before the function returns.
231\false otherwise. In the latter case you need to manually call DoShowPopup
232after the animation ends.
233
234
0dfff674
WS
235\membersection{wxComboCtrl::Create}\label{wxcomboctrlcreate}
236
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"}}
240
241Creates the combo control for two-step construction. Derived classes
242should call or replace this function. See \helpref{wxComboCtrl::wxComboCtrl}{wxcomboctrlctor}\rtfsp
243for further details.
244
245
246\membersection{wxComboCtrl::Copy}\label{wxcomboctrlcopy}
247
248\func{void}{Copy}{\void}
249
250Copies the selected text to the clipboard.
251
252
253\membersection{wxComboCtrl::Cut}\label{wxcomboctrlcut}
254
255\func{void}{Cut}{\void}
256
257Copies the selected text to the clipboard and removes the selection.
258
259
df348ff8
RR
260\membersection{wxComboCtrl::DoSetPopupControl}\label{wxcomboctrldosetpopupcontrol}
261
262\func{void}{DoSetPopupControl}{\param{wxComboPopup* }{popup}}
263
264This member function is not normally called in application code.
265Instead, it can be implemented in a derived class to return
266default wxComboPopup, incase {\tt popup} is NULL.
267
268\textbf{Note:} If you have implemented OnButtonClick to do
269something else than show the popup, then DoSetPopupControl
270must always return NULL.
271
272
974a12f8
RR
273\membersection{wxComboCtrl::DoShowPopup}\label{wxcomboctrldoshowpopup}
274
275\func{virtual void}{DoShowPopup}{\param{const wxRect\& }{rect}, \param{int }{flags}}
276
277This member function is not normally called in application code.
278Instead, it must be called in a derived class to make sure popup
279is properly shown after a popup animation has finished (but only
280if \helpref{AnimateShow}{wxcomboctrlanimateshow} did not finish
281the animation within it's function scope).
282
283\wxheading{Parameters}
284
285\docparam{rect}{Position to show the popup window at, in screen coordinates.}
286
287\docparam{flags}{Combination of any of the following:}
288\twocolwidtha{8cm}%
289\begin{twocollist}\itemsep=0pt
290\twocolitem{{\tt wxComboCtrl::ShowAbove}}{Popup is shown above the control instead
291of below.}
292\twocolitem{{\tt wxComboCtrl::CanDeferShow}}{Showing the popup can be deferred
293to happen sometime after \helpref{ShowPopup}{wxcomboctrlshowpopup} has finished.
294In this case, \helpref{AnimateShow}{wxcomboctrlanimateshow} must return \false.}
295\end{twocollist}
296
297
30be036c
RR
298\membersection{wxComboCtrl::EnablePopupAnimation}\label{wxcomboctrlenablepopupanimation}
299
300\func{void}{EnablePopupAnimation}{\param{bool }{enable = true}}
301
302Enables or disables popup animation, if any, depending on the value of
303the argument.
304
305
0dfff674
WS
306\membersection{wxComboCtrl::GetBitmapDisabled}\label{wxcomboctrlgetbitmapdisabled}
307
308\constfunc{const wxBitmap\&}{GetBitmapDisabled}{\void}
309
310Returns disabled button bitmap that has been set with
311\helpref{SetButtonBitmaps}{wxcomboctrlsetbuttonbitmaps}.
312
313\wxheading{Return value}
314
315A reference to the disabled state bitmap.
316
317
318\membersection{wxComboCtrl::GetBitmapHover}\label{wxcomboctrlgetbitmaphover}
319
320\constfunc{const wxBitmap\&}{GetBitmapHover}{\void}
321
322Returns button mouse hover bitmap that has been set with
323\helpref{SetButtonBitmaps}{wxcomboctrlsetbuttonbitmaps}.
324
325\wxheading{Return value}
326
327A reference to the mouse hover state bitmap.
328
329
330\membersection{wxComboCtrl::GetBitmapNormal}\label{wxcomboctrlgetbitmapnormal}
331
332\constfunc{const wxBitmap\&}{GetBitmapNormal}{\void}
333
334Returns default button bitmap that has been set with
335\helpref{SetButtonBitmaps}{wxcomboctrlsetbuttonbitmaps}.
336
337\wxheading{Return value}
338
339A reference to the normal state bitmap.
340
341
342\membersection{wxComboCtrl::GetBitmapPressed}\label{wxcomboctrlgetbitmappressed}
343
344\constfunc{const wxBitmap\&}{GetBitmapPressed}{\void}
345
346Returns depressed button bitmap that has been set with
347\helpref{SetButtonBitmaps}{wxcomboctrlsetbuttonbitmaps}.
348
349\wxheading{Return value}
350
351A reference to the depressed state bitmap.
352
353
7dc234d6
WS
354\membersection{wxComboCtrl::GetButtonSize}\label{wxcomboctrlgetbuttonsize}
355
356\func{wxSize}{GetButtonSize}{\void}
357
358Returns current size of the dropdown button.
359
360
0dfff674
WS
361\membersection{wxComboCtrl::GetCustomPaintWidth}\label{wxcomboctrlgetcustompaintwidth}
362
363\constfunc{int}{GetCustomPaintWidth}{\void}
364
365Returns custom painted area in control.
366
367\wxheading{See also}
368
369\helpref{wxComboCtrl::SetCustomPaintWidth}{wxcomboctrlsetcustompaintwidth}.
370
371
372\membersection{wxComboCtrl::GetFeatures}\label{wxcomboctrlgetfeatures}
373
374\func{static int}{GetFeatures}{\void}
375
376Returns features supported by wxComboCtrl. If needed feature is missing,
377you need to instead use wxGenericComboCtrl, which however may lack
378native look and feel (but otherwise sports identical API).
379
380\wxheading{Return value}
381
382Value returned is a combination of following flags:
383
384\twocolwidtha{8cm}%
385\begin{twocollist}\itemsep=0pt
386\twocolitem{{\tt wxComboCtrlFeatures::MovableButton}}{Button can
387be on either side of the control.}
388\twocolitem{{\tt wxComboCtrlFeatures::BitmapButton}}{Button may
389be replaced with bitmap.}
390\twocolitem{{\tt wxComboCtrlFeatures::ButtonSpacing}}{Button can
391have spacing.}
392\twocolitem{{\tt wxComboCtrlFeatures::TextIndent}}{SetTextIndent
393works.}
394\twocolitem{{\tt wxComboCtrlFeatures::PaintControl}}{Combo control
395itself can be custom painted.}
396\twocolitem{{\tt wxComboCtrlFeatures::PaintWritable}}{A variable-
397width area in front of writable combo control's textctrl can
398be custom painted.}
399\twocolitem{{\tt wxComboCtrlFeatures::Borderless}}{wxNO\_BORDER
400window style works.}
401\twocolitem{{\tt wxComboCtrlFeatures::All}}{All of the
402above.}
403\end{twocollist}
404
405
406\membersection{wxComboCtrl::GetInsertionPoint}\label{wxcomboctrlgetinsertionpoint}
407
408\constfunc{long}{GetInsertionPoint}{\void}
409
410Returns the insertion point for the combo control's text field.
411
412\textbf{Note:} Under wxMSW, this function always returns $0$ if the combo control
413doesn't have the focus.
414
415
974a12f8
RR
416\membersection{wxComboCtrl::IsPopupWindowState}\label{wxcomboctrlispopupwindowstate}
417
418\constfunc{bool}{IsPopupWindowState}{\param{int }{state}}
419
420Returns \true if the popup window is in the given state.
421Possible values are:
422\twocolwidtha{8cm}%
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
426popup animation has not yet finished.}
427\twocolitem{{\tt wxComboCtrl::Visible}}{Popup window is fully visible.}
428\end{twocollist}
429
430
431
0dfff674
WS
432\membersection{wxComboCtrl::GetLastPosition}\label{wxcomboctrlgetlastposition}
433
434\constfunc{long}{GetLastPosition}{\void}
435
436Returns the last position in the combo control text field.
437
438
439\membersection{wxComboCtrl::GetPopupControl}\label{wxcomboctrlgetpopupcontrol}
440
441\func{wxComboPopup*}{GetPopupControl}{\void}
442
443Returns current popup interface that has been set with SetPopupControl.
444
445
446\membersection{wxComboCtrl::GetPopupWindow}\label{wxcomboctrlgetpopupwindow}
447
448\constfunc{wxWindow*}{GetPopupWindow}{\void}
449
450Returns popup window containing the popup control.
451
452
453\membersection{wxComboCtrl::GetTextCtrl}\label{wxcomboctrlgettextctrl}
454
455\constfunc{wxTextCtrl*}{GetTextCtrl}{\void}
456
457Get the text control which is part of the combo control.
458
459
460\membersection{wxComboCtrl::GetTextIndent}\label{wxcomboctrlgettextindent}
461
462\constfunc{wxCoord}{GetTextIndent}{\void}
463
464Returns actual indentation in pixels.
465
466
df348ff8
RR
467\membersection{wxComboCtrl::GetTextRect}\label{wxcomboctrlgettextrect}
468
469\constfunc{const wxRect\&}{GetTextRect}{\void}
470
471Returns area covered by the text field (includes everything except
472borders and the dropdown button).
473
474
0dfff674
WS
475\membersection{wxComboCtrl::GetValue}\label{wxcomboctrlgetvalue}
476
477\constfunc{wxString}{GetValue}{\void}
478
479Returns text representation of the current value. For writable
480combo control it always returns the value in the text field.
481
482
483\membersection{wxComboCtrl::HidePopup}\label{wxcomboctrlhidepopup}
484
485\func{void}{HidePopup}{\void}
486
487Dismisses the popup window.
488
489
490\membersection{wxComboCtrl::IsPopupShown}\label{wxcomboctrlispopupshown}
491
492\constfunc{bool}{IsPopupShown}{\void}
493
494Returns \true if the popup is currently shown
495
496
497\membersection{wxComboCtrl::OnButtonClick}\label{wxcomboctrlonbuttonclick}
498
499\func{void}{OnButtonClick}{\void}
500
501Implement in a derived class to define what happens on
502dropdown button click.
503
504Default action is to show the popup.
505
df348ff8
RR
506\textbf{Note:} If you implement this to do something else than
507show the popup, you must then also implement
508\helpref{DoSetPopupControl}{wxcomboctrldosetpopupcontrol} to always
509return NULL.
510
0dfff674
WS
511
512\membersection{wxComboCtrl::Paste}\label{wxcomboctrlpaste}
513
514\func{void}{Paste}{\void}
515
516Pastes text from the clipboard to the text field.
517
518
519\membersection{wxComboCtrl::Remove}\label{wxcomboctrlremove}
520
521\func{void}{Remove}{\param{long }{from}, \param{long }{to}}
522
523Removes the text between the two positions in the combo control text field.
524
525\wxheading{Parameters}
526
527\docparam{from}{The first position.}
528
529\docparam{to}{The last position.}
530
531
532\membersection{wxComboCtrl::Replace}\label{wxcomboctrlreplace}
533
534\func{void}{Replace}{\param{long }{from}, \param{long }{to}, \param{const wxString\& }{value}}
535
536Replaces the text between two positions with the given text, in the combo control text field.
537
538\wxheading{Parameters}
539
540\docparam{from}{The first position.}
541
542\docparam{to}{The second position.}
543
544\docparam{text}{The text to insert.}
545
546
547\membersection{wxComboCtrl::SetButtonBitmaps}\label{wxcomboctrlsetbuttonbitmaps}
548
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}}
550
551Sets custom dropdown button graphics.
552
553\wxheading{Parameters}
554
555\docparam{bmpNormal}{Default button image.}
556\docparam{pushButtonBg}{If \true, blank push button background is painted
557below the image.}
558\docparam{bmpPressed}{Depressed button image.}
559\docparam{bmpHover}{Button image when mouse hovers above it. This
560should be ignored on platforms and themes that do not generally draw
561different kind of button on mouse hover.}
562\docparam{bmpDisabled}{Disabled button image.}
563
564
565\membersection{wxComboCtrl::SetButtonPosition}\label{wxcomboctrlsetbuttonposition}
566
7dc234d6 567\func{void}{SetButtonPosition}{\param{int }{width = -1}, \param{int }{height = -1}, \param{int }{side = wxRIGHT}, \param{int }{spacingX = 0}}
0dfff674
WS
568
569Sets size and position of dropdown button.
570
571\wxheading{Parameters}
572
7dc234d6
WS
573\docparam{width}{Button width. Value <= $0$ specifies default.}
574\docparam{height}{Button height. Value <= $0$ specifies default.}
0dfff674
WS
575\docparam{side}{Indicates which side the button will be placed.
576Value can be {\tt wxLEFT} or {\tt wxRIGHT}.}
577\docparam{spacingX}{Horizontal spacing around the button. Default is $0$.}
578
579
580\membersection{wxComboCtrl::SetCustomPaintWidth}\label{wxcomboctrlsetcustompaintwidth}
581
582\func{void}{SetCustomPaintWidth}{\param{int }{width}}
583
584Set width, in pixels, of custom painted area in control without {\tt wxCB\_READONLY}
585style. In read-only \helpref{wxOwnerDrawnComboBox}{wxownerdrawncombobox}, this is used
586to indicate area that is not covered by the focus rectangle.
587
588
589\membersection{wxComboCtrl::SetInsertionPoint}\label{wxcomboctrlsetinsertionpoint}
590
591\func{void}{SetInsertionPoint}{\param{long }{pos}}
592
593Sets the insertion point in the text field.
594
595\wxheading{Parameters}
596
597\docparam{pos}{The new insertion point.}
598
599
600\membersection{wxComboCtrl::SetInsertionPointEnd}\label{wxcomboctrlsetinsertionpointend}
601
602\func{void}{SetInsertionPointEnd}{\void}
603
604Sets the insertion point at the end of the combo control text field.
605
606
607\membersection{wxComboCtrl::SetPopupAnchor}\label{wxcomboctrlsetpopupanchor}
608
609\func{void}{SetPopupAnchor}{\param{int }{anchorSide}}
610
611Set 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
613side is used (which, currently, is always {\tt wxLEFT}).
614
615
616\membersection{wxComboCtrl::SetPopupControl}\label{wxcomboctrlsetpopupcontrol}
617
618\func{void}{SetPopupControl}{\param{wxComboPopup* }{popup}}
619
620Set popup interface class derived from wxComboPopup.
621This method should be called as soon as possible after the control
622has been created, unless \helpref{OnButtonClick}{wxcomboctrlonbuttonclick}
623has been overridden.
624
625
626\membersection{wxComboCtrl::SetPopupExtents}\label{wxcomboctrlsetpopupextents}
627
628\func{void}{SetPopupExtents}{\param{int }{extLeft}, \param{int }{extRight}}
629
630Extends popup size horizontally, relative to the edges of the combo control.
631
632\wxheading{Parameters}
633
634\docparam{extLeft}{How many pixel to extend beyond the left edge of the
635control. Default is $0$.}
636\docparam{extRight}{How many pixel to extend beyond the right edge of the
637control. Default is $0$.}
638
639\wxheading{Remarks}
640
641Popup minimum width may override arguments.
642
643It is up to the popup to fully take this into account.
644
645
646\membersection{wxComboCtrl::SetPopupMaxHeight}\label{wxcomboctrlsetpopupmaxheight}
647
648\func{void}{SetPopupMaxHeight}{\param{int }{height}}
649
650Sets preferred maximum height of the popup.
651
652\wxheading{Remarks}
653
654Value -1 indicates the default.
655
656Also, popup implementation may choose to ignore this.
657
658
659\membersection{wxComboCtrl::SetPopupMinWidth}\label{wxcomboctrlsetpopupminwidth}
660
661\func{void}{SetPopupMinWidth}{\param{int }{width}}
662
663Sets minimum width of the popup. If wider than combo control, it will extend to the left.
664
665\wxheading{Remarks}
666
667Value -1 indicates the default.
668
669Also, popup implementation may choose to ignore this.
670
671
672\membersection{wxComboCtrl::SetSelection}\label{wxcomboctrlsetselection}
673
674\func{void}{SetSelection}{\param{long }{from}, \param{long }{to}}
675
676Selects the text between the two positions, in the combo control text field.
677
678\wxheading{Parameters}
679
680\docparam{from}{The first position.}
681
682\docparam{to}{The second position.}
683
684
685\membersection{wxComboCtrl::SetText}\label{wxcomboctrlsettext}
686
687\func{void}{SetText}{\param{const wxString\& }{value}}
688
689Sets the text for the text field without affecting the
690popup. Thus, unlike \helpref{SetValue}{wxcomboctrlsetvalue}, it works
691equally well with combo control using {\tt wxCB\_READONLY} style.
692
693
694\membersection{wxComboCtrl::SetTextIndent}\label{wxcomboctrlsettextindent}
695
696\func{void}{SetTextIndent}{\param{int }{indent}}
697
698This will set the space in pixels between left edge of the control and the
699text, regardless whether control is read-only or not. Value -1 can be
700given to indicate platform default.
701
702
703\membersection{wxComboCtrl::SetValue}\label{wxcomboctrlsetvalue}
704
705\func{void}{SetValue}{\param{const wxString\& }{value}}
706
707Sets the text for the combo control text field.
708
709{\bf NB:} For a combo control with {\tt wxCB\_READONLY} style the
710string must be accepted by the popup (for instance, exist in the dropdown
711list), otherwise the call to SetValue() is ignored
712
713
df348ff8
RR
714\membersection{wxComboCtrl::SetValueWithEvent}\label{wxcomboctrlsetvaluewithevent}
715
716\func{void}{SetValueWithEvent}{\param{const wxString\& }{value}, \param{bool }{withEvent = true}}
717
718Same as SetValue, but also sends wxCommandEvent of type wxEVT\_COMMAND\_TEXT\_UPDATED
719if {\tt withEvent} is \true.
720
721
0dfff674
WS
722\membersection{wxComboCtrl::ShowPopup}\label{wxcomboctrlshowpopup}
723
724\func{void}{ShowPopup}{\void}
725
726Show the popup.
727
728
729\membersection{wxComboCtrl::Undo}\label{wxcomboctrlundo}
730
731\func{void}{Undo}{\void}
732
733Undoes the last edit in the text field. Windows only.
b67a86d5 734
06077aaf
VZ
735
736\membersection{wxComboCtrl::UseAltPopupWindow}\label{wxcomboctrlusealtpopupwindow}
737
738\func{void}{UseAltPopupWindow}{\param{bool }{enable = true}}
739
740Enable or disable usage of an alternative popup window, which guarantees
741ability to focus the popup control, and allows common native controls to
742function normally. This alternative popup window is usually a wxDialog,
743and as such, when it is shown, its parent top-level window will appear
744as if the focus has been lost from it.
745
746