]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/combobox.h
Moved Clear() implementation into wxDC using a new virtual CocoaGetBounds()
[wxWidgets.git] / include / wx / cocoa / combobox.h
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 wxComboBox(wxWindow *parent, wxWindowID winid,
44 const wxString& value,
45 const wxPoint& pos,
46 const wxSize& size,
47 const wxArrayString& choices,
48 long style = 0,
49 const wxValidator& validator = wxDefaultValidator,
50 const wxString& name = wxComboBoxNameStr)
51 {
52 Create(parent, winid, value, pos, size, choices, style,
53 validator, name);
54 }
55
56 bool Create(wxWindow *parent, wxWindowID winid,
57 const wxString& value = wxEmptyString,
58 const wxPoint& pos = wxDefaultPosition,
59 const wxSize& size = wxDefaultSize,
60 int n = 0, const wxString choices[] = NULL,
61 long style = 0,
62 const wxValidator& validator = wxDefaultValidator,
63 const wxString& name = wxComboBoxNameStr);
64 bool Create(wxWindow *parent, wxWindowID winid,
65 const wxString& value,
66 const wxPoint& pos,
67 const wxSize& size,
68 const wxArrayString& choices,
69 long style = 0,
70 const wxValidator& validator = wxDefaultValidator,
71 const wxString& name = wxComboBoxNameStr);
72 virtual ~wxComboBox();
73
74 // ------------------------------------------------------------------------
75 // Cocoa callbacks
76 // ------------------------------------------------------------------------
77 protected:
78 // ------------------------------------------------------------------------
79 // Implementation
80 // ------------------------------------------------------------------------
81 public:
82 // wxCombobox methods
83 virtual void SetSelection(int);
84 // Overlapping methods
85 virtual wxString GetStringSelection();
86 // other methods
87 virtual void SetStringSelection(const wxString& selection);
88 // wxItemContainer
89 virtual void Clear();
90 virtual void Delete(int);
91 virtual int GetCount() const;
92 virtual wxString GetString(int) const;
93 virtual void SetString(int, const wxString&);
94 virtual int FindString(const wxString&) const;
95 virtual void Select(int) {}
96 virtual int GetSelection() const;
97 virtual int DoAppend(const wxString&);
98 virtual int DoInsert(const wxString&, int);
99 virtual void DoSetItemClientData(int, void*);
100 virtual void* DoGetItemClientData(int) const;
101 virtual void DoSetItemClientObject(int, wxClientData*);
102 virtual wxClientData* DoGetItemClientObject(int) const;
103 // wxComboBoxBase pure virtuals
104 virtual wxString GetValue() const
105 { return wxTextCtrl::GetValue(); }
106 virtual void SetValue(const wxString& value)
107 { return wxTextCtrl::SetValue(value); }
108 virtual void Cut() { wxTextCtrl::Cut(); }
109 virtual void Copy() { wxTextCtrl::Copy(); }
110 virtual void Paste() { wxTextCtrl::Paste(); }
111 virtual void SetInsertionPoint(long pos)
112 { wxTextCtrl::SetInsertionPoint(pos); }
113 virtual void SetInsertionPointEnd()
114 { wxTextCtrl::SetInsertionPointEnd(); }
115 virtual long GetInsertionPoint() const
116 { return wxTextCtrl::GetInsertionPoint(); }
117 virtual long GetLastPosition() const
118 { return wxTextCtrl::GetLastPosition(); }
119 virtual void Replace(long from, long to, const wxString& value)
120 { wxTextCtrl::Replace(from,to,value); }
121 virtual void SetSelection(long from, long to)
122 { wxTextCtrl::SetSelection(from,to); }
123 virtual void SetEditable(bool editable)
124 { wxTextCtrl::SetEditable(editable); }
125 virtual bool IsEditable() const
126 { return !HasFlag(wxCB_READONLY); }
127 virtual void Undo()
128 { wxTextCtrl::Undo(); }
129 virtual void Redo()
130 { wxTextCtrl::Redo(); }
131 virtual void SelectAll()
132 { wxTextCtrl::SelectAll(); }
133 virtual bool CanCopy() const
134 { return wxTextCtrl::CanCopy(); }
135 virtual bool CanCut() const
136 { return wxTextCtrl::CanCut(); }
137 virtual bool CanPaste() const
138 { return wxTextCtrl::CanPaste(); }
139 virtual bool CanUndo() const
140 { return wxTextCtrl::CanUndo(); }
141 virtual bool CanRedo() const
142 { return wxTextCtrl::CanRedo(); }
143 };
144
145 #endif // __WX_COCOA_COMBOBOX_H__