-#define wxACTION_COMBOBOX_SELECT_NEXT _T("next")
-#define wxACTION_COMBOBOX_SELECT_PREV _T("prev")
-#define wxACTION_COMBOBOX_SELECT _T("select")
-
-// ----------------------------------------------------------------------------
-// wxComboPopup is the interface which must be implemented by a control to be
-// used as a popup by wxComboControl
-// ----------------------------------------------------------------------------
-
-class WXDLLEXPORT wxComboPopup
-{
-public:
- wxComboPopup(wxComboControl *combo) { m_combo = combo; }
-
- // we must have an associated control which is subclassed by the combobox
- virtual wxControl *GetControl() = 0;
-
- // called before showing the control to set the initial selection - notice
- // that the text passed to this method might not correspond to any valid
- // item (if the user edited it directly), in which case the method should
- // just return false but not emit any errors
- virtual bool SetSelection(const wxString& value) = 0;
-
- // called immediately after the control is shown
- virtual void OnShow() = 0;
-
- virtual wxCoord GetBestWidth() const {return 0; }
-
-protected:
- wxComboControl *m_combo;
-};
-
-// ----------------------------------------------------------------------------
-// wxComboControl: a combination of a (single line) text control with a button
-// opening a popup window which contains the control from which the user can
-// choose the value directly.
-// ----------------------------------------------------------------------------
-
-class WXDLLEXPORT wxComboControl : public wxControl
-{
-public:
- // construction
- wxComboControl()
- {
- Init();
- }
-
- wxComboControl(wxWindow *parent,
- wxWindowID id,
- const wxString& value = wxEmptyString,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxComboBoxNameStr)
- {
- Init();
-
- (void)Create(parent, id, value, pos, size, style, validator, name);
- }
-
- bool Create(wxWindow *parent,
- wxWindowID id,
- const wxString& value = wxEmptyString,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxComboBoxNameStr);
-
- virtual ~wxComboControl();
-
- // a combo control needs a control for popup window it displays
- void SetPopupControl(wxComboPopup *popup);
- wxComboPopup *GetPopupControl() const { return m_popup; }
-
- // show/hide popup window
- void ShowPopup();
- void HidePopup();
-
- // return true if the popup is currently shown
- bool IsPopupShown() const { return m_isPopupShown; }
-
- // get the popup window containing the popup control
- wxPopupComboWindow *GetPopupWindow() const { return m_winPopup; }
-
- // get the text control which is part of the combobox
- wxTextCtrl *GetText() const { return m_text; }
-
- // implementation only from now on
- // -------------------------------
-
- // notifications from wxComboPopup (shouldn't be called by anybody else)
-
- // called when the user selects something in the popup: this normally hides
- // the popup and sets the text to the new value
- virtual void OnSelect(const wxString& value);