2006-05-08 19:42:45 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/generic/combo.h
|
2006-05-16 18:57:40 -04:00
|
|
|
// Purpose: Generic wxComboCtrl
|
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
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-09-19 13:29:45 -04:00
|
|
|
#ifndef _WX_GENERIC_COMBOCTRL_H_
|
|
|
|
#define _WX_GENERIC_COMBOCTRL_H_
|
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
|
|
|
|
|
|
|
// Only define generic if native doesn't have all the features
|
|
|
|
#if !defined(wxCOMBOCONTROL_FULLY_FEATURED)
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2006-05-16 18:57:40 -04:00
|
|
|
// Generic wxComboCtrl
|
2006-05-08 19:42:45 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
|
|
|
|
// all actions of single line text controls are supported
|
|
|
|
|
|
|
|
// popup/dismiss the choice window
|
|
|
|
#define wxACTION_COMBOBOX_POPUP _T("popup")
|
|
|
|
#define wxACTION_COMBOBOX_DISMISS _T("dismiss")
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2007-11-12 16:37:46 -05:00
|
|
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxComboBoxNameStr[];
|
2006-05-08 19:42:45 -04:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxGenericComboCtrl : public wxComboCtrlBase
|
2006-05-08 19:42:45 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ctors and such
|
2006-09-19 13:29:45 -04:00
|
|
|
wxGenericComboCtrl() : wxComboCtrlBase() { Init(); }
|
|
|
|
|
|
|
|
wxGenericComboCtrl(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
|
|
|
: 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-09-19 13:29:45 -04:00
|
|
|
virtual ~wxGenericComboCtrl();
|
2006-05-08 19:42:45 -04:00
|
|
|
|
2006-10-09 16:12:19 -04:00
|
|
|
void SetCustomPaintWidth( int width );
|
|
|
|
|
2006-08-12 20:35:02 -04:00
|
|
|
virtual bool IsKeyPopupToggle(const wxKeyEvent& event) const;
|
|
|
|
|
2006-05-16 18:57:40 -04:00
|
|
|
static int GetFeatures() { return wxComboCtrlFeatures::All; }
|
2006-05-08 19:42:45 -04:00
|
|
|
|
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
// we have our own input handler and our own actions
|
|
|
|
virtual bool PerformAction(const wxControlAction& action,
|
|
|
|
long numArg = 0l,
|
|
|
|
const wxString& strArg = wxEmptyString);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
// Mandatory virtuals
|
|
|
|
virtual void OnResize();
|
|
|
|
|
|
|
|
// Event handlers
|
|
|
|
void OnPaintEvent( wxPaintEvent& event );
|
|
|
|
void OnMouseEvent( wxMouseEvent& event );
|
|
|
|
|
|
|
|
private:
|
|
|
|
void Init();
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
|
2006-09-19 13:29:45 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxGenericComboCtrl)
|
2006-05-08 19:42:45 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _WX_COMBOCONTROL_H_
|
|
|
|
|
2006-05-16 18:57:40 -04:00
|
|
|
// If native wxComboCtrl was not defined, then prepare a simple
|
2006-05-08 19:42:45 -04:00
|
|
|
// front-end so that wxRTTI works as expected.
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxComboCtrl : public wxGenericComboCtrl
|
2006-05-08 19:42:45 -04:00
|
|
|
{
|
|
|
|
public:
|
2006-09-19 13:29:45 -04:00
|
|
|
wxComboCtrl() : wxGenericComboCtrl() {}
|
2006-05-08 19:42:45 -04:00
|
|
|
|
2006-05-16 18:57:40 -04:00
|
|
|
wxComboCtrl(wxWindow *parent,
|
2006-09-19 13:29: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)
|
|
|
|
: wxGenericComboCtrl()
|
2006-05-08 19:42:45 -04:00
|
|
|
{
|
|
|
|
(void)Create(parent, id, value, pos, size, style, validator, name);
|
|
|
|
}
|
|
|
|
|
2006-05-16 18:57:40 -04:00
|
|
|
virtual ~wxComboCtrl() {}
|
2006-05-08 19:42:45 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
private:
|
2006-05-16 18:57:40 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxComboCtrl)
|
2006-05-08 19:42:45 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_COMBOCONTROL_H_
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2006-09-19 13:29:45 -04:00
|
|
|
#define wxGenericComboCtrl wxComboCtrl
|
2006-05-08 19:42:45 -04:00
|
|
|
|
|
|
|
#endif // !defined(wxCOMBOCONTROL_FULLY_FEATURED)
|
|
|
|
|
2006-05-16 18:57:40 -04:00
|
|
|
#endif // wxUSE_COMBOCTRL
|
2006-05-08 19:42:45 -04:00
|
|
|
#endif
|
2006-09-19 13:29:45 -04:00
|
|
|
// _WX_GENERIC_COMBOCTRL_H_
|