]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/comboctrl.tex
Added Get/SetParentWindow to allow the same easy printing object to be used even
[wxWidgets.git] / docs / latex / wx / comboctrl.tex
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
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
17 can be changed.
18
19 \wxheading{Setting Custom Popup for wxComboCtrl}
20
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.
28
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.
32
33 Here'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 \wxheading{Library}
40
41 \helpref{wxCore}{librarieslist}
42
43
44 class wxListViewComboPopup : public wxListView,
45 public wxComboPopup
46 {
47 public:
48
49 // Initialize member variables
50 virtual void Init()
51 {
52 m_value = -1;
53 }
54
55 // Create popup control
56 virtual bool Create(wxWindow* parent)
57 {
58 return wxListView::Create(parent,1,wxPoint(0,0),wxDefaultSize);
59 }
60
61 // Return pointer to the created control
62 virtual wxWindow *GetControl() { return this; }
63
64 // Translate string into a list selection
65 virtual void SetStringValue(const wxString& s)
66 {
67 int n = wxListView::FindItem(-1,s);
68 if ( n >= 0 && n < wxListView::GetItemCount() )
69 wxListView::Select(n);
70 }
71
72 // Get list selection as a string
73 virtual wxString GetStringValue() const
74 {
75 if ( m_value >= 0 )
76 return wxListView::GetItemText(m_value);
77 return wxEmptyString;
78 }
79
80 // Do mouse hot-tracking (which is typical in list popups)
81 void OnMouseMove(wxMouseEvent& event)
82 {
83 // TODO: Move selection to cursor
84 }
85
86 // On mouse left up, set the value and close the popup
87 void OnMouseClick(wxMouseEvent& WXUNUSED(event))
88 {
89 m_value = wxListView::GetFirstSelected();
90
91 // TODO: Send event as well
92
93 Dismiss();
94 }
95
96 protected:
97
98 int m_value; // current item index
99
100 private:
101 DECLARE_EVENT_TABLE()
102 };
103
104 BEGIN_EVENT_TABLE(wxListViewComboPopup, wxListView)
105 EVT_MOTION(wxListViewComboPopup::OnMouseMove)
106 EVT_LEFT_UP(wxListViewComboPopup::OnMouseClick)
107 END_EVENT_TABLE()
108
109 \end{verbatim}
110
111 Here's how you would create and populate it in a dialog constructor:
112
113 \begin{verbatim}
114
115 wxComboCtrl* comboCtrl = new wxComboCtrl(this,wxID_ANY,wxEmptyString);
116
117 wxListViewComboPopup* popupCtrl = new wxListViewComboPopup();
118
119 comboCtrl->SetPopupControl(popupCtrl);
120
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"));
125
126 \end{verbatim}
127
128 \wxheading{Derived from}
129
130 \helpref{wxControl}{wxcontrol}\\
131 \helpref{wxWindow}{wxwindow}\\
132 \helpref{wxEvtHandler}{wxevthandler}\\
133 \helpref{wxObject}{wxobject}
134
135 \wxheading{Include files}
136
137 <wx/combo.h>
138
139 \wxheading{Window styles}
140
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.}
154 \end{twocollist}
155
156 See also \helpref{window styles overview}{windowstyles}.
157
158 \wxheading{Event handling}
159
160 \twocolwidtha{7cm}
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.}
166 \end{twocollist}
167
168 \wxheading{See also}
169
170 \helpref{wxComboBox}{wxcombobox}, \helpref{wxChoice}{wxchoice},
171 \helpref{wxOwnerDrawnComboBox}{wxownerdrawncombobox},
172 \rtfsp\helpref{wxComboPopup}{wxcombopopup}, \helpref{wxCommandEvent}{wxcommandevent}
173
174 \latexignore{\rtfignore{\wxheading{Members}}}
175
176
177 \membersection{wxComboCtrl::wxComboCtrl}\label{wxcomboctrlctor}
178
179 \func{}{wxComboCtrl}{\void}
180
181 Default constructor.
182
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"}}
186
187 Constructor, creating and showing a combo control.
188
189 \wxheading{Parameters}
190
191 \docparam{parent}{Parent window. Must not be NULL.}
192
193 \docparam{id}{Window identifier. A value of -1 indicates a default value.}
194
195 \docparam{value}{Initial selection string. An empty string indicates no selection.}
196
197 \docparam{pos}{Window position.}
198
199 \docparam{size}{Window size. If the default size (-1, -1) is specified then the window is sized
200 appropriately.}
201
202 \docparam{style}{Window style. See \helpref{wxComboCtrl}{wxcomboctrl}.}
203
204 \docparam{validator}{Window validator.}
205
206 \docparam{name}{Window name.}
207
208 \wxheading{See also}
209
210 \helpref{wxComboCtrl::Create}{wxcomboctrlcreate}, \helpref{wxValidator}{wxvalidator}
211
212
213 \membersection{wxComboCtrl::\destruct{wxComboCtrl}}\label{wxcomboctrldtor}
214
215 \func{}{\destruct{wxComboCtrl}}{\void}
216
217 Destructor, destroying the combo control.
218
219
220 \membersection{wxComboCtrl::AnimateShow}\label{wxcomboctrlanimateshow}
221
222 \func{virtual bool}{AnimateShow}{\param{const wxRect\& }{rect}, \param{int }{flags}}
223
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.
227
228 \wxheading{Parameters}
229
230 Same as in \helpref{DoShowPopup}{wxcomboctrldoshowpopup}.
231
232 \wxheading{Return value}
233
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.
237
238
239 \membersection{wxComboCtrl::Create}\label{wxcomboctrlcreate}
240
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"}}
244
245 Creates the combo control for two-step construction. Derived classes
246 should call or replace this function. See \helpref{wxComboCtrl::wxComboCtrl}{wxcomboctrlctor}\rtfsp
247 for further details.
248
249
250 \membersection{wxComboCtrl::Copy}\label{wxcomboctrlcopy}
251
252 \func{void}{Copy}{\void}
253
254 Copies the selected text to the clipboard.
255
256
257 \membersection{wxComboCtrl::Cut}\label{wxcomboctrlcut}
258
259 \func{void}{Cut}{\void}
260
261 Copies the selected text to the clipboard and removes the selection.
262
263
264 \membersection{wxComboCtrl::DoSetPopupControl}\label{wxcomboctrldosetpopupcontrol}
265
266 \func{void}{DoSetPopupControl}{\param{wxComboPopup* }{popup}}
267
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.
271
272 \textbf{Note:} If you have implemented OnButtonClick to do
273 something else than show the popup, then DoSetPopupControl
274 must always return NULL.
275
276
277 \membersection{wxComboCtrl::DoShowPopup}\label{wxcomboctrldoshowpopup}
278
279 \func{virtual void}{DoShowPopup}{\param{const wxRect\& }{rect}, \param{int }{flags}}
280
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).
286
287 \wxheading{Parameters}
288
289 \docparam{rect}{Position to show the popup window at, in screen coordinates.}
290
291 \docparam{flags}{Combination of any of the following:}
292 \twocolwidtha{8cm}%
293 \begin{twocollist}\itemsep=0pt
294 \twocolitem{{\tt wxComboCtrl::ShowAbove}}{Popup is shown above the control instead
295 of below.}
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.}
299 \end{twocollist}
300
301
302 \membersection{wxComboCtrl::EnablePopupAnimation}\label{wxcomboctrlenablepopupanimation}
303
304 \func{void}{EnablePopupAnimation}{\param{bool }{enable = true}}
305
306 Enables or disables popup animation, if any, depending on the value of
307 the argument.
308
309
310 \membersection{wxComboCtrl::GetBitmapDisabled}\label{wxcomboctrlgetbitmapdisabled}
311
312 \constfunc{const wxBitmap\&}{GetBitmapDisabled}{\void}
313
314 Returns disabled button bitmap that has been set with
315 \helpref{SetButtonBitmaps}{wxcomboctrlsetbuttonbitmaps}.
316
317 \wxheading{Return value}
318
319 A reference to the disabled state bitmap.
320
321
322 \membersection{wxComboCtrl::GetBitmapHover}\label{wxcomboctrlgetbitmaphover}
323
324 \constfunc{const wxBitmap\&}{GetBitmapHover}{\void}
325
326 Returns button mouse hover bitmap that has been set with
327 \helpref{SetButtonBitmaps}{wxcomboctrlsetbuttonbitmaps}.
328
329 \wxheading{Return value}
330
331 A reference to the mouse hover state bitmap.
332
333
334 \membersection{wxComboCtrl::GetBitmapNormal}\label{wxcomboctrlgetbitmapnormal}
335
336 \constfunc{const wxBitmap\&}{GetBitmapNormal}{\void}
337
338 Returns default button bitmap that has been set with
339 \helpref{SetButtonBitmaps}{wxcomboctrlsetbuttonbitmaps}.
340
341 \wxheading{Return value}
342
343 A reference to the normal state bitmap.
344
345
346 \membersection{wxComboCtrl::GetBitmapPressed}\label{wxcomboctrlgetbitmappressed}
347
348 \constfunc{const wxBitmap\&}{GetBitmapPressed}{\void}
349
350 Returns depressed button bitmap that has been set with
351 \helpref{SetButtonBitmaps}{wxcomboctrlsetbuttonbitmaps}.
352
353 \wxheading{Return value}
354
355 A reference to the depressed state bitmap.
356
357
358 \membersection{wxComboCtrl::GetButtonSize}\label{wxcomboctrlgetbuttonsize}
359
360 \func{wxSize}{GetButtonSize}{\void}
361
362 Returns current size of the dropdown button.
363
364
365 \membersection{wxComboCtrl::GetCustomPaintWidth}\label{wxcomboctrlgetcustompaintwidth}
366
367 \constfunc{int}{GetCustomPaintWidth}{\void}
368
369 Returns custom painted area in control.
370
371 \wxheading{See also}
372
373 \helpref{wxComboCtrl::SetCustomPaintWidth}{wxcomboctrlsetcustompaintwidth}.
374
375
376 \membersection{wxComboCtrl::GetFeatures}\label{wxcomboctrlgetfeatures}
377
378 \func{static int}{GetFeatures}{\void}
379
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).
383
384 \wxheading{Return value}
385
386 Value returned is a combination of following flags:
387
388 \twocolwidtha{8cm}%
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
395 have spacing.}
396 \twocolitem{{\tt wxComboCtrlFeatures::TextIndent}}{SetTextIndent
397 works.}
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
402 be custom painted.}
403 \twocolitem{{\tt wxComboCtrlFeatures::Borderless}}{wxNO\_BORDER
404 window style works.}
405 \twocolitem{{\tt wxComboCtrlFeatures::All}}{All of the
406 above.}
407 \end{twocollist}
408
409
410 \membersection{wxComboCtrl::GetInsertionPoint}\label{wxcomboctrlgetinsertionpoint}
411
412 \constfunc{long}{GetInsertionPoint}{\void}
413
414 Returns the insertion point for the combo control's text field.
415
416 \textbf{Note:} Under wxMSW, this function always returns $0$ if the combo control
417 doesn't have the focus.
418
419
420 \membersection{wxComboCtrl::IsPopupWindowState}\label{wxcomboctrlispopupwindowstate}
421
422 \constfunc{bool}{IsPopupWindowState}{\param{int }{state}}
423
424 Returns \true if the popup window is in the given state.
425 Possible values are:
426 \twocolwidtha{8cm}%
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.}
432 \end{twocollist}
433
434
435
436 \membersection{wxComboCtrl::GetLastPosition}\label{wxcomboctrlgetlastposition}
437
438 \constfunc{long}{GetLastPosition}{\void}
439
440 Returns the last position in the combo control text field.
441
442
443 \membersection{wxComboCtrl::GetPopupControl}\label{wxcomboctrlgetpopupcontrol}
444
445 \func{wxComboPopup*}{GetPopupControl}{\void}
446
447 Returns current popup interface that has been set with SetPopupControl.
448
449
450 \membersection{wxComboCtrl::GetPopupWindow}\label{wxcomboctrlgetpopupwindow}
451
452 \constfunc{wxWindow*}{GetPopupWindow}{\void}
453
454 Returns popup window containing the popup control.
455
456
457 \membersection{wxComboCtrl::GetTextCtrl}\label{wxcomboctrlgettextctrl}
458
459 \constfunc{wxTextCtrl*}{GetTextCtrl}{\void}
460
461 Get the text control which is part of the combo control.
462
463
464 \membersection{wxComboCtrl::GetTextIndent}\label{wxcomboctrlgettextindent}
465
466 \constfunc{wxCoord}{GetTextIndent}{\void}
467
468 Returns actual indentation in pixels.
469
470
471 \membersection{wxComboCtrl::GetTextRect}\label{wxcomboctrlgettextrect}
472
473 \constfunc{const wxRect\&}{GetTextRect}{\void}
474
475 Returns area covered by the text field (includes everything except
476 borders and the dropdown button).
477
478
479 \membersection{wxComboCtrl::GetValue}\label{wxcomboctrlgetvalue}
480
481 \constfunc{wxString}{GetValue}{\void}
482
483 Returns text representation of the current value. For writable
484 combo control it always returns the value in the text field.
485
486
487 \membersection{wxComboCtrl::HidePopup}\label{wxcomboctrlhidepopup}
488
489 \func{void}{HidePopup}{\void}
490
491 Dismisses the popup window.
492
493
494 \membersection{wxComboCtrl::IsPopupShown}\label{wxcomboctrlispopupshown}
495
496 \constfunc{bool}{IsPopupShown}{\void}
497
498 Returns \true if the popup is currently shown
499
500
501 \membersection{wxComboCtrl::OnButtonClick}\label{wxcomboctrlonbuttonclick}
502
503 \func{void}{OnButtonClick}{\void}
504
505 Implement in a derived class to define what happens on
506 dropdown button click.
507
508 Default action is to show the popup.
509
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
513 return NULL.
514
515
516 \membersection{wxComboCtrl::Paste}\label{wxcomboctrlpaste}
517
518 \func{void}{Paste}{\void}
519
520 Pastes text from the clipboard to the text field.
521
522
523 \membersection{wxComboCtrl::Remove}\label{wxcomboctrlremove}
524
525 \func{void}{Remove}{\param{long }{from}, \param{long }{to}}
526
527 Removes the text between the two positions in the combo control text field.
528
529 \wxheading{Parameters}
530
531 \docparam{from}{The first position.}
532
533 \docparam{to}{The last position.}
534
535
536 \membersection{wxComboCtrl::Replace}\label{wxcomboctrlreplace}
537
538 \func{void}{Replace}{\param{long }{from}, \param{long }{to}, \param{const wxString\& }{value}}
539
540 Replaces the text between two positions with the given text, in the combo control text field.
541
542 \wxheading{Parameters}
543
544 \docparam{from}{The first position.}
545
546 \docparam{to}{The second position.}
547
548 \docparam{text}{The text to insert.}
549
550
551 \membersection{wxComboCtrl::SetButtonBitmaps}\label{wxcomboctrlsetbuttonbitmaps}
552
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}}
554
555 Sets custom dropdown button graphics.
556
557 \wxheading{Parameters}
558
559 \docparam{bmpNormal}{Default button image.}
560 \docparam{pushButtonBg}{If \true, blank push button background is painted
561 below the image.}
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.}
567
568
569 \membersection{wxComboCtrl::SetButtonPosition}\label{wxcomboctrlsetbuttonposition}
570
571 \func{void}{SetButtonPosition}{\param{int }{width = -1}, \param{int }{height = -1}, \param{int }{side = wxRIGHT}, \param{int }{spacingX = 0}}
572
573 Sets size and position of dropdown button.
574
575 \wxheading{Parameters}
576
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$.}
582
583
584 \membersection{wxComboCtrl::SetCustomPaintWidth}\label{wxcomboctrlsetcustompaintwidth}
585
586 \func{void}{SetCustomPaintWidth}{\param{int }{width}}
587
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.
591
592
593 \membersection{wxComboCtrl::SetInsertionPoint}\label{wxcomboctrlsetinsertionpoint}
594
595 \func{void}{SetInsertionPoint}{\param{long }{pos}}
596
597 Sets the insertion point in the text field.
598
599 \wxheading{Parameters}
600
601 \docparam{pos}{The new insertion point.}
602
603
604 \membersection{wxComboCtrl::SetInsertionPointEnd}\label{wxcomboctrlsetinsertionpointend}
605
606 \func{void}{SetInsertionPointEnd}{\void}
607
608 Sets the insertion point at the end of the combo control text field.
609
610
611 \membersection{wxComboCtrl::SetPopupAnchor}\label{wxcomboctrlsetpopupanchor}
612
613 \func{void}{SetPopupAnchor}{\param{int }{anchorSide}}
614
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}).
618
619
620 \membersection{wxComboCtrl::SetPopupControl}\label{wxcomboctrlsetpopupcontrol}
621
622 \func{void}{SetPopupControl}{\param{wxComboPopup* }{popup}}
623
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}
627 has been overridden.
628
629
630 \membersection{wxComboCtrl::SetPopupExtents}\label{wxcomboctrlsetpopupextents}
631
632 \func{void}{SetPopupExtents}{\param{int }{extLeft}, \param{int }{extRight}}
633
634 Extends popup size horizontally, relative to the edges of the combo control.
635
636 \wxheading{Parameters}
637
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$.}
642
643 \wxheading{Remarks}
644
645 Popup minimum width may override arguments.
646
647 It is up to the popup to fully take this into account.
648
649
650 \membersection{wxComboCtrl::SetPopupMaxHeight}\label{wxcomboctrlsetpopupmaxheight}
651
652 \func{void}{SetPopupMaxHeight}{\param{int }{height}}
653
654 Sets preferred maximum height of the popup.
655
656 \wxheading{Remarks}
657
658 Value -1 indicates the default.
659
660 Also, popup implementation may choose to ignore this.
661
662
663 \membersection{wxComboCtrl::SetPopupMinWidth}\label{wxcomboctrlsetpopupminwidth}
664
665 \func{void}{SetPopupMinWidth}{\param{int }{width}}
666
667 Sets minimum width of the popup. If wider than combo control, it will extend to the left.
668
669 \wxheading{Remarks}
670
671 Value -1 indicates the default.
672
673 Also, popup implementation may choose to ignore this.
674
675
676 \membersection{wxComboCtrl::SetSelection}\label{wxcomboctrlsetselection}
677
678 \func{void}{SetSelection}{\param{long }{from}, \param{long }{to}}
679
680 Selects the text between the two positions, in the combo control text field.
681
682 \wxheading{Parameters}
683
684 \docparam{from}{The first position.}
685
686 \docparam{to}{The second position.}
687
688
689 \membersection{wxComboCtrl::SetText}\label{wxcomboctrlsettext}
690
691 \func{void}{SetText}{\param{const wxString\& }{value}}
692
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.
696
697
698 \membersection{wxComboCtrl::SetTextIndent}\label{wxcomboctrlsettextindent}
699
700 \func{void}{SetTextIndent}{\param{int }{indent}}
701
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.
705
706
707 \membersection{wxComboCtrl::SetValue}\label{wxcomboctrlsetvalue}
708
709 \func{void}{SetValue}{\param{const wxString\& }{value}}
710
711 Sets the text for the combo control text field.
712
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
716
717
718 \membersection{wxComboCtrl::SetValueWithEvent}\label{wxcomboctrlsetvaluewithevent}
719
720 \func{void}{SetValueWithEvent}{\param{const wxString\& }{value}, \param{bool }{withEvent = true}}
721
722 Same as SetValue, but also sends wxCommandEvent of type wxEVT\_COMMAND\_TEXT\_UPDATED
723 if {\tt withEvent} is \true.
724
725
726 \membersection{wxComboCtrl::ShowPopup}\label{wxcomboctrlshowpopup}
727
728 \func{void}{ShowPopup}{\void}
729
730 Show the popup.
731
732
733 \membersection{wxComboCtrl::Undo}\label{wxcomboctrlundo}
734
735 \func{void}{Undo}{\void}
736
737 Undoes the last edit in the text field. Windows only.
738
739
740 \membersection{wxComboCtrl::UseAltPopupWindow}\label{wxcomboctrlusealtpopupwindow}
741
742 \func{void}{UseAltPopupWindow}{\param{bool }{enable = true}}
743
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.
749
750