1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/combo.h
3 // Purpose: wxComboCtrl class
4 // Author: Jaakko Salli
6 // Created: Apr-30-2006
7 // Copyright: (c) Jaakko Salli
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_COMBOCONTROL_H_
12 #define _WX_COMBOCONTROL_H_
14 // NB: Definition of _WX_COMBOCONTROL_H_ is used in wx/generic/combo.h to
15 // determine whether there is native wxComboCtrl, so make sure you
16 // use it in all native wxComboCtrls.
20 #if !defined(__WXWINCE__) && wxUSE_TIMER
22 #define wxUSE_COMBOCTRL_POPUP_ANIMATION 1
24 #define wxUSE_COMBOCTRL_POPUP_ANIMATION 0
28 // ----------------------------------------------------------------------------
30 // ----------------------------------------------------------------------------
32 // Define this only if native implementation includes all features
33 #define wxCOMBOCONTROL_FULLY_FEATURED
35 extern WXDLLIMPEXP_DATA_CORE(const char) wxComboBoxNameStr
[];
37 class WXDLLIMPEXP_CORE wxComboCtrl
: public wxComboCtrlBase
41 wxComboCtrl() : wxComboCtrlBase() { Init(); }
43 wxComboCtrl(wxWindow
*parent
,
44 wxWindowID id
= wxID_ANY
,
45 const wxString
& value
= wxEmptyString
,
46 const wxPoint
& pos
= wxDefaultPosition
,
47 const wxSize
& size
= wxDefaultSize
,
49 const wxValidator
& validator
= wxDefaultValidator
,
50 const wxString
& name
= wxComboBoxNameStr
)
55 (void)Create(parent
, id
, value
, pos
, size
, style
, validator
, name
);
58 bool Create(wxWindow
*parent
,
59 wxWindowID id
= wxID_ANY
,
60 const wxString
& value
= wxEmptyString
,
61 const wxPoint
& pos
= wxDefaultPosition
,
62 const wxSize
& size
= wxDefaultSize
,
64 const wxValidator
& validator
= wxDefaultValidator
,
65 const wxString
& name
= wxComboBoxNameStr
);
67 virtual ~wxComboCtrl();
69 virtual void PrepareBackground( wxDC
& dc
, const wxRect
& rect
, int flags
) const;
70 virtual bool IsKeyPopupToggle(const wxKeyEvent
& event
) const;
72 static int GetFeatures() { return wxComboCtrlFeatures::All
; }
74 #if wxUSE_COMBOCTRL_POPUP_ANIMATION
75 void OnTimerEvent(wxTimerEvent
& WXUNUSED(event
)) { DoTimerEvent(); }
80 virtual bool AnimateShow( const wxRect
& rect
, int flags
);
81 #endif // wxUSE_COMBOCTRL_POPUP_ANIMATION
85 // Dummy method - we override all functions that call this
86 virtual WXHWND
GetEditHWND() const { return NULL
; }
89 virtual void OnResize();
90 virtual wxCoord
GetNativeTextIndent() const;
93 void OnPaintEvent( wxPaintEvent
& event
);
94 void OnMouseEvent( wxMouseEvent
& event
);
96 virtual bool HasTransparentBackground() { return IsDoubleBuffered(); }
101 #if wxUSE_COMBOCTRL_POPUP_ANIMATION
102 // Popup animation related
103 wxLongLong m_animStart
;
109 DECLARE_EVENT_TABLE()
111 DECLARE_DYNAMIC_CLASS(wxComboCtrl
)
115 #endif // wxUSE_COMBOCTRL
117 // _WX_COMBOCONTROL_H_