1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/combo.h
3 // Purpose: Generic wxComboControl
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_
15 #if wxUSE_COMBOCONTROL
17 // Only define generic if native doesn't have all the features
18 #if !defined(wxCOMBOCONTROL_FULLY_FEATURED)
20 // ----------------------------------------------------------------------------
21 // Generic wxComboControl
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")
35 class WXDLLEXPORT wxGenericComboControl
: public wxComboControlBase
39 wxGenericComboControl() : wxComboControlBase() { Init(); }
41 wxGenericComboControl(wxWindow
*parent
,
42 wxWindowID id
= wxID_ANY
,
43 const wxString
& value
= wxEmptyString
,
44 const wxPoint
& pos
= wxDefaultPosition
,
45 const wxSize
& size
= wxDefaultSize
,
47 const wxValidator
& validator
= wxDefaultValidator
,
48 const wxString
& name
= wxComboBoxNameStr
)
49 : wxComboControlBase()
53 (void)Create(parent
, id
, value
, pos
, size
, style
, validator
, name
);
56 bool Create(wxWindow
*parent
,
57 wxWindowID id
= wxID_ANY
,
58 const wxString
& value
= wxEmptyString
,
59 const wxPoint
& pos
= wxDefaultPosition
,
60 const wxSize
& size
= wxDefaultSize
,
62 const wxValidator
& validator
= wxDefaultValidator
,
63 const wxString
& name
= wxComboBoxNameStr
);
65 virtual ~wxGenericComboControl();
67 static int GetFeatures() { return wxComboControlFeatures::All
; }
69 #if defined(__WXUNIVERSAL__)
70 // we have our own input handler and our own actions
71 virtual bool PerformAction(const wxControlAction
& action
,
73 const wxString
& strArg
= wxEmptyString
);
79 virtual void OnResize();
82 void OnPaintEvent( wxPaintEvent
& event
);
83 void OnMouseEvent( wxMouseEvent
& event
);
90 DECLARE_DYNAMIC_CLASS(wxGenericComboControl
)
94 #ifndef _WX_COMBOCONTROL_H_
96 // If native wxComboControl was not defined, then prepare a simple
97 // front-end so that wxRTTI works as expected.
99 class WXDLLEXPORT wxComboControl
: public wxGenericComboControl
102 wxComboControl() : wxGenericComboControl() {}
104 wxComboControl(wxWindow
*parent
,
105 wxWindowID id
= wxID_ANY
,
106 const wxString
& value
= wxEmptyString
,
107 const wxPoint
& pos
= wxDefaultPosition
,
108 const wxSize
& size
= wxDefaultSize
,
110 const wxValidator
& validator
= wxDefaultValidator
,
111 const wxString
& name
= wxComboBoxNameStr
)
112 : wxGenericComboControl()
114 (void)Create(parent
, id
, value
, pos
, size
, style
, validator
, name
);
117 virtual ~wxComboControl() {}
122 DECLARE_DYNAMIC_CLASS(wxComboControl
)
125 #endif // _WX_COMBOCONTROL_H_
129 #define wxGenericComboControl wxComboControl
131 #endif // !defined(wxCOMBOCONTROL_FULLY_FEATURED)
133 #endif // wxUSE_COMBOCONTROL
135 // _WX_GENERIC_COMBOCONTROL_H_