1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: combobox.h
|
|
|
|
// Purpose: wxComboBox class
|
1999-10-14 00:43:46 -04:00
|
|
|
// Author: David Webster
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-10-14 00:43:46 -04:00
|
|
|
// Created: 10/13/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-14 00:43:46 -04:00
|
|
|
// Copyright: (c) David Webster
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_COMBOBOX_H_
|
|
|
|
#define _WX_COMBOBOX_H_
|
|
|
|
|
|
|
|
#include "wx/choice.h"
|
2007-11-18 17:55:54 -05:00
|
|
|
#include "wx/textentry.h"
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-14 00:43:46 -04:00
|
|
|
#if wxUSE_COMBOBOX
|
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
// Combobox item
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxComboBox : public wxChoice,
|
2007-11-18 17:55:54 -05:00
|
|
|
public wxTextEntry
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
inline wxComboBox() {}
|
|
|
|
|
2001-11-16 13:40:45 -05:00
|
|
|
inline wxComboBox( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsValue = wxEmptyString
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,int n = 0
|
|
|
|
,const wxString asChoices[] = NULL
|
|
|
|
,long lStyle = 0
|
|
|
|
,const wxValidator& rValidator = wxDefaultValidator
|
|
|
|
,const wxString& rsName = wxComboBoxNameStr
|
|
|
|
)
|
|
|
|
{
|
|
|
|
Create( pParent
|
|
|
|
,vId
|
|
|
|
,rsValue
|
|
|
|
,rPos
|
|
|
|
,rSize
|
|
|
|
,n
|
|
|
|
,asChoices
|
|
|
|
,lStyle
|
|
|
|
,rValidator
|
|
|
|
,rsName
|
|
|
|
);
|
|
|
|
}
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2004-01-31 13:21:45 -05:00
|
|
|
inline wxComboBox( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsValue
|
|
|
|
,const wxPoint& rPos
|
|
|
|
,const wxSize& rSize
|
|
|
|
,const wxArrayString& asChoices
|
|
|
|
,long lStyle = 0
|
|
|
|
,const wxValidator& rValidator = wxDefaultValidator
|
|
|
|
,const wxString& rsName = wxComboBoxNameStr
|
|
|
|
)
|
|
|
|
{
|
|
|
|
Create( pParent
|
|
|
|
,vId
|
|
|
|
,rsValue
|
|
|
|
,rPos
|
|
|
|
,rSize
|
|
|
|
,asChoices
|
|
|
|
,lStyle
|
|
|
|
,rValidator
|
|
|
|
,rsName
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2001-11-16 13:40:45 -05:00
|
|
|
bool Create( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsValue = wxEmptyString
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,int n = 0
|
|
|
|
,const wxString asChoices[] = NULL
|
|
|
|
,long lStyle = 0
|
|
|
|
,const wxValidator& rValidator = wxDefaultValidator
|
|
|
|
,const wxString& rsName = wxComboBoxNameStr
|
|
|
|
);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2004-01-31 13:21:45 -05:00
|
|
|
bool Create( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsValue
|
|
|
|
,const wxPoint& rPos
|
|
|
|
,const wxSize& rSize
|
|
|
|
,const wxArrayString& asChoices
|
|
|
|
,long lStyle = 0
|
|
|
|
,const wxValidator& rValidator = wxDefaultValidator
|
|
|
|
,const wxString& rsName = wxComboBoxNameStr
|
|
|
|
);
|
|
|
|
|
2007-11-18 17:55:54 -05:00
|
|
|
// resolve ambiguities among virtual functions inherited from both base
|
|
|
|
// classes
|
|
|
|
virtual void Clear();
|
|
|
|
virtual wxString GetValue() const;
|
|
|
|
virtual void SetValue(const wxString& value);
|
|
|
|
virtual wxString GetStringSelection() const
|
|
|
|
{ return wxChoice::GetStringSelection(); }
|
|
|
|
|
2001-11-16 13:40:45 -05:00
|
|
|
inline virtual void SetSelection(int n) { wxChoice::SetSelection(n); }
|
2007-11-18 17:55:54 -05:00
|
|
|
virtual void SetSelection(long from, long to)
|
|
|
|
{ wxTextEntry::SetSelection(from, to); }
|
|
|
|
virtual int GetSelection() const { return wxChoice::GetSelection(); }
|
|
|
|
virtual void GetSelection(long *from, long *to) const
|
|
|
|
{ wxTextEntry::GetSelection(from, to); }
|
|
|
|
|
|
|
|
virtual bool IsEditable() const;
|
2001-11-16 13:40:45 -05:00
|
|
|
|
|
|
|
virtual bool OS2Command( WXUINT uParam
|
|
|
|
,WXWORD wId
|
|
|
|
);
|
|
|
|
bool ProcessEditMsg( WXUINT uMsg
|
|
|
|
,WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2001-11-16 13:40:45 -05:00
|
|
|
private:
|
2009-03-02 07:25:01 -05:00
|
|
|
// implement wxTextEntry pure virtual methods
|
|
|
|
virtual wxWindow *GetEditableWindow() { return this; }
|
2007-11-18 17:55:54 -05:00
|
|
|
virtual WXHWND GetEditHWND() const { return m_hWnd; }
|
|
|
|
|
2001-11-16 13:40:45 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxComboBox)
|
|
|
|
}; // end of CLASS wxComboBox
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-14 00:43:46 -04:00
|
|
|
#endif // wxUSE_COMBOBOX
|
1999-07-29 01:11:30 -04:00
|
|
|
#endif
|
|
|
|
// _WX_COMBOBOX_H_
|