]>
Commit | Line | Data |
---|---|---|
1e6feb95 VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/combobox.h | |
3 | // Purpose: wxComboBox declaration | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 24.12.00 | |
77ffb593 | 7 | // Copyright: (c) 1996-2000 wxWidgets team |
65571936 | 8 | // Licence: wxWindows licence |
1e6feb95 VZ |
9 | /////////////////////////////////////////////////////////////////////////////// |
10 | ||
34138703 JS |
11 | #ifndef _WX_COMBOBOX_H_BASE_ |
12 | #define _WX_COMBOBOX_H_BASE_ | |
c801d85f | 13 | |
1e6feb95 VZ |
14 | #include "wx/defs.h" |
15 | ||
83beee57 RR |
16 | #if wxUSE_COMBOBOX |
17 | ||
2970f22a VZ |
18 | // For compatibility with 2.8 include this header to allow using wxTE_XXX |
19 | // styles with wxComboBox without explicitly including it in the user code. | |
20 | #include "wx/textctrl.h" | |
21 | ||
53a2db12 | 22 | extern WXDLLIMPEXP_DATA_CORE(const char) wxComboBoxNameStr[]; |
1e6feb95 VZ |
23 | |
24 | // ---------------------------------------------------------------------------- | |
25 | // wxComboBoxBase: this interface defines the methods wxComboBox must implement | |
26 | // ---------------------------------------------------------------------------- | |
27 | ||
28 | #include "wx/ctrlsub.h" | |
0ec1179b | 29 | #include "wx/textentry.h" |
1e6feb95 | 30 | |
53a2db12 | 31 | class WXDLLIMPEXP_CORE wxComboBoxBase : public wxItemContainer, |
8bd9fa33 | 32 | public wxTextEntry |
1e6feb95 VZ |
33 | { |
34 | public: | |
f7dfb0b5 | 35 | // override these methods to disambiguate between two base classes versions |
0ec1179b VZ |
36 | virtual void Clear() |
37 | { | |
38 | wxTextEntry::Clear(); | |
39 | wxItemContainer::Clear(); | |
40 | } | |
41 | ||
36a96421 VZ |
42 | // IsEmpty() is ambiguous because we inherit it from both wxItemContainer |
43 | // and wxTextEntry, and even if defined it here to help the compiler with | |
44 | // choosing one of them, it would still be confusing for the human users of | |
45 | // this class. So instead define the clearly named methods below and leave | |
46 | // IsEmpty() ambiguous to trigger a compilation error if it's used. | |
47 | bool IsListEmpty() const { return wxItemContainer::IsEmpty(); } | |
48 | bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); } | |
f7dfb0b5 | 49 | |
0ec1179b VZ |
50 | // also bring in GetSelection() versions of both base classes in scope |
51 | // | |
52 | // NB: GetSelection(from, to) could be already implemented in wxTextEntry | |
53 | // but still make it pure virtual because for some platforms it's not | |
54 | // implemented there and also because the derived class has to override | |
55 | // it anyhow to avoid ambiguity with the other GetSelection() | |
56 | virtual int GetSelection() const = 0; | |
57 | virtual void GetSelection(long *from, long *to) const = 0; | |
150e31d2 | 58 | |
6dd0883d SN |
59 | virtual void Popup() { wxFAIL_MSG( wxT("Not implemented") ); } |
60 | virtual void Dismiss() { wxFAIL_MSG( wxT("Not implemented") ); } | |
d1d1f817 | 61 | |
c63312c4 VZ |
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(); } | |
1e6feb95 VZ |
66 | }; |
67 | ||
68 | // ---------------------------------------------------------------------------- | |
69 | // include the platform-dependent header defining the real class | |
70 | // ---------------------------------------------------------------------------- | |
71 | ||
72 | #if defined(__WXUNIVERSAL__) | |
73 | #include "wx/univ/combobox.h" | |
74 | #elif defined(__WXMSW__) | |
75 | #include "wx/msw/combobox.h" | |
2049ba38 | 76 | #elif defined(__WXMOTIF__) |
1e6feb95 | 77 | #include "wx/motif/combobox.h" |
1be7a35c | 78 | #elif defined(__WXGTK20__) |
1e6feb95 | 79 | #include "wx/gtk/combobox.h" |
1be7a35c MR |
80 | #elif defined(__WXGTK__) |
81 | #include "wx/gtk1/combobox.h" | |
34138703 | 82 | #elif defined(__WXMAC__) |
ef0e9220 | 83 | #include "wx/osx/combobox.h" |
421a8431 DE |
84 | #elif defined(__WXCOCOA__) |
85 | #include "wx/cocoa/combobox.h" | |
1777b9bb | 86 | #elif defined(__WXPM__) |
1e6feb95 | 87 | #include "wx/os2/combobox.h" |
c801d85f KB |
88 | #endif |
89 | ||
1e6feb95 VZ |
90 | #endif // wxUSE_COMBOBOX |
91 | ||
0ec1179b | 92 | #endif // _WX_COMBOBOX_H_BASE_ |