]>
Commit | Line | Data |
---|---|---|
0e320a79 DW |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: combobox.h | |
3 | // Purpose: wxComboBox class | |
37f214d5 | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
37f214d5 | 6 | // Created: 10/13/99 |
0e320a79 | 7 | // RCS-ID: $Id$ |
37f214d5 | 8 | // Copyright: (c) David Webster |
65571936 | 9 | // Licence: wxWindows licence |
0e320a79 DW |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_COMBOBOX_H_ | |
13 | #define _WX_COMBOBOX_H_ | |
14 | ||
0e320a79 | 15 | #include "wx/choice.h" |
72cb72bf | 16 | #include "wx/textentry.h" |
0e320a79 | 17 | |
37f214d5 DW |
18 | #if wxUSE_COMBOBOX |
19 | ||
0e320a79 | 20 | // Combobox item |
72cb72bf SN |
21 | class WXDLLEXPORT wxComboBox : public wxChoice, |
22 | public wxTextEntry | |
0e320a79 | 23 | { |
0e320a79 DW |
24 | |
25 | public: | |
26 | inline wxComboBox() {} | |
27 | ||
fb49f3b3 DW |
28 | inline wxComboBox( wxWindow* pParent |
29 | ,wxWindowID vId | |
30 | ,const wxString& rsValue = wxEmptyString | |
31 | ,const wxPoint& rPos = wxDefaultPosition | |
32 | ,const wxSize& rSize = wxDefaultSize | |
33 | ,int n = 0 | |
34 | ,const wxString asChoices[] = NULL | |
35 | ,long lStyle = 0 | |
fb49f3b3 | 36 | ,const wxValidator& rValidator = wxDefaultValidator |
fb49f3b3 DW |
37 | ,const wxString& rsName = wxComboBoxNameStr |
38 | ) | |
39 | { | |
40 | Create( pParent | |
41 | ,vId | |
42 | ,rsValue | |
43 | ,rPos | |
44 | ,rSize | |
45 | ,n | |
46 | ,asChoices | |
47 | ,lStyle | |
fb49f3b3 | 48 | ,rValidator |
fb49f3b3 DW |
49 | ,rsName |
50 | ); | |
51 | } | |
0e320a79 | 52 | |
584ad2a3 MB |
53 | inline wxComboBox( wxWindow* pParent |
54 | ,wxWindowID vId | |
55 | ,const wxString& rsValue | |
56 | ,const wxPoint& rPos | |
57 | ,const wxSize& rSize | |
58 | ,const wxArrayString& asChoices | |
59 | ,long lStyle = 0 | |
60 | ,const wxValidator& rValidator = wxDefaultValidator | |
61 | ,const wxString& rsName = wxComboBoxNameStr | |
62 | ) | |
63 | { | |
64 | Create( pParent | |
65 | ,vId | |
66 | ,rsValue | |
67 | ,rPos | |
68 | ,rSize | |
69 | ,asChoices | |
70 | ,lStyle | |
71 | ,rValidator | |
72 | ,rsName | |
73 | ); | |
74 | } | |
75 | ||
fb49f3b3 DW |
76 | bool Create( wxWindow* pParent |
77 | ,wxWindowID vId | |
78 | ,const wxString& rsValue = wxEmptyString | |
79 | ,const wxPoint& rPos = wxDefaultPosition | |
80 | ,const wxSize& rSize = wxDefaultSize | |
81 | ,int n = 0 | |
82 | ,const wxString asChoices[] = NULL | |
83 | ,long lStyle = 0 | |
fb49f3b3 | 84 | ,const wxValidator& rValidator = wxDefaultValidator |
fb49f3b3 DW |
85 | ,const wxString& rsName = wxComboBoxNameStr |
86 | ); | |
0e320a79 | 87 | |
584ad2a3 MB |
88 | bool Create( wxWindow* pParent |
89 | ,wxWindowID vId | |
90 | ,const wxString& rsValue | |
91 | ,const wxPoint& rPos | |
92 | ,const wxSize& rSize | |
93 | ,const wxArrayString& asChoices | |
94 | ,long lStyle = 0 | |
95 | ,const wxValidator& rValidator = wxDefaultValidator | |
96 | ,const wxString& rsName = wxComboBoxNameStr | |
97 | ); | |
98 | ||
72cb72bf SN |
99 | // resolve ambiguities among virtual functions inherited from both base |
100 | // classes | |
101 | virtual void Clear(); | |
102 | virtual wxString GetValue() const; | |
103 | virtual void SetValue(const wxString& value); | |
104 | virtual wxString GetStringSelection() const | |
105 | { return wxChoice::GetStringSelection(); } | |
106 | ||
fb49f3b3 | 107 | inline virtual void SetSelection(int n) { wxChoice::SetSelection(n); } |
72cb72bf SN |
108 | virtual void SetSelection(long from, long to) |
109 | { wxTextEntry::SetSelection(from, to); } | |
110 | virtual int GetSelection() const { return wxChoice::GetSelection(); } | |
111 | virtual void GetSelection(long *from, long *to) const | |
112 | { wxTextEntry::GetSelection(from, to); } | |
113 | ||
114 | virtual bool IsEditable() const; | |
fb49f3b3 DW |
115 | |
116 | virtual bool OS2Command( WXUINT uParam | |
117 | ,WXWORD wId | |
118 | ); | |
119 | bool ProcessEditMsg( WXUINT uMsg | |
120 | ,WXWPARAM wParam | |
121 | ,WXLPARAM lParam | |
122 | ); | |
0e320a79 | 123 | |
fb49f3b3 | 124 | private: |
72cb72bf SN |
125 | // implement wxTextEntry pure virtual: it implements all the operations for |
126 | // the simple EDIT controls | |
127 | virtual WXHWND GetEditHWND() const { return m_hWnd; } | |
128 | ||
fb49f3b3 DW |
129 | DECLARE_DYNAMIC_CLASS(wxComboBox) |
130 | }; // end of CLASS wxComboBox | |
0e320a79 | 131 | |
37f214d5 | 132 | #endif // wxUSE_COMBOBOX |
0e320a79 DW |
133 | #endif |
134 | // _WX_COMBOBOX_H_ |