]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/combobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/combobox.h
3 // Purpose: wxComboBox class
4 // Author: David Elliott
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __WX_COCOA_COMBOBOX_H__
13 #define __WX_COCOA_COMBOBOX_H__
15 //#include "wx/cocoa/NSTableView.h"
17 // ========================================================================
19 // ========================================================================
20 class WXDLLEXPORT wxComboBox
: public wxTextCtrl
, public wxComboBoxBase
//, protected wxCocoaNSTableView
22 DECLARE_DYNAMIC_CLASS(wxComboBox
)
24 // WX_DECLARE_COCOA_OWNER(NSComboBox,NSTextField,NSView)
25 // ------------------------------------------------------------------------
27 // ------------------------------------------------------------------------
30 wxComboBox(wxWindow
*parent
, wxWindowID winid
,
31 const wxString
& value
= wxEmptyString
,
32 const wxPoint
& pos
= wxDefaultPosition
,
33 const wxSize
& size
= wxDefaultSize
,
34 int n
= 0, const wxString choices
[] = NULL
,
36 const wxValidator
& validator
= wxDefaultValidator
,
37 const wxString
& name
= wxComboBoxNameStr
)
39 Create(parent
, winid
, value
, pos
, size
, n
, choices
, style
, validator
, name
);
41 wxComboBox(wxWindow
*parent
, wxWindowID winid
,
42 const wxString
& value
,
45 const wxArrayString
& choices
,
47 const wxValidator
& validator
= wxDefaultValidator
,
48 const wxString
& name
= wxComboBoxNameStr
)
50 Create(parent
, winid
, value
, pos
, size
, choices
, style
,
54 bool Create(wxWindow
*parent
, wxWindowID winid
,
55 const wxString
& value
= wxEmptyString
,
56 const wxPoint
& pos
= wxDefaultPosition
,
57 const wxSize
& size
= wxDefaultSize
,
58 int n
= 0, const wxString choices
[] = NULL
,
60 const wxValidator
& validator
= wxDefaultValidator
,
61 const wxString
& name
= wxComboBoxNameStr
);
62 bool Create(wxWindow
*parent
, wxWindowID winid
,
63 const wxString
& value
,
66 const wxArrayString
& choices
,
68 const wxValidator
& validator
= wxDefaultValidator
,
69 const wxString
& name
= wxComboBoxNameStr
);
70 virtual ~wxComboBox();
72 // ------------------------------------------------------------------------
74 // ------------------------------------------------------------------------
76 // ------------------------------------------------------------------------
78 // ------------------------------------------------------------------------
81 virtual void SetSelection(int);
82 // Overlapping methods
83 virtual wxString
GetStringSelection();
85 virtual void SetStringSelection(const wxString
& selection
);
88 virtual void Delete(int);
89 virtual int GetCount() const;
90 virtual wxString
GetString(int) const;
91 virtual void SetString(int, const wxString
&);
92 virtual int FindString(const wxString
&) const;
93 virtual void Select(int) {}
94 virtual int GetSelection() const;
95 virtual int DoAppend(const wxString
&);
96 virtual int DoInsert(const wxString
&, int);
97 virtual void DoSetItemClientData(int, void*);
98 virtual void* DoGetItemClientData(int) const;
99 virtual void DoSetItemClientObject(int, wxClientData
*);
100 virtual wxClientData
* DoGetItemClientObject(int) const;
101 // wxComboBoxBase pure virtuals
102 virtual wxString
GetValue() const
103 { return wxTextCtrl::GetValue(); }
104 virtual void SetValue(const wxString
& value
)
105 { return wxTextCtrl::SetValue(value
); }
106 virtual void Cut() { wxTextCtrl::Cut(); }
107 virtual void Copy() { wxTextCtrl::Copy(); }
108 virtual void Paste() { wxTextCtrl::Paste(); }
109 virtual void SetInsertionPoint(long pos
)
110 { wxTextCtrl::SetInsertionPoint(pos
); }
111 virtual void SetInsertionPointEnd()
112 { wxTextCtrl::SetInsertionPointEnd(); }
113 virtual long GetInsertionPoint() const
114 { return wxTextCtrl::GetInsertionPoint(); }
115 virtual wxTextPos
GetLastPosition() const
116 { return wxTextCtrl::GetLastPosition(); }
117 virtual void Replace(long from
, long to
, const wxString
& value
)
118 { wxTextCtrl::Replace(from
,to
,value
); }
119 virtual void SetSelection(long from
, long to
)
120 { wxTextCtrl::SetSelection(from
,to
); }
121 virtual void SetEditable(bool editable
)
122 { wxTextCtrl::SetEditable(editable
); }
123 virtual bool IsEditable() const
124 { return !HasFlag(wxCB_READONLY
); }
126 { wxTextCtrl::Undo(); }
128 { wxTextCtrl::Redo(); }
129 virtual void SelectAll()
130 { wxTextCtrl::SelectAll(); }
131 virtual bool CanCopy() const
132 { return wxTextCtrl::CanCopy(); }
133 virtual bool CanCut() const
134 { return wxTextCtrl::CanCut(); }
135 virtual bool CanPaste() const
136 { return wxTextCtrl::CanPaste(); }
137 virtual bool CanUndo() const
138 { return wxTextCtrl::CanUndo(); }
139 virtual bool CanRedo() const
140 { return wxTextCtrl::CanRedo(); }
143 #endif // __WX_COCOA_COMBOBOX_H__