1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/univ/combobox.cpp
3 // Purpose: wxComboControl and wxComboBox implementation
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #include "wx/wxprec.h"
31 #include "wx/button.h"
32 #include "wx/combobox.h"
33 #include "wx/listbox.h"
34 #include "wx/textctrl.h"
35 #include "wx/bmpbuttn.h"
37 #include "wx/validate.h"
40 #include "wx/tooltip.h"
41 #include "wx/popupwin.h"
43 #include "wx/univ/renderer.h"
44 #include "wx/univ/inphand.h"
45 #include "wx/univ/theme.h"
48 The keyboard event flow:
50 1. they always come to the text ctrl
51 2. it forwards the ones it doesn't process to the wxComboControl
52 3. which passes them to the popup window if it is popped up
56 // ----------------------------------------------------------------------------
58 // the margin between the text control and the combo button
59 static const wxCoord g_comboMargin
= 2;
61 // ----------------------------------------------------------------------------
62 // wxComboButton is just a normal button except that it sends commands to the
63 // combobox and not its parent
64 // ----------------------------------------------------------------------------
66 class wxComboButton
: public wxBitmapButton
69 wxComboButton(wxComboControl
*combo
)
70 : wxBitmapButton(combo
->GetParent(), wxID_ANY
, wxNullBitmap
,
71 wxDefaultPosition
, wxDefaultSize
,
72 wxBORDER_NONE
| wxBU_EXACTFIT
)
76 wxBitmap bmpNormal
, bmpFocus
, bmpPressed
, bmpDisabled
;
78 GetRenderer()->GetComboBitmaps(&bmpNormal
,
83 SetBitmapLabel(bmpNormal
);
84 SetBitmapFocus(bmpFocus
.Ok() ? bmpFocus
: bmpNormal
);
85 SetBitmapSelected(bmpPressed
.Ok() ? bmpPressed
: bmpNormal
);
86 SetBitmapDisabled(bmpDisabled
.Ok() ? bmpDisabled
: bmpNormal
);
88 SetBestSize(wxDefaultSize
);
92 void OnButton(wxCommandEvent
& WXUNUSED(event
)) { m_combo
->ShowPopup(); }
94 virtual wxSize
DoGetBestClientSize() const
96 const wxBitmap
& bmp
= GetBitmapLabel();
98 return wxSize(bmp
.GetWidth(), bmp
.GetHeight());
103 wxComboControl
*m_combo
;
105 DECLARE_EVENT_TABLE()
108 // ----------------------------------------------------------------------------
109 // wxComboListBox is a listbox modified to be used as a popup window in a
111 // ----------------------------------------------------------------------------
113 class wxComboListBox
: public wxListBox
, public wxComboPopup
117 wxComboListBox(wxComboControl
*combo
, int style
= 0);
118 virtual ~wxComboListBox();
120 // implement wxComboPopup methods
121 virtual bool SetSelection(const wxString
& s
);
122 virtual wxControl
*GetControl() { return this; }
123 virtual void OnShow();
124 virtual wxCoord
GetBestWidth() const;
126 // fix virtual function hiding
127 virtual void SetSelection(int n
) { DoSetSelection(n
, true); }
128 void SetSelection(int n
, bool select
) { DoSetSelection(n
, select
); }
130 // used to process wxUniv actions
131 bool PerformAction(const wxControlAction
& action
,
133 const wxString
& strArg
);
136 // we shouldn't return height too big from here
137 virtual wxSize
DoGetBestClientSize() const;
139 // filter mouse move events happening outside the list box
140 void OnMouseMove(wxMouseEvent
& event
);
142 // set m_clicked value from here
143 void OnLeftUp(wxMouseEvent
& event
);
145 // called whenever the user selects or activates a listbox item
146 void OnSelect(wxCommandEvent
& event
);
149 // has the mouse been released on this control?
152 DECLARE_EVENT_TABLE()
155 // ----------------------------------------------------------------------------
156 // wxComboTextCtrl is a simple text ctrl which forwards
157 // wxEVT_COMMAND_TEXT_UPDATED events and all key events to the combobox
158 // ----------------------------------------------------------------------------
160 class wxComboTextCtrl
: public wxTextCtrl
163 wxComboTextCtrl(wxComboControl
*combo
,
164 const wxString
& value
,
166 const wxValidator
& validator
);
169 void OnKey(wxKeyEvent
& event
);
170 void OnText(wxCommandEvent
& event
);
173 wxComboControl
*m_combo
;
175 DECLARE_EVENT_TABLE()
178 // ----------------------------------------------------------------------------
179 // event tables and such
180 // ----------------------------------------------------------------------------
182 BEGIN_EVENT_TABLE(wxComboButton
, wxButton
)
183 EVT_BUTTON(wxID_ANY
, wxComboButton::OnButton
)
186 BEGIN_EVENT_TABLE(wxComboListBox
, wxListBox
)
187 EVT_LISTBOX(wxID_ANY
, wxComboListBox::OnSelect
)
188 EVT_LISTBOX_DCLICK(wxID_ANY
, wxComboListBox::OnSelect
)
189 EVT_MOTION(wxComboListBox::OnMouseMove
)
190 EVT_LEFT_UP(wxComboListBox::OnLeftUp
)
193 BEGIN_EVENT_TABLE(wxComboControl
, wxControl
)
194 EVT_KEY_DOWN(wxComboControl::OnKey
)
195 EVT_KEY_UP(wxComboControl::OnKey
)
198 BEGIN_EVENT_TABLE(wxComboTextCtrl
, wxTextCtrl
)
199 EVT_KEY_DOWN(wxComboTextCtrl::OnKey
)
200 EVT_KEY_UP(wxComboTextCtrl::OnKey
)
201 EVT_TEXT(wxID_ANY
, wxComboTextCtrl::OnText
)
204 IMPLEMENT_DYNAMIC_CLASS(wxComboBox
, wxControl
)
206 // ============================================================================
208 // ============================================================================
210 // ----------------------------------------------------------------------------
211 // wxComboControl creation
212 // ----------------------------------------------------------------------------
214 void wxComboControl::Init()
216 m_popup
= (wxComboPopup
*)NULL
;
217 m_winPopup
= (wxPopupComboWindow
*)NULL
;
218 m_isPopupShown
= false;
223 bool wxComboControl::Create(wxWindow
*parent
,
225 const wxString
& value
,
229 const wxValidator
& validator
,
230 const wxString
& name
)
232 // first create our own window, i.e. the one which will contain all
234 style
&= ~wxBORDER_NONE
;
235 style
|= wxBORDER_SUNKEN
;
236 if ( !wxControl::Create(parent
, id
, pos
, size
, style
, validator
, name
) )
239 // create the text control and the button as our siblings (*not* children),
240 // don't care about size/position here - they will be set in DoMoveWindow()
241 m_btn
= new wxComboButton(this);
242 m_text
= new wxComboTextCtrl(this,
244 style
& wxCB_READONLY
? wxTE_READONLY
: 0,
247 // for compatibility with the other ports, the height specified is the
248 // combined height of the combobox itself and the popup
249 if ( size
.y
== wxDefaultCoord
)
251 // ok, use default height for popup too
252 m_heightPopup
= wxDefaultCoord
;
256 m_heightPopup
= size
.y
- DoGetBestSize().y
;
262 // create the popup window immediately here to allow creating the controls
263 // with parent == GetPopupWindow() from the derived class ctor
264 m_winPopup
= new wxPopupComboWindow(this);
266 // have to disable this window to avoid interfering it with message
267 // processing to the text and the button... but pretend it is enabled to
268 // make IsEnabled() return true
269 wxControl::Enable(false); // don't use non virtual Disable() here!
272 CreateInputHandler(wxINP_HANDLER_COMBOBOX
);
277 wxComboControl::~wxComboControl()
279 // as the button and the text control are the parent's children and not
280 // ours, we have to delete them manually - they are not deleted
281 // automatically by wxWidgets when we're deleted
288 // ----------------------------------------------------------------------------
290 // ----------------------------------------------------------------------------
292 void wxComboControl::DoSetSize(int x
, int y
,
293 int width
, int WXUNUSED(height
),
296 // combo height is always fixed
297 wxControl::DoSetSize(x
, y
, width
, DoGetBestSize().y
, sizeFlags
);
300 wxSize
wxComboControl::DoGetBestClientSize() const
302 wxSize sizeBtn
= m_btn
->GetBestSize(),
303 sizeText
= m_text
->GetBestSize();
304 wxCoord widthPopup
= 0;
308 widthPopup
= m_popup
->GetBestWidth();
311 return wxSize(wxMax(sizeText
.x
+ g_comboMargin
+ sizeBtn
.x
, widthPopup
),
312 wxMax(sizeBtn
.y
, sizeText
.y
));
315 void wxComboControl::DoMoveWindow(int x
, int y
, int width
, int height
)
317 wxControl::DoMoveWindow(x
, y
, width
, height
);
319 // position the subcontrols inside the client area
320 wxRect rectBorders
= GetRenderer()->GetBorderDimensions(GetBorder());
323 width
-= rectBorders
.x
+ rectBorders
.width
;
324 height
-= rectBorders
.y
+ rectBorders
.height
;
326 wxSize sizeBtn
= m_btn
->GetBestSize();
328 wxCoord wText
= width
- sizeBtn
.x
;
329 wxPoint p
= GetParent() ? GetParent()->GetClientAreaOrigin() : wxPoint(0,0);
330 m_text
->SetSize(x
- p
.x
, y
- p
.y
, wText
, height
);
331 m_btn
->SetSize(x
- p
.x
+ wText
, y
- p
.y
, sizeBtn
.x
, height
);
334 // ----------------------------------------------------------------------------
336 // ----------------------------------------------------------------------------
338 bool wxComboControl::Enable(bool enable
)
340 if ( !wxControl::Enable(enable
) )
343 m_btn
->Enable(enable
);
344 m_text
->Enable(enable
);
349 bool wxComboControl::Show(bool show
)
351 if ( !wxControl::Show(show
) )
364 void wxComboControl::DoSetToolTip(wxToolTip
*tooltip
)
366 wxControl::DoSetToolTip(tooltip
);
368 // Set tool tip for button and text box
373 const wxString
&tip
= tooltip
->GetTip();
374 m_text
->SetToolTip(tip
);
375 m_btn
->SetToolTip(tip
);
379 m_text
->SetToolTip(NULL
);
380 m_btn
->SetToolTip(NULL
);
384 #endif // wxUSE_TOOLTIPS
386 // ----------------------------------------------------------------------------
387 // popup window handling
388 // ----------------------------------------------------------------------------
390 void wxComboControl::SetPopupControl(wxComboPopup
*popup
)
395 void wxComboControl::ShowPopup()
397 wxCHECK_RET( m_popup
, _T("no popup to show in wxComboControl") );
398 wxCHECK_RET( !IsPopupShown(), _T("popup window already shown") );
400 wxControl
*control
= m_popup
->GetControl();
402 // size and position the popup window correctly
403 m_winPopup
->SetSize(GetSize().x
,
404 m_heightPopup
== wxDefaultCoord
? control
->GetBestSize().y
406 wxSize sizePopup
= m_winPopup
->GetClientSize();
407 control
->SetSize(0, 0, sizePopup
.x
, sizePopup
.y
);
409 // some controls don't accept the size we give then: e.g. a listbox may
410 // require more space to show its last row
411 wxSize sizeReal
= control
->GetSize();
412 if ( sizeReal
!= sizePopup
)
414 m_winPopup
->SetClientSize(sizeReal
);
417 m_winPopup
->PositionNearCombo();
421 m_winPopup
->Popup(m_text
);
423 m_popup
->SetSelection(m_text
->GetValue());
425 m_isPopupShown
= true;
428 void wxComboControl::HidePopup()
430 wxCHECK_RET( m_popup
, _T("no popup to hide in wxComboControl") );
431 wxCHECK_RET( IsPopupShown(), _T("popup window not shown") );
433 m_winPopup
->Dismiss();
435 m_isPopupShown
= false;
438 void wxComboControl::OnSelect(const wxString
& value
)
440 m_text
->SetValue(value
);
446 void wxComboControl::OnDismiss()
452 // ----------------------------------------------------------------------------
454 // ----------------------------------------------------------------------------
456 wxComboTextCtrl::wxComboTextCtrl(wxComboControl
*combo
,
457 const wxString
& value
,
459 const wxValidator
& validator
)
460 : wxTextCtrl(combo
->GetParent(), wxID_ANY
, value
,
461 wxDefaultPosition
, wxDefaultSize
,
462 wxBORDER_NONE
| style
,
468 void wxComboTextCtrl::OnText(wxCommandEvent
& event
)
470 if ( m_combo
->IsPopupShown() )
472 m_combo
->GetPopupControl()->SetSelection(GetValue());
475 // we need to make a copy of the event to have the correct originating
477 wxCommandEvent event2
= event
;
478 event2
.SetEventObject(m_combo
);
479 event2
.SetId(m_combo
->GetId());
481 // there is a small incompatibility with wxMSW here: the combobox gets the
482 // event before the text control in our case which corresponds to SMW
483 // CBN_EDITUPDATE notification and not CBN_EDITCHANGE one wxMSW currently
486 // if this is really a problem, we can play games with the event handlers
487 // to circumvent this
488 (void)m_combo
->ProcessEvent(event2
);
493 // pass the keys we don't process to the combo first
494 void wxComboTextCtrl::OnKey(wxKeyEvent
& event
)
496 switch ( event
.GetKeyCode() )
499 // the popup control gets it first but only if it is shown
500 if ( !m_combo
->IsPopupShown() )
509 (void)m_combo
->ProcessEvent(event
);
516 // ----------------------------------------------------------------------------
518 // ----------------------------------------------------------------------------
520 wxComboListBox::wxComboListBox(wxComboControl
*combo
, int style
)
521 : wxListBox(combo
->GetPopupWindow(), wxID_ANY
,
522 wxDefaultPosition
, wxDefaultSize
,
524 wxBORDER_SIMPLE
| wxLB_INT_HEIGHT
| style
),
527 // we don't react to the mouse events outside the window at all
531 wxComboListBox::~wxComboListBox()
535 bool wxComboListBox::SetSelection(const wxString
& value
)
537 // FindItem() would just find the current item for an empty string (it
538 // always matches), but we want to show the first one in such case
541 if ( GetCount() > 0 )
543 wxListBox::SetSelection(0);
545 //else: empty listbox - nothing to do
547 else if ( !FindItem(value
) )
556 void wxComboListBox::OnSelect(wxCommandEvent
& event
)
560 // first update the combo and close the listbox
561 m_combo
->OnSelect(event
.GetString());
563 // next let the user code have the event
565 // all fields are already filled by the listbox, just change the event
566 // type and send it to the combo
567 wxCommandEvent event2
= event
;
568 event2
.SetEventType(wxEVT_COMMAND_COMBOBOX_SELECTED
);
569 event2
.SetEventObject(m_combo
);
570 event2
.SetId(m_combo
->GetId());
571 m_combo
->ProcessEvent(event2
);
573 //else: ignore the events resulting from just moving the mouse initially
576 void wxComboListBox::OnShow()
578 // nobody clicked us yet
582 bool wxComboListBox::PerformAction(const wxControlAction
& action
,
584 const wxString
& strArg
)
587 if ( action
== wxACTION_LISTBOX_FIND
)
589 // we don't let the listbox handle this as instead of just using the
590 // single key presses, as usual, we use the text ctrl value as prefix
591 // and this is done by wxComboControl itself
595 return wxListBox::PerformAction(action
, numArg
, strArg
);
598 void wxComboListBox::OnLeftUp(wxMouseEvent
& event
)
600 // we should dismiss the combo now
606 void wxComboListBox::OnMouseMove(wxMouseEvent
& event
)
608 // while a wxComboListBox is shown, it always has capture, so if it doesn't
609 // we're about to go away anyhow (normally this shouldn't happen at all,
610 // but I don't put assert here as it just might do on other platforms and
611 // it doesn't break anything anyhow)
612 if ( this == wxWindow::GetCapture() )
614 if ( HitTest(event
.GetPosition()) == wxHT_WINDOW_INSIDE
)
618 //else: popup shouldn't react to the mouse motions outside it, it only
619 // captures the mouse to be able to detect when it must be
620 // dismissed, so don't call Skip()
624 wxCoord
wxComboListBox::GetBestWidth() const
626 wxSize size
= wxListBox::GetBestSize();
630 wxSize
wxComboListBox::DoGetBestClientSize() const
632 // don't return size too big or we risk to not fit on the screen
633 wxSize size
= wxListBox::DoGetBestClientSize();
634 wxCoord hChar
= GetCharHeight();
636 int nLines
= size
.y
/ hChar
;
638 // 10 is the same limit as used by wxMSW
647 // ----------------------------------------------------------------------------
649 // ----------------------------------------------------------------------------
651 void wxComboBox::Init()
653 m_lbox
= (wxListBox
*)NULL
;
656 wxComboBox::wxComboBox(wxWindow
*parent
,
658 const wxString
& value
,
661 const wxArrayString
& choices
,
663 const wxValidator
& validator
,
664 const wxString
& name
)
668 Create(parent
, id
, value
, pos
, size
, choices
, style
, validator
, name
);
671 bool wxComboBox::Create(wxWindow
*parent
,
673 const wxString
& value
,
676 const wxArrayString
& choices
,
678 const wxValidator
& validator
,
679 const wxString
& name
)
681 wxCArrayString
chs(choices
);
683 return Create(parent
, id
, value
, pos
, size
, chs
.GetCount(),
684 chs
.GetStrings(), style
, validator
, name
);
687 bool wxComboBox::Create(wxWindow
*parent
,
689 const wxString
& value
,
693 const wxString choices
[],
695 const wxValidator
& validator
,
696 const wxString
& name
)
698 if ( !wxComboControl::Create(parent
, id
, value
, pos
, size
, style
,
704 wxComboListBox
*combolbox
=
705 new wxComboListBox(this, style
& wxCB_SORT
? wxLB_SORT
: 0);
707 m_lbox
->Set(n
, choices
);
709 SetPopupControl(combolbox
);
714 wxComboBox::~wxComboBox()
718 // ----------------------------------------------------------------------------
719 // wxComboBox methods forwarded to wxTextCtrl
720 // ----------------------------------------------------------------------------
722 wxString
wxComboBox::GetValue() const
724 return GetText()->GetValue();
727 void wxComboBox::SetValue(const wxString
& value
)
729 GetText()->SetValue(value
);
732 void wxComboBox::Copy()
737 void wxComboBox::Cut()
742 void wxComboBox::Paste()
747 void wxComboBox::SetInsertionPoint(long pos
)
749 GetText()->SetInsertionPoint(pos
);
752 void wxComboBox::SetInsertionPointEnd()
754 GetText()->SetInsertionPointEnd();
757 long wxComboBox::GetInsertionPoint() const
759 return GetText()->GetInsertionPoint();
762 wxTextPos
wxComboBox::GetLastPosition() const
764 return GetText()->GetLastPosition();
767 void wxComboBox::Replace(long from
, long to
, const wxString
& value
)
769 GetText()->Replace(from
, to
, value
);
772 void wxComboBox::Remove(long from
, long to
)
774 GetText()->Remove(from
, to
);
777 void wxComboBox::SetSelection(long from
, long to
)
779 GetText()->SetSelection(from
, to
);
782 void wxComboBox::SetEditable(bool editable
)
784 GetText()->SetEditable(editable
);
787 // ----------------------------------------------------------------------------
788 // wxComboBox methods forwarded to wxListBox
789 // ----------------------------------------------------------------------------
791 void wxComboBox::Clear()
794 GetText()->SetValue(wxEmptyString
);
797 void wxComboBox::Delete(unsigned int n
)
799 wxCHECK_RET( IsValid(n
), _T("invalid index in wxComboBox::Delete") );
801 if (GetSelection() == (int)n
)
802 GetText()->SetValue(wxEmptyString
);
804 GetLBox()->Delete(n
);
807 unsigned int wxComboBox::GetCount() const
809 return GetLBox()->GetCount();
812 wxString
wxComboBox::GetString(unsigned int n
) const
814 wxCHECK_MSG( IsValid(n
), wxEmptyString
, _T("invalid index in wxComboBox::GetString") );
816 return GetLBox()->GetString(n
);
819 void wxComboBox::SetString(unsigned int n
, const wxString
& s
)
821 wxCHECK_RET( IsValid(n
), _T("invalid index in wxComboBox::SetString") );
823 GetLBox()->SetString(n
, s
);
826 int wxComboBox::FindString(const wxString
& s
, bool bCase
) const
828 return GetLBox()->FindString(s
, bCase
);
831 void wxComboBox::SetSelection(int n
)
833 wxCHECK_RET( IsValid(n
), _T("invalid index in wxComboBox::Select") );
835 GetLBox()->SetSelection(n
);
836 GetText()->SetValue(GetLBox()->GetString(n
));
839 int wxComboBox::GetSelection() const
841 #if 1 // FIXME:: What is the correct behavior?
842 // if the current value isn't one of the listbox strings, return -1
843 return GetLBox()->GetSelection();
845 // Why oh why is this done this way?
846 // It is not because the value displayed in the text can be found
847 // in the list that it is the item that is selected!
848 return FindString(GetText()->GetValue());
852 int wxComboBox::DoAppend(const wxString
& item
)
854 return GetLBox()->Append(item
);
857 int wxComboBox::DoInsert(const wxString
& item
, unsigned int pos
)
859 wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT
), -1, wxT("can't insert into sorted list"));
860 wxCHECK_MSG(IsValidInsert(pos
), -1, wxT("invalid index"));
862 if (pos
== GetCount())
863 return DoAppend(item
);
865 GetLBox()->Insert(item
, pos
);
869 void wxComboBox::DoSetItemClientData(unsigned int n
, void* clientData
)
871 GetLBox()->SetClientData(n
, clientData
);
874 void *wxComboBox::DoGetItemClientData(unsigned int n
) const
876 return GetLBox()->GetClientData(n
);
879 void wxComboBox::DoSetItemClientObject(unsigned int n
, wxClientData
* clientData
)
881 GetLBox()->SetClientObject(n
, clientData
);
884 wxClientData
* wxComboBox::DoGetItemClientObject(unsigned int n
) const
886 return GetLBox()->GetClientObject(n
);
889 bool wxComboBox::IsEditable() const
891 return GetText() != NULL
&& (!HasFlag(wxCB_READONLY
) || GetText()->IsEditable());
894 void wxComboBox::Undo()
900 void wxComboBox::Redo()
906 void wxComboBox::SelectAll()
908 GetText()->SelectAll();
911 bool wxComboBox::CanCopy() const
913 if (GetText() != NULL
)
914 return GetText()->CanCopy();
919 bool wxComboBox::CanCut() const
921 if (GetText() != NULL
)
922 return GetText()->CanCut();
927 bool wxComboBox::CanPaste() const
930 return GetText()->CanPaste();
935 bool wxComboBox::CanUndo() const
938 return GetText()->CanUndo();
943 bool wxComboBox::CanRedo() const
946 return GetText()->CanRedo();
952 // ----------------------------------------------------------------------------
954 // ----------------------------------------------------------------------------
956 void wxComboControl::OnKey(wxKeyEvent
& event
)
958 if ( m_isPopupShown
)
960 // pass it to the popped up control
961 (void)m_popup
->GetControl()->ProcessEvent(event
);
969 bool wxComboControl::PerformAction(const wxControlAction
& action
,
971 const wxString
& strArg
)
973 bool processed
= false;
974 if ( action
== wxACTION_COMBOBOX_POPUP
)
976 if ( !m_isPopupShown
)
983 else if ( action
== wxACTION_COMBOBOX_DISMISS
)
985 if ( m_isPopupShown
)
996 return wxControl::PerformAction(action
, numArg
, strArg
);
1002 // ----------------------------------------------------------------------------
1003 // wxStdComboBoxInputHandler
1004 // ----------------------------------------------------------------------------
1006 wxStdComboBoxInputHandler::wxStdComboBoxInputHandler(wxInputHandler
*inphand
)
1007 : wxStdInputHandler(inphand
)
1011 bool wxStdComboBoxInputHandler::HandleKey(wxInputConsumer
*consumer
,
1012 const wxKeyEvent
& event
,
1017 wxControlAction action
;
1018 switch ( event
.GetKeyCode() )
1021 action
= wxACTION_COMBOBOX_POPUP
;
1025 action
= wxACTION_COMBOBOX_DISMISS
;
1029 if ( !action
.IsEmpty() )
1031 consumer
->PerformAction(action
);
1037 return wxStdInputHandler::HandleKey(consumer
, event
, pressed
);
1040 #endif // wxUSE_COMBOBOX