2001-06-26 20:59:19 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/combobox.h
|
|
|
|
// Purpose: wxComboBox declaration
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 24.12.00
|
2004-05-23 14:56:36 +00:00
|
|
|
// Copyright: (c) 1996-2000 wxWidgets team
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2001-06-26 20:59:19 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-15 00:23:28 +00:00
|
|
|
#ifndef _WX_COMBOBOX_H_BASE_
|
|
|
|
#define _WX_COMBOBOX_H_BASE_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2006-07-30 12:38:39 +00:00
|
|
|
#if wxUSE_COMBOBOX
|
|
|
|
|
2012-03-25 17:55:42 +00:00
|
|
|
// For compatibility with 2.8 include this header to allow using wxTE_XXX
|
|
|
|
// styles with wxComboBox without explicitly including it in the user code.
|
|
|
|
#include "wx/textctrl.h"
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxComboBoxNameStr[];
|
2001-06-26 20:59:19 +00:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxComboBoxBase: this interface defines the methods wxComboBox must implement
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include "wx/ctrlsub.h"
|
2007-09-26 00:30:22 +00:00
|
|
|
#include "wx/textentry.h"
|
2001-06-26 20:59:19 +00:00
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxComboBoxBase : public wxItemContainer,
|
2009-02-15 19:34:58 +00:00
|
|
|
public wxTextEntry
|
2001-06-26 20:59:19 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-11-13 15:22:40 +00:00
|
|
|
// override these methods to disambiguate between two base classes versions
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void Clear() wxOVERRIDE
|
2007-09-26 00:30:22 +00:00
|
|
|
{
|
|
|
|
wxTextEntry::Clear();
|
|
|
|
wxItemContainer::Clear();
|
|
|
|
}
|
|
|
|
|
2011-08-21 12:06:16 +00:00
|
|
|
// IsEmpty() is ambiguous because we inherit it from both wxItemContainer
|
|
|
|
// and wxTextEntry, and even if defined it here to help the compiler with
|
|
|
|
// choosing one of them, it would still be confusing for the human users of
|
|
|
|
// this class. So instead define the clearly named methods below and leave
|
|
|
|
// IsEmpty() ambiguous to trigger a compilation error if it's used.
|
|
|
|
bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
|
|
|
|
bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
|
2007-11-13 15:22:40 +00:00
|
|
|
|
2007-09-26 00:30:22 +00:00
|
|
|
// also bring in GetSelection() versions of both base classes in scope
|
|
|
|
//
|
|
|
|
// NB: GetSelection(from, to) could be already implemented in wxTextEntry
|
|
|
|
// but still make it pure virtual because for some platforms it's not
|
|
|
|
// implemented there and also because the derived class has to override
|
|
|
|
// it anyhow to avoid ambiguity with the other GetSelection()
|
2015-09-07 00:20:42 +00:00
|
|
|
virtual int GetSelection() const wxOVERRIDE = 0;
|
|
|
|
virtual void GetSelection(long *from, long *to) const wxOVERRIDE = 0;
|
2004-12-09 15:16:51 +00:00
|
|
|
|
2011-12-29 14:42:13 +00:00
|
|
|
virtual void Popup() { wxFAIL_MSG( wxT("Not implemented") ); }
|
|
|
|
virtual void Dismiss() { wxFAIL_MSG( wxT("Not implemented") ); }
|
2010-01-24 01:00:45 +00:00
|
|
|
|
2006-10-30 16:04:27 +00:00
|
|
|
// may return value different from GetSelection() when the combobox
|
|
|
|
// dropdown is shown and the user selected, but not yet accepted, a value
|
|
|
|
// different from the old one in it
|
|
|
|
virtual int GetCurrentSelection() const { return GetSelection(); }
|
2001-06-26 20:59:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// include the platform-dependent header defining the real class
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
#include "wx/univ/combobox.h"
|
|
|
|
#elif defined(__WXMSW__)
|
|
|
|
#include "wx/msw/combobox.h"
|
1998-07-10 14:15:17 +00:00
|
|
|
#elif defined(__WXMOTIF__)
|
2001-06-26 20:59:19 +00:00
|
|
|
#include "wx/motif/combobox.h"
|
2006-01-23 03:27:34 +00:00
|
|
|
#elif defined(__WXGTK20__)
|
2001-06-26 20:59:19 +00:00
|
|
|
#include "wx/gtk/combobox.h"
|
2006-01-23 03:27:34 +00:00
|
|
|
#elif defined(__WXGTK__)
|
|
|
|
#include "wx/gtk1/combobox.h"
|
1998-08-15 00:23:28 +00:00
|
|
|
#elif defined(__WXMAC__)
|
2008-06-11 19:17:41 +00:00
|
|
|
#include "wx/osx/combobox.h"
|
2014-08-24 01:50:11 +00:00
|
|
|
#elif defined(__WXQT__)
|
|
|
|
#include "wx/qt/combobox.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#endif // wxUSE_COMBOBOX
|
|
|
|
|
2007-09-26 00:30:22 +00:00
|
|
|
#endif // _WX_COMBOBOX_H_BASE_
|