1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/combo.h
3 // Purpose: Generic wxComboCtrl
4 // Author: Jaakko Salli
6 // Created: Apr-30-2006
8 // Copyright: (c) Jaakko Salli
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GENERIC_COMBOCONTROL_H_
13 #define _WX_GENERIC_COMBOCONTROL_H_
17 // Only define generic if native doesn't have all the features
18 #if !defined(wxCOMBOCONTROL_FULLY_FEATURED)
20 // ----------------------------------------------------------------------------
21 // Generic wxComboCtrl
22 // ----------------------------------------------------------------------------
24 #if defined(__WXUNIVERSAL__)
26 // all actions of single line text controls are supported
28 // popup/dismiss the choice window
29 #define wxACTION_COMBOBOX_POPUP _T("popup")
30 #define wxACTION_COMBOBOX_DISMISS _T("dismiss")
34 extern WXDLLIMPEXP_DATA_CORE(const wxChar
) wxComboBoxNameStr
[];
36 class WXDLLEXPORT wxGenericComboControl
: public wxComboCtrlBase
40 wxGenericComboControl() : wxComboCtrlBase() { Init(); }
42 wxGenericComboControl(wxWindow
*parent
,
43 wxWindowID id
= wxID_ANY
,
44 const wxString
& value
= wxEmptyString
,
45 const wxPoint
& pos
= wxDefaultPosition
,
46 const wxSize
& size
= wxDefaultSize
,
48 const wxValidator
& validator
= wxDefaultValidator
,
49 const wxString
& name
= wxComboBoxNameStr
)
54 (void)Create(parent
, id
, value
, pos
, size
, style
, validator
, name
);
57 bool Create(wxWindow
*parent
,
58 wxWindowID id
= wxID_ANY
,
59 const wxString
& value
= wxEmptyString
,
60 const wxPoint
& pos
= wxDefaultPosition
,
61 const wxSize
& size
= wxDefaultSize
,
63 const wxValidator
& validator
= wxDefaultValidator
,
64 const wxString
& name
= wxComboBoxNameStr
);
66 virtual ~wxGenericComboControl();
68 virtual bool IsKeyPopupToggle(const wxKeyEvent
& event
) const;
70 static int GetFeatures() { return wxComboCtrlFeatures::All
; }
72 #if defined(__WXUNIVERSAL__)
73 // we have our own input handler and our own actions
74 virtual bool PerformAction(const wxControlAction
& action
,
76 const wxString
& strArg
= wxEmptyString
);
82 virtual void OnResize();
85 void OnPaintEvent( wxPaintEvent
& event
);
86 void OnMouseEvent( wxMouseEvent
& event
);
93 DECLARE_DYNAMIC_CLASS(wxGenericComboControl
)
97 #ifndef _WX_COMBOCONTROL_H_
99 // If native wxComboCtrl was not defined, then prepare a simple
100 // front-end so that wxRTTI works as expected.
102 class WXDLLEXPORT wxComboCtrl
: public wxGenericComboControl
105 wxComboCtrl() : wxGenericComboControl() {}
107 wxComboCtrl(wxWindow
*parent
,
108 wxWindowID id
= wxID_ANY
,
109 const wxString
& value
= wxEmptyString
,
110 const wxPoint
& pos
= wxDefaultPosition
,
111 const wxSize
& size
= wxDefaultSize
,
113 const wxValidator
& validator
= wxDefaultValidator
,
114 const wxString
& name
= wxComboBoxNameStr
)
115 : wxGenericComboControl()
117 (void)Create(parent
, id
, value
, pos
, size
, style
, validator
, name
);
120 virtual ~wxComboCtrl() {}
125 DECLARE_DYNAMIC_CLASS(wxComboCtrl
)
128 #endif // _WX_COMBOCONTROL_H_
132 #define wxGenericComboControl wxComboCtrl
134 #endif // !defined(wxCOMBOCONTROL_FULLY_FEATURED)
136 #endif // wxUSE_COMBOCTRL
138 // _WX_GENERIC_COMBOCONTROL_H_