moved combobox styles from defs.to to combobox.h; added wxTE/wxCB_FILENAME styles...
[wxWidgets.git] / include / wx / combobox.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/combobox.h
3 // Purpose: wxComboBox declaration
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 24.12.00
7 // RCS-ID: $Id$
8 // Copyright: (c) 1996-2000 wxWidgets team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_COMBOBOX_H_BASE_
13 #define _WX_COMBOBOX_H_BASE_
14
15 #include "wx/defs.h"
16
17 #if wxUSE_COMBOBOX
18
19 /*
20 * wxComboBox style flags
21 */
22 #define wxCB_SIMPLE 0x0004
23 #define wxCB_SORT 0x0008
24 #define wxCB_READONLY 0x0010
25 #define wxCB_DROPDOWN 0x0020
26 #define wxCB_FILENAME 0x0040
27
28 extern WXDLLEXPORT_DATA(const wxChar) wxComboBoxNameStr[];
29
30 // ----------------------------------------------------------------------------
31 // wxComboBoxBase: this interface defines the methods wxComboBox must implement
32 // ----------------------------------------------------------------------------
33
34 #include "wx/textctrl.h"
35 #include "wx/ctrlsub.h"
36
37 class WXDLLEXPORT wxComboBoxBase : public wxItemContainer
38 {
39 public:
40 // wxTextCtrl-like methods wxComboBox must implement
41 virtual wxString GetValue() const = 0;
42 virtual void SetValue(const wxString& value) = 0;
43
44 virtual void Copy() = 0;
45 virtual void Cut() = 0;
46 virtual void Paste() = 0;
47 virtual void SetInsertionPoint(long pos) = 0;
48 virtual long GetInsertionPoint() const = 0;
49 virtual wxTextPos GetLastPosition() const = 0;
50 virtual void Replace(long from, long to, const wxString& value) = 0;
51 virtual void SetSelection(long from, long to) = 0;
52 virtual void SetEditable(bool editable) = 0;
53
54 virtual void SetInsertionPointEnd()
55 { SetInsertionPoint(GetLastPosition()); }
56 virtual void Remove(long from, long to)
57 { Replace(from, to, wxEmptyString); }
58
59 virtual bool IsEditable() const = 0;
60
61 virtual void Undo() = 0;
62 virtual void Redo() = 0;
63 virtual void SelectAll() = 0;
64
65 virtual bool CanCopy() const = 0;
66 virtual bool CanCut() const = 0;
67 virtual bool CanPaste() const = 0;
68 virtual bool CanUndo() const = 0;
69 virtual bool CanRedo() const = 0;
70
71
72 // redeclare inherited SetSelection() overload here as well to avoid
73 // virtual function hiding
74 virtual void SetSelection(int n) = 0;
75 };
76
77 // ----------------------------------------------------------------------------
78 // include the platform-dependent header defining the real class
79 // ----------------------------------------------------------------------------
80
81 #if defined(__WXUNIVERSAL__)
82 #include "wx/univ/combobox.h"
83 #elif defined(__WXMSW__)
84 #include "wx/msw/combobox.h"
85 #elif defined(__WXMOTIF__)
86 #include "wx/motif/combobox.h"
87 #elif defined(__WXGTK20__)
88 #include "wx/gtk/combobox.h"
89 #elif defined(__WXGTK__)
90 #include "wx/gtk1/combobox.h"
91 #elif defined(__WXMAC__)
92 #include "wx/mac/combobox.h"
93 #elif defined(__WXCOCOA__)
94 #include "wx/cocoa/combobox.h"
95 #elif defined(__WXPM__)
96 #include "wx/os2/combobox.h"
97 #endif
98
99 #endif // wxUSE_COMBOBOX
100
101 #endif
102 // _WX_COMBOBOX_H_BASE_