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