]>
Commit | Line | Data |
---|---|---|
421a8431 DE |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/cocoa/combobox.h | |
3 | // Purpose: wxComboBox class | |
4 | // Author: David Elliott | |
5 | // Modified by: | |
6 | // Created: 2003/07/14 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 2003 David Elliott | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef __WX_COCOA_COMBOBOX_H__ | |
13 | #define __WX_COCOA_COMBOBOX_H__ | |
14 | ||
15 | #include "wx/textctrl.h" | |
16 | ||
17 | //#include "wx/cocoa/NSTableView.h" | |
18 | ||
19 | // ======================================================================== | |
20 | // wxComboBox | |
21 | // ======================================================================== | |
22 | class WXDLLEXPORT wxComboBox: public wxTextCtrl, public wxComboBoxBase //, protected wxCocoaNSTableView | |
23 | { | |
24 | DECLARE_DYNAMIC_CLASS(wxComboBox) | |
25 | DECLARE_EVENT_TABLE() | |
26 | // WX_DECLARE_COCOA_OWNER(NSComboBox,NSTextField,NSView) | |
27 | // ------------------------------------------------------------------------ | |
28 | // initialization | |
29 | // ------------------------------------------------------------------------ | |
30 | public: | |
31 | wxComboBox() { } | |
32 | wxComboBox(wxWindow *parent, wxWindowID winid, | |
33 | const wxString& value = wxEmptyString, | |
34 | const wxPoint& pos = wxDefaultPosition, | |
35 | const wxSize& size = wxDefaultSize, | |
36 | int n = 0, const wxString choices[] = NULL, | |
37 | long style = 0, | |
38 | const wxValidator& validator = wxDefaultValidator, | |
39 | const wxString& name = wxComboBoxNameStr) | |
40 | { | |
41 | Create(parent, winid, value, pos, size, n, choices, style, validator, name); | |
42 | } | |
43 | ||
44 | bool Create(wxWindow *parent, wxWindowID winid, | |
45 | const wxString& value = wxEmptyString, | |
46 | const wxPoint& pos = wxDefaultPosition, | |
47 | const wxSize& size = wxDefaultSize, | |
48 | int n = 0, const wxString choices[] = NULL, | |
49 | long style = 0, | |
50 | const wxValidator& validator = wxDefaultValidator, | |
51 | const wxString& name = wxComboBoxNameStr); | |
52 | virtual ~wxComboBox(); | |
53 | ||
54 | // ------------------------------------------------------------------------ | |
55 | // Cocoa callbacks | |
56 | // ------------------------------------------------------------------------ | |
57 | protected: | |
58 | // ------------------------------------------------------------------------ | |
59 | // Implementation | |
60 | // ------------------------------------------------------------------------ | |
61 | public: | |
62 | // wxCombobox methods | |
63 | virtual void SetSelection(int); | |
64 | // Overlapping methods | |
65 | virtual wxString GetStringSelection(); | |
e92ea629 DE |
66 | // other methods |
67 | virtual void SetStringSelection(const wxString& selection); | |
421a8431 DE |
68 | // wxItemContainer |
69 | virtual void Clear(); | |
70 | virtual void Delete(int); | |
71 | virtual int GetCount() const; | |
72 | virtual wxString GetString(int) const; | |
73 | virtual void SetString(int, const wxString&); | |
74 | virtual int FindString(const wxString&) const; | |
75 | virtual void Select(int) {} | |
76 | virtual int GetSelection() const; | |
77 | virtual int DoAppend(const wxString&); | |
78 | virtual int DoInsert(const wxString&, int); | |
79 | virtual void DoSetItemClientData(int, void*); | |
80 | virtual void* DoGetItemClientData(int) const; | |
81 | virtual void DoSetItemClientObject(int, wxClientData*); | |
82 | virtual wxClientData* DoGetItemClientObject(int) const; | |
83 | // wxComboBoxBase pure virtuals | |
84 | virtual wxString GetValue() const | |
85 | { return wxTextCtrl::GetValue(); } | |
86 | virtual void SetValue(const wxString& value) | |
87 | { return wxTextCtrl::SetValue(value); } | |
88 | virtual void Cut() { wxTextCtrl::Cut(); } | |
89 | virtual void Copy() { wxTextCtrl::Copy(); } | |
90 | virtual void Paste() { wxTextCtrl::Paste(); } | |
91 | virtual void SetInsertionPoint(long pos) | |
92 | { wxTextCtrl::SetInsertionPoint(pos); } | |
93 | virtual void SetInsertionPointEnd() | |
94 | { wxTextCtrl::SetInsertionPointEnd(); } | |
95 | virtual long GetInsertionPoint() const | |
96 | { return wxTextCtrl::GetInsertionPoint(); } | |
97 | virtual long GetLastPosition() const | |
98 | { return wxTextCtrl::GetLastPosition(); } | |
99 | virtual void Replace(long from, long to, const wxString& value) | |
100 | { wxTextCtrl::Replace(from,to,value); } | |
101 | virtual void SetSelection(long from, long to) | |
102 | { wxTextCtrl::SetSelection(from,to); } | |
103 | virtual void SetEditable(bool editable) | |
104 | { wxTextCtrl::SetEditable(editable); } | |
105 | }; | |
106 | ||
107 | #endif // __WX_COCOA_COMBOBOX_H__ |