1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxComboBox declaration
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1996-2000 wxWidgets team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_COMBOBOX_H_BASE_
13 #define _WX_COMBOBOX_H_BASE_
19 extern WXDLLEXPORT_DATA(const wxChar
) wxComboBoxNameStr
[];
21 // ----------------------------------------------------------------------------
22 // wxComboBoxBase: this interface defines the methods wxComboBox must implement
23 // ----------------------------------------------------------------------------
25 #include "wx/textctrl.h"
26 #include "wx/ctrlsub.h"
28 class WXDLLEXPORT wxComboBoxBase
: public wxItemContainer
31 // wxTextCtrl-like methods wxComboBox must implement
32 virtual wxString
GetValue() const = 0;
33 virtual void SetValue(const wxString
& value
) = 0;
35 virtual void Copy() = 0;
36 virtual void Cut() = 0;
37 virtual void Paste() = 0;
38 virtual void SetInsertionPoint(long pos
) = 0;
39 virtual long GetInsertionPoint() const = 0;
40 virtual wxTextPos
GetLastPosition() const = 0;
41 virtual void Replace(long from
, long to
, const wxString
& value
) = 0;
42 virtual void SetSelection(long from
, long to
) = 0;
43 virtual void SetEditable(bool editable
) = 0;
45 virtual void SetInsertionPointEnd()
46 { SetInsertionPoint(GetLastPosition()); }
47 virtual void Remove(long from
, long to
)
48 { Replace(from
, to
, wxEmptyString
); }
50 virtual bool IsEditable() const = 0;
52 virtual void Undo() = 0;
53 virtual void Redo() = 0;
54 virtual void SelectAll() = 0;
56 virtual bool CanCopy() const = 0;
57 virtual bool CanCut() const = 0;
58 virtual bool CanPaste() const = 0;
59 virtual bool CanUndo() const = 0;
60 virtual bool CanRedo() const = 0;
62 // may return value different from GetSelection() when the combobox
63 // dropdown is shown and the user selected, but not yet accepted, a value
64 // different from the old one in it
65 virtual int GetCurrentSelection() const { return GetSelection(); }
67 // redeclare inherited SetSelection() overload here as well to avoid
68 // virtual function hiding
69 virtual void SetSelection(int n
) = 0;
72 // ----------------------------------------------------------------------------
73 // include the platform-dependent header defining the real class
74 // ----------------------------------------------------------------------------
76 #if defined(__WXUNIVERSAL__)
77 #include "wx/univ/combobox.h"
78 #elif defined(__WXMSW__)
79 #include "wx/msw/combobox.h"
80 #elif defined(__WXMOTIF__)
81 #include "wx/motif/combobox.h"
82 #elif defined(__WXGTK20__)
83 #include "wx/gtk/combobox.h"
84 #elif defined(__WXGTK__)
85 #include "wx/gtk1/combobox.h"
86 #elif defined(__WXMAC__)
87 #include "wx/mac/combobox.h"
88 #elif defined(__WXCOCOA__)
89 #include "wx/cocoa/combobox.h"
90 #elif defined(__WXPM__)
91 #include "wx/os2/combobox.h"
94 #endif // wxUSE_COMBOBOX
97 // _WX_COMBOBOX_H_BASE_