]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/comboctrl.tex
better documentation for wxWindow::SetSizerAndFit()
[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>
a7af285d
VZ
39\wxheading{Library}
40
41\helpref{wxCore}{librarieslist}
42
0dfff674
WS
43
44class wxListViewComboPopup : public wxListView,
45 public wxComboPopup
46{
47public:
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
96protected:
97
98 int m_value; // current item index
99
100private:
101 DECLARE_EVENT_TABLE()
102};
103
104BEGIN_EVENT_TABLE(wxListViewComboPopup, wxListView)
105 EVT_MOTION(wxListViewComboPopup::OnMouseMove)
106 EVT_LEFT_UP(wxListViewComboPopup::OnMouseClick)
107END_EVENT_TABLE()
108
109\end{verbatim}
110
111Here'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
991ad6cd 137<wx/combo.h>
0dfff674
WS
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.}
591087ed 144\twocolitem{\windowstyle{wxTE\_PROCESS\_ENTER}}{The control will generate
0dfff674
WS
145the event wxEVT\_COMMAND\_TEXT\_ENTER (otherwise pressing Enter key
146is either processed internally by the control or used for navigation between
147dialog controls). Windows only.}
148\twocolitem{\windowstyle{wxCC\_SPECIAL\_DCLICK}}{Double-clicking triggers a call
149to popup's OnComboDoubleClick. Actual behaviour is defined by a derived
150class. For instance, wxOwnerDrawnComboBox will cycle an item. This style only
151applies if wxCB\_READONLY is used as well.}
0dfff674
WS
152\twocolitem{\windowstyle{wxCC\_STD\_BUTTON}}{Drop button will behave
153more like a standard push button.}
154\end{twocollist}
155
156See 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,
163when the text changes.}
164\twocolitem{{\bf EVT\_TEXT\_ENTER(id, func)}}{Process a wxEVT\_COMMAND\_TEXT\_ENTER event,
165when <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
181Default 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
187Constructor, 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
200appropriately.}
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
217Destructor, destroying the combo control.
218
219
974a12f8
RR
220\membersection{wxComboCtrl::AnimateShow}\label{wxcomboctrlanimateshow}
221
222\func{virtual bool}{AnimateShow}{\param{const wxRect\& }{rect}, \param{int }{flags}}
223
224This member function is not normally called in application code.
225Instead, it can be implemented in a derived class to create a
226custom popup animation.
227
228\wxheading{Parameters}
229
230Same 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
236after the animation ends.
237
238
0dfff674
WS
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
245Creates the combo control for two-step construction. Derived classes
246should call or replace this function. See \helpref{wxComboCtrl::wxComboCtrl}{wxcomboctrlctor}\rtfsp
247for further details.
248
249
250\membersection{wxComboCtrl::Copy}\label{wxcomboctrlcopy}
251
252\func{void}{Copy}{\void}
253
254Copies the selected text to the clipboard.
255
256
257\membersection{wxComboCtrl::Cut}\label{wxcomboctrlcut}
258
259\func{void}{Cut}{\void}
260
261Copies the selected text to the clipboard and removes the selection.
262
263
df348ff8
RR
264\membersection{wxComboCtrl::DoSetPopupControl}\label{wxcomboctrldosetpopupcontrol}
265
266\func{void}{DoSetPopupControl}{\param{wxComboPopup* }{popup}}
267
268This member function is not normally called in application code.
269Instead, it can be implemented in a derived class to return
270default wxComboPopup, incase {\tt popup} is NULL.
271
272\textbf{Note:} If you have implemented OnButtonClick to do
273something else than show the popup, then DoSetPopupControl
274must always return NULL.
275
276
974a12f8
RR
277\membersection{wxComboCtrl::DoShowPopup}\label{wxcomboctrldoshowpopup}
278
279\func{virtual void}{DoShowPopup}{\param{const wxRect\& }{rect}, \param{int }{flags}}
280
281This member function is not normally called in application code.
282Instead, it must be called in a derived class to make sure popup
283is properly shown after a popup animation has finished (but only
284if \helpref{AnimateShow}{wxcomboctrlanimateshow} did not finish
285the 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
295of below.}
296\twocolitem{{\tt wxComboCtrl::CanDeferShow}}{Showing the popup can be deferred
297to happen sometime after \helpref{ShowPopup}{wxcomboctrlshowpopup} has finished.
298In this case, \helpref{AnimateShow}{wxcomboctrlanimateshow} must return \false.}
299\end{twocollist}
300
301
30be036c
RR
302\membersection{wxComboCtrl::EnablePopupAnimation}\label{wxcomboctrlenablepopupanimation}
303
304\func{void}{EnablePopupAnimation}{\param{bool }{enable = true}}
305
306Enables or disables popup animation, if any, depending on the value of
307the argument.
308
309
0dfff674
WS
310\membersection{wxComboCtrl::GetBitmapDisabled}\label{wxcomboctrlgetbitmapdisabled}
311
312\constfunc{const wxBitmap\&}{GetBitmapDisabled}{\void}
313
314Returns disabled button bitmap that has been set with
315\helpref{SetButtonBitmaps}{wxcomboctrlsetbuttonbitmaps}.
316
317\wxheading{Return value}
318
319A reference to the disabled state bitmap.
320
321
322\membersection{wxComboCtrl::GetBitmapHover}\label{wxcomboctrlgetbitmaphover}
323
324\constfunc{const wxBitmap\&}{GetBitmapHover}{\void}
325
326Returns button mouse hover bitmap that has been set with
327\helpref{SetButtonBitmaps}{wxcomboctrlsetbuttonbitmaps}.
328
329\wxheading{Return value}
330
331A reference to the mouse hover state bitmap.
332
333
334\membersection{wxComboCtrl::GetBitmapNormal}\label{wxcomboctrlgetbitmapnormal}
335
336\constfunc{const wxBitmap\&}{GetBitmapNormal}{\void}
337
338Returns default button bitmap that has been set with
339\helpref{SetButtonBitmaps}{wxcomboctrlsetbuttonbitmaps}.
340
341\wxheading{Return value}
342
343A reference to the normal state bitmap.
344
345
346\membersection{wxComboCtrl::GetBitmapPressed}\label{wxcomboctrlgetbitmappressed}
347
348\constfunc{const wxBitmap\&}{GetBitmapPressed}{\void}
349
350Returns depressed button bitmap that has been set with
351\helpref{SetButtonBitmaps}{wxcomboctrlsetbuttonbitmaps}.
352
353\wxheading{Return value}
354
355A reference to the depressed state bitmap.
356
357
7dc234d6
WS
358\membersection{wxComboCtrl::GetButtonSize}\label{wxcomboctrlgetbuttonsize}
359
360\func{wxSize}{GetButtonSize}{\void}
361
362Returns current size of the dropdown button.
363
364
0dfff674
WS
365\membersection{wxComboCtrl::GetCustomPaintWidth}\label{wxcomboctrlgetcustompaintwidth}
366
367\constfunc{int}{GetCustomPaintWidth}{\void}
368
369Returns 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
380Returns features supported by wxComboCtrl. If needed feature is missing,
381you need to instead use wxGenericComboCtrl, which however may lack
382native look and feel (but otherwise sports identical API).
383
384\wxheading{Return value}
385
386Value returned is a combination of following flags:
387
388\twocolwidtha{8cm}%
389\begin{twocollist}\itemsep=0pt
390\twocolitem{{\tt wxComboCtrlFeatures::MovableButton}}{Button can
391be on either side of the control.}
392\twocolitem{{\tt wxComboCtrlFeatures::BitmapButton}}{Button may
393be replaced with bitmap.}
394\twocolitem{{\tt wxComboCtrlFeatures::ButtonSpacing}}{Button can
395have spacing.}
396\twocolitem{{\tt wxComboCtrlFeatures::TextIndent}}{SetTextIndent
397works.}
398\twocolitem{{\tt wxComboCtrlFeatures::PaintControl}}{Combo control
399itself can be custom painted.}
400\twocolitem{{\tt wxComboCtrlFeatures::PaintWritable}}{A variable-
401width area in front of writable combo control's textctrl can
402be custom painted.}
0a42e3b6 403\twocolitem{{\tt wxComboCtrlFeatures::Borderless}}{wxBORDER\_NONE window style works.}
0dfff674
WS
404\twocolitem{{\tt wxComboCtrlFeatures::All}}{All of the
405above.}
406\end{twocollist}
407
408
409\membersection{wxComboCtrl::GetInsertionPoint}\label{wxcomboctrlgetinsertionpoint}
410
411\constfunc{long}{GetInsertionPoint}{\void}
412
413Returns the insertion point for the combo control's text field.
414
415\textbf{Note:} Under wxMSW, this function always returns $0$ if the combo control
416doesn't have the focus.
417
418
974a12f8
RR
419\membersection{wxComboCtrl::IsPopupWindowState}\label{wxcomboctrlispopupwindowstate}
420
421\constfunc{bool}{IsPopupWindowState}{\param{int }{state}}
422
423Returns \true if the popup window is in the given state.
424Possible values are:
425\twocolwidtha{8cm}%
426\begin{twocollist}\itemsep=0pt
427\twocolitem{{\tt wxComboCtrl::Hidden}}{Popup window is hidden.}
428\twocolitem{{\tt wxComboCtrl::Animating}}{Popup window is being shown, but the
429popup animation has not yet finished.}
430\twocolitem{{\tt wxComboCtrl::Visible}}{Popup window is fully visible.}
431\end{twocollist}
432
433
434
0dfff674
WS
435\membersection{wxComboCtrl::GetLastPosition}\label{wxcomboctrlgetlastposition}
436
437\constfunc{long}{GetLastPosition}{\void}
438
439Returns the last position in the combo control text field.
440
441
442\membersection{wxComboCtrl::GetPopupControl}\label{wxcomboctrlgetpopupcontrol}
443
444\func{wxComboPopup*}{GetPopupControl}{\void}
445
446Returns current popup interface that has been set with SetPopupControl.
447
448
449\membersection{wxComboCtrl::GetPopupWindow}\label{wxcomboctrlgetpopupwindow}
450
451\constfunc{wxWindow*}{GetPopupWindow}{\void}
452
453Returns popup window containing the popup control.
454
455
456\membersection{wxComboCtrl::GetTextCtrl}\label{wxcomboctrlgettextctrl}
457
458\constfunc{wxTextCtrl*}{GetTextCtrl}{\void}
459
460Get the text control which is part of the combo control.
461
462
463\membersection{wxComboCtrl::GetTextIndent}\label{wxcomboctrlgettextindent}
464
465\constfunc{wxCoord}{GetTextIndent}{\void}
466
467Returns actual indentation in pixels.
468
469
df348ff8
RR
470\membersection{wxComboCtrl::GetTextRect}\label{wxcomboctrlgettextrect}
471
472\constfunc{const wxRect\&}{GetTextRect}{\void}
473
474Returns area covered by the text field (includes everything except
475borders and the dropdown button).
476
477
0dfff674
WS
478\membersection{wxComboCtrl::GetValue}\label{wxcomboctrlgetvalue}
479
480\constfunc{wxString}{GetValue}{\void}
481
482Returns text representation of the current value. For writable
483combo control it always returns the value in the text field.
484
485
486\membersection{wxComboCtrl::HidePopup}\label{wxcomboctrlhidepopup}
487
488\func{void}{HidePopup}{\void}
489
490Dismisses the popup window.
491
492
493\membersection{wxComboCtrl::IsPopupShown}\label{wxcomboctrlispopupshown}
494
495\constfunc{bool}{IsPopupShown}{\void}
496
497Returns \true if the popup is currently shown
498
499
500\membersection{wxComboCtrl::OnButtonClick}\label{wxcomboctrlonbuttonclick}
501
502\func{void}{OnButtonClick}{\void}
503
504Implement in a derived class to define what happens on
505dropdown button click.
506
507Default action is to show the popup.
508
df348ff8
RR
509\textbf{Note:} If you implement this to do something else than
510show the popup, you must then also implement
511\helpref{DoSetPopupControl}{wxcomboctrldosetpopupcontrol} to always
512return NULL.
513
0dfff674
WS
514
515\membersection{wxComboCtrl::Paste}\label{wxcomboctrlpaste}
516
517\func{void}{Paste}{\void}
518
519Pastes text from the clipboard to the text field.
520
521
522\membersection{wxComboCtrl::Remove}\label{wxcomboctrlremove}
523
524\func{void}{Remove}{\param{long }{from}, \param{long }{to}}
525
526Removes the text between the two positions in the combo control text field.
527
528\wxheading{Parameters}
529
530\docparam{from}{The first position.}
531
532\docparam{to}{The last position.}
533
534
535\membersection{wxComboCtrl::Replace}\label{wxcomboctrlreplace}
536
537\func{void}{Replace}{\param{long }{from}, \param{long }{to}, \param{const wxString\& }{value}}
538
539Replaces the text between two positions with the given text, in the combo control text field.
540
541\wxheading{Parameters}
542
543\docparam{from}{The first position.}
544
545\docparam{to}{The second position.}
546
547\docparam{text}{The text to insert.}
548
549
550\membersection{wxComboCtrl::SetButtonBitmaps}\label{wxcomboctrlsetbuttonbitmaps}
551
552\func{void}{SetButtonBitmaps}{\param{const wxBitmap\& }{bmpNormal}, \param{bool }{pushButtonBg = false}, \param{const wxBitmap\& }{bmpPressed = wxNullBitmap}, \param{const wxBitmap\& }{bmpHover = wxNullBitmap}, \param{const wxBitmap\& }{bmpDisabled = wxNullBitmap}}
553
554Sets custom dropdown button graphics.
555
556\wxheading{Parameters}
557
558\docparam{bmpNormal}{Default button image.}
559\docparam{pushButtonBg}{If \true, blank push button background is painted
560below the image.}
561\docparam{bmpPressed}{Depressed button image.}
562\docparam{bmpHover}{Button image when mouse hovers above it. This
563should be ignored on platforms and themes that do not generally draw
564different kind of button on mouse hover.}
565\docparam{bmpDisabled}{Disabled button image.}
566
567
568\membersection{wxComboCtrl::SetButtonPosition}\label{wxcomboctrlsetbuttonposition}
569
7dc234d6 570\func{void}{SetButtonPosition}{\param{int }{width = -1}, \param{int }{height = -1}, \param{int }{side = wxRIGHT}, \param{int }{spacingX = 0}}
0dfff674
WS
571
572Sets size and position of dropdown button.
573
574\wxheading{Parameters}
575
7dc234d6
WS
576\docparam{width}{Button width. Value <= $0$ specifies default.}
577\docparam{height}{Button height. Value <= $0$ specifies default.}
0dfff674
WS
578\docparam{side}{Indicates which side the button will be placed.
579Value can be {\tt wxLEFT} or {\tt wxRIGHT}.}
580\docparam{spacingX}{Horizontal spacing around the button. Default is $0$.}
581
582
583\membersection{wxComboCtrl::SetCustomPaintWidth}\label{wxcomboctrlsetcustompaintwidth}
584
585\func{void}{SetCustomPaintWidth}{\param{int }{width}}
586
587Set width, in pixels, of custom painted area in control without {\tt wxCB\_READONLY}
588style. In read-only \helpref{wxOwnerDrawnComboBox}{wxownerdrawncombobox}, this is used
589to indicate area that is not covered by the focus rectangle.
590
591
592\membersection{wxComboCtrl::SetInsertionPoint}\label{wxcomboctrlsetinsertionpoint}
593
594\func{void}{SetInsertionPoint}{\param{long }{pos}}
595
596Sets the insertion point in the text field.
597
598\wxheading{Parameters}
599
600\docparam{pos}{The new insertion point.}
601
602
603\membersection{wxComboCtrl::SetInsertionPointEnd}\label{wxcomboctrlsetinsertionpointend}
604
605\func{void}{SetInsertionPointEnd}{\void}
606
607Sets the insertion point at the end of the combo control text field.
608
609
610\membersection{wxComboCtrl::SetPopupAnchor}\label{wxcomboctrlsetpopupanchor}
611
612\func{void}{SetPopupAnchor}{\param{int }{anchorSide}}
613
614Set side of the control to which the popup will align itself. Valid values are
615{\tt wxLEFT}, {\tt wxRIGHT} and $0$. The default value $0$ means that the most appropriate
616side is used (which, currently, is always {\tt wxLEFT}).
617
618
619\membersection{wxComboCtrl::SetPopupControl}\label{wxcomboctrlsetpopupcontrol}
620
621\func{void}{SetPopupControl}{\param{wxComboPopup* }{popup}}
622
623Set popup interface class derived from wxComboPopup.
624This method should be called as soon as possible after the control
625has been created, unless \helpref{OnButtonClick}{wxcomboctrlonbuttonclick}
626has been overridden.
627
628
629\membersection{wxComboCtrl::SetPopupExtents}\label{wxcomboctrlsetpopupextents}
630
631\func{void}{SetPopupExtents}{\param{int }{extLeft}, \param{int }{extRight}}
632
633Extends popup size horizontally, relative to the edges of the combo control.
634
635\wxheading{Parameters}
636
637\docparam{extLeft}{How many pixel to extend beyond the left edge of the
638control. Default is $0$.}
639\docparam{extRight}{How many pixel to extend beyond the right edge of the
640control. Default is $0$.}
641
642\wxheading{Remarks}
643
644Popup minimum width may override arguments.
645
646It is up to the popup to fully take this into account.
647
648
649\membersection{wxComboCtrl::SetPopupMaxHeight}\label{wxcomboctrlsetpopupmaxheight}
650
651\func{void}{SetPopupMaxHeight}{\param{int }{height}}
652
653Sets preferred maximum height of the popup.
654
655\wxheading{Remarks}
656
657Value -1 indicates the default.
658
659Also, popup implementation may choose to ignore this.
660
661
662\membersection{wxComboCtrl::SetPopupMinWidth}\label{wxcomboctrlsetpopupminwidth}
663
664\func{void}{SetPopupMinWidth}{\param{int }{width}}
665
666Sets minimum width of the popup. If wider than combo control, it will extend to the left.
667
668\wxheading{Remarks}
669
670Value -1 indicates the default.
671
672Also, popup implementation may choose to ignore this.
673
674
675\membersection{wxComboCtrl::SetSelection}\label{wxcomboctrlsetselection}
676
677\func{void}{SetSelection}{\param{long }{from}, \param{long }{to}}
678
679Selects the text between the two positions, in the combo control text field.
680
681\wxheading{Parameters}
682
683\docparam{from}{The first position.}
684
685\docparam{to}{The second position.}
686
687
688\membersection{wxComboCtrl::SetText}\label{wxcomboctrlsettext}
689
690\func{void}{SetText}{\param{const wxString\& }{value}}
691
692Sets the text for the text field without affecting the
693popup. Thus, unlike \helpref{SetValue}{wxcomboctrlsetvalue}, it works
694equally well with combo control using {\tt wxCB\_READONLY} style.
695
696
697\membersection{wxComboCtrl::SetTextIndent}\label{wxcomboctrlsettextindent}
698
699\func{void}{SetTextIndent}{\param{int }{indent}}
700
701This will set the space in pixels between left edge of the control and the
702text, regardless whether control is read-only or not. Value -1 can be
703given to indicate platform default.
704
705
706\membersection{wxComboCtrl::SetValue}\label{wxcomboctrlsetvalue}
707
708\func{void}{SetValue}{\param{const wxString\& }{value}}
709
710Sets the text for the combo control text field.
711
712{\bf NB:} For a combo control with {\tt wxCB\_READONLY} style the
713string must be accepted by the popup (for instance, exist in the dropdown
714list), otherwise the call to SetValue() is ignored
715
716
df348ff8
RR
717\membersection{wxComboCtrl::SetValueWithEvent}\label{wxcomboctrlsetvaluewithevent}
718
719\func{void}{SetValueWithEvent}{\param{const wxString\& }{value}, \param{bool }{withEvent = true}}
720
721Same as SetValue, but also sends wxCommandEvent of type wxEVT\_COMMAND\_TEXT\_UPDATED
722if {\tt withEvent} is \true.
723
724
0dfff674
WS
725\membersection{wxComboCtrl::ShowPopup}\label{wxcomboctrlshowpopup}
726
727\func{void}{ShowPopup}{\void}
728
729Show the popup.
730
731
732\membersection{wxComboCtrl::Undo}\label{wxcomboctrlundo}
733
734\func{void}{Undo}{\void}
735
736Undoes the last edit in the text field. Windows only.
b67a86d5 737
06077aaf
VZ
738
739\membersection{wxComboCtrl::UseAltPopupWindow}\label{wxcomboctrlusealtpopupwindow}
740
741\func{void}{UseAltPopupWindow}{\param{bool }{enable = true}}
742
743Enable or disable usage of an alternative popup window, which guarantees
744ability to focus the popup control, and allows common native controls to
745function normally. This alternative popup window is usually a wxDialog,
746and as such, when it is shown, its parent top-level window will appear
747as if the focus has been lost from it.
748
749