2006-05-08 19:42:45 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/msw/combo.h
|
2006-05-16 18:57:40 -04:00
|
|
|
// Purpose: wxComboCtrl class
|
2006-05-08 19:42:45 -04:00
|
|
|
// Author: Jaakko Salli
|
|
|
|
// Modified by:
|
|
|
|
// Created: Apr-30-2006
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Jaakko Salli
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_COMBOCONTROL_H_
|
|
|
|
#define _WX_COMBOCONTROL_H_
|
|
|
|
|
|
|
|
// NB: Definition of _WX_COMBOCONTROL_H_ is used in wx/generic/combo.h to
|
2006-05-16 18:57:40 -04:00
|
|
|
// determine whether there is native wxComboCtrl, so make sure you
|
|
|
|
// use it in all native wxComboCtrls.
|
2006-05-08 19:42:45 -04:00
|
|
|
|
2006-05-16 18:57:40 -04:00
|
|
|
#if wxUSE_COMBOCTRL
|
2006-05-08 19:42:45 -04:00
|
|
|
|
2006-10-26 16:35:57 -04:00
|
|
|
#if !defined(__WXWINCE__) && wxUSE_TIMER
|
|
|
|
#include "wx/timer.h"
|
|
|
|
#define wxUSE_COMBOCTRL_POPUP_ANIMATION 1
|
|
|
|
#else
|
|
|
|
#define wxUSE_COMBOCTRL_POPUP_ANIMATION 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2006-05-08 19:42:45 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
2006-05-16 18:57:40 -04:00
|
|
|
// Native wxComboCtrl
|
2006-05-08 19:42:45 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// Define this only if native implementation includes all features
|
|
|
|
#define wxCOMBOCONTROL_FULLY_FEATURED
|
|
|
|
|
2007-11-13 06:00:14 -05:00
|
|
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxComboBoxNameStr[];
|
2006-05-19 11:12:56 -04:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxComboCtrl : public wxComboCtrlBase
|
2006-05-08 19:42:45 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ctors and such
|
2006-05-16 18:57:40 -04:00
|
|
|
wxComboCtrl() : wxComboCtrlBase() { Init(); }
|
2006-05-08 19:42:45 -04:00
|
|
|
|
2006-05-16 18:57:40 -04:00
|
|
|
wxComboCtrl(wxWindow *parent,
|
2006-05-08 19:42:45 -04:00
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxString& value = wxEmptyString,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxComboBoxNameStr)
|
2006-05-16 18:57:40 -04:00
|
|
|
: wxComboCtrlBase()
|
2006-05-08 19:42:45 -04:00
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
(void)Create(parent, id, value, pos, size, style, validator, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxString& value = wxEmptyString,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxComboBoxNameStr);
|
|
|
|
|
2006-05-16 18:57:40 -04:00
|
|
|
virtual ~wxComboCtrl();
|
2006-05-08 19:42:45 -04:00
|
|
|
|
2006-09-03 09:21:29 -04:00
|
|
|
virtual void PrepareBackground( wxDC& dc, const wxRect& rect, int flags ) const;
|
2006-08-12 20:35:02 -04:00
|
|
|
virtual bool IsKeyPopupToggle(const wxKeyEvent& event) const;
|
2006-05-08 19:42:45 -04:00
|
|
|
|
2006-05-16 18:57:40 -04:00
|
|
|
static int GetFeatures() { return wxComboCtrlFeatures::All; }
|
2006-05-08 19:42:45 -04:00
|
|
|
|
2006-10-26 16:35:57 -04:00
|
|
|
#if wxUSE_COMBOCTRL_POPUP_ANIMATION
|
|
|
|
void OnTimerEvent( wxTimerEvent& event );
|
2006-12-09 14:48:21 -05:00
|
|
|
protected:
|
|
|
|
virtual bool AnimateShow( const wxRect& rect, int flags );
|
2006-10-26 16:35:57 -04:00
|
|
|
#endif
|
|
|
|
|
2006-05-08 19:42:45 -04:00
|
|
|
protected:
|
|
|
|
|
|
|
|
// customization
|
|
|
|
virtual void OnResize();
|
|
|
|
virtual wxCoord GetNativeTextIndent() const;
|
|
|
|
virtual void OnThemeChange();
|
|
|
|
|
|
|
|
// event handlers
|
|
|
|
void OnPaintEvent( wxPaintEvent& event );
|
|
|
|
void OnMouseEvent( wxMouseEvent& event );
|
|
|
|
|
|
|
|
private:
|
|
|
|
void Init();
|
|
|
|
|
2006-10-26 16:35:57 -04:00
|
|
|
#if wxUSE_COMBOCTRL_POPUP_ANIMATION
|
|
|
|
// Popup animation related
|
|
|
|
wxLongLong m_animStart;
|
|
|
|
wxTimer m_animTimer;
|
|
|
|
wxRect m_animRect;
|
|
|
|
int m_animFlags;
|
|
|
|
#endif
|
|
|
|
|
2006-05-08 19:42:45 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
|
2006-05-16 18:57:40 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxComboCtrl)
|
2006-05-08 19:42:45 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-05-16 18:57:40 -04:00
|
|
|
#endif // wxUSE_COMBOCTRL
|
2006-05-08 19:42:45 -04:00
|
|
|
#endif
|
|
|
|
// _WX_COMBOCONTROL_H_
|