2006-05-08 23:42:45 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/msw/combo.h
|
2006-05-16 22:57:40 +00:00
|
|
|
// Purpose: wxComboCtrl class
|
2006-05-08 23:42:45 +00: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 22:57:40 +00:00
|
|
|
// determine whether there is native wxComboCtrl, so make sure you
|
|
|
|
// use it in all native wxComboCtrls.
|
2006-05-08 23:42:45 +00:00
|
|
|
|
2006-05-16 22:57:40 +00:00
|
|
|
#if wxUSE_COMBOCTRL
|
2006-05-08 23:42:45 +00:00
|
|
|
|
2006-10-26 20:35:57 +00: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 23:42:45 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
2006-05-16 22:57:40 +00:00
|
|
|
// Native wxComboCtrl
|
2006-05-08 23:42:45 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// Define this only if native implementation includes all features
|
|
|
|
#define wxCOMBOCONTROL_FULLY_FEATURED
|
|
|
|
|
2007-11-13 11:00:14 +00:00
|
|
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxComboBoxNameStr[];
|
2006-05-19 15:12:56 +00:00
|
|
|
|
2006-05-16 22:57:40 +00:00
|
|
|
class WXDLLEXPORT wxComboCtrl : public wxComboCtrlBase
|
2006-05-08 23:42:45 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ctors and such
|
2006-05-16 22:57:40 +00:00
|
|
|
wxComboCtrl() : wxComboCtrlBase() { Init(); }
|
2006-05-08 23:42:45 +00:00
|
|
|
|
2006-05-16 22:57:40 +00:00
|
|
|
wxComboCtrl(wxWindow *parent,
|
2006-05-08 23:42:45 +00: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 22:57:40 +00:00
|
|
|
: wxComboCtrlBase()
|
2006-05-08 23:42:45 +00: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 22:57:40 +00:00
|
|
|
virtual ~wxComboCtrl();
|
2006-05-08 23:42:45 +00:00
|
|
|
|
2006-09-03 13:21:29 +00:00
|
|
|
virtual void PrepareBackground( wxDC& dc, const wxRect& rect, int flags ) const;
|
2006-08-13 00:35:02 +00:00
|
|
|
virtual bool IsKeyPopupToggle(const wxKeyEvent& event) const;
|
2006-05-08 23:42:45 +00:00
|
|
|
|
2006-05-16 22:57:40 +00:00
|
|
|
static int GetFeatures() { return wxComboCtrlFeatures::All; }
|
2006-05-08 23:42:45 +00:00
|
|
|
|
2006-10-26 20:35:57 +00:00
|
|
|
#if wxUSE_COMBOCTRL_POPUP_ANIMATION
|
|
|
|
void OnTimerEvent( wxTimerEvent& event );
|
2006-12-09 19:48:21 +00:00
|
|
|
protected:
|
|
|
|
virtual bool AnimateShow( const wxRect& rect, int flags );
|
2006-10-26 20:35:57 +00:00
|
|
|
#endif
|
|
|
|
|
2006-05-08 23:42:45 +00: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 20:35:57 +00: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 23:42:45 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
|
2006-05-16 22:57:40 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxComboCtrl)
|
2006-05-08 23:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-05-16 22:57:40 +00:00
|
|
|
#endif // wxUSE_COMBOCTRL
|
2006-05-08 23:42:45 +00:00
|
|
|
#endif
|
|
|
|
// _WX_COMBOCONTROL_H_
|