1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/combobox_osx.cpp
3 // Purpose: wxComboBox class using HIView ComboBox
4 // Author: Stefan Csomor
7 // RCS-ID: $Id: combobox_osx.cpp 58318 2009-01-23 08:36:16Z RR $
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
14 #if wxUSE_COMBOBOX && defined(wxOSX_USE_NATIVE_COMBOBOX)
16 #include "wx/combobox.h"
17 #include "wx/osx/private.h"
24 IMPLEMENT_DYNAMIC_CLASS(wxComboBox
, wxControl
)
26 wxComboBox::~wxComboBox()
30 void wxComboBox::Init()
34 bool wxComboBox::Create(wxWindow
*parent
, wxWindowID id
,
35 const wxString
& value
,
38 const wxArrayString
& choices
,
40 const wxValidator
& validator
,
43 wxCArrayString
chs( choices
);
45 return Create( parent
, id
, value
, pos
, size
, chs
.GetCount(),
46 chs
.GetStrings(), style
, validator
, name
);
49 bool wxComboBox::Create(wxWindow
*parent
, wxWindowID id
,
50 const wxString
& value
,
53 int n
, const wxString choices
[],
55 const wxValidator
& validator
,
61 m_macIsUserPane
= false;
63 if ( !wxControl::Create( parent
, id
, pos
, size
, style
, validator
, name
) )
66 m_peer
= wxWidgetImpl::CreateComboBox( this, parent
, id
, NULL
, pos
, size
, style
, GetExtraStyle() );
68 MacPostControlCreate( pos
, size
);
72 // Set the first item as being selected
76 // Needed because it is a wxControlWithItems
77 SetInitialSize( size
);
82 void wxComboBox::DelegateTextChanged( const wxString
& value
)
84 SetStringSelection( value
);
87 void wxComboBox::DelegateChoice( const wxString
& value
)
89 SetStringSelection( value
);
92 wxString
wxComboBox::GetValue() const
94 wxFAIL_MSG("Method Not Implemented.");
98 void wxComboBox::SetValue(const wxString
& value
)
100 wxFAIL_MSG("Method Not Implemented.");
103 // Clipboard operations
104 void wxComboBox::Copy()
106 wxFAIL_MSG("Method Not Implemented.");
109 void wxComboBox::Cut()
111 wxFAIL_MSG("Method Not Implemented.");
114 void wxComboBox::Paste()
116 wxFAIL_MSG("Method Not Implemented.");
119 void wxComboBox::SetEditable(bool editable
)
121 wxFAIL_MSG("Method Not Implemented.");
124 void wxComboBox::SetInsertionPoint(long pos
)
126 wxFAIL_MSG("Method Not Implemented.");
129 void wxComboBox::SetInsertionPointEnd()
131 wxFAIL_MSG("Method Not Implemented.");
134 long wxComboBox::GetInsertionPoint() const
136 wxFAIL_MSG("Method Not Implemented.");
140 wxTextPos
wxComboBox::GetLastPosition() const
142 wxFAIL_MSG("Method Not Implemented.");
146 void wxComboBox::Replace(long from
, long to
, const wxString
& value
)
148 wxFAIL_MSG("Method Not Implemented.");
151 void wxComboBox::Remove(long from
, long to
)
153 wxFAIL_MSG("Method Not Implemented.");
156 void wxComboBox::SetSelection(long from
, long to
)
158 wxFAIL_MSG("Method Not Implemented.");
161 int wxComboBox::DoInsertItems(const wxArrayStringsAdapter
& items
,
163 void **clientData
, wxClientDataType type
)
165 wxFAIL_MSG("Method Not Implemented.");
169 void wxComboBox::DoSetItemClientData(unsigned int n
, void* clientData
)
171 wxFAIL_MSG("Method Not Implemented.");
174 void* wxComboBox::DoGetItemClientData(unsigned int n
) const
176 wxFAIL_MSG("Method Not Implemented.");
180 unsigned int wxComboBox::GetCount() const
182 wxFAIL_MSG("Method Not Implemented.");
186 void wxComboBox::DoDeleteOneItem(unsigned int n
)
188 wxFAIL_MSG("Method Not Implemented.");
191 void wxComboBox::DoClear()
193 wxFAIL_MSG("Method Not Implemented.");
196 int wxComboBox::GetSelection() const
198 wxFAIL_MSG("Method Not Implemented.");
202 void wxComboBox::GetSelection(long *from
, long *to
) const
204 wxFAIL_MSG("Method Not Implemented.");
207 void wxComboBox::SetSelection(int n
)
209 wxFAIL_MSG("Method Not Implemented.");
212 int wxComboBox::FindString(const wxString
& s
, bool bCase
) const
214 wxFAIL_MSG("Method Not Implemented.");
218 wxString
wxComboBox::GetString(unsigned int n
) const
220 wxFAIL_MSG("Method Not Implemented.");
221 return wxEmptyString
;
224 wxString
wxComboBox::GetStringSelection() const
226 wxFAIL_MSG("Method Not Implemented.");
227 return wxEmptyString
;
230 void wxComboBox::SetString(unsigned int n
, const wxString
& s
)
232 wxFAIL_MSG("Method Not Implemented.");
235 bool wxComboBox::IsEditable() const
237 return !HasFlag(wxCB_READONLY
);
240 void wxComboBox::Undo()
242 wxFAIL_MSG("Method Not Implemented.");
245 void wxComboBox::Redo()
247 wxFAIL_MSG("Method Not Implemented.");
250 void wxComboBox::SelectAll()
252 wxFAIL_MSG("Method Not Implemented.");
255 bool wxComboBox::CanCopy() const
257 wxFAIL_MSG("Method Not Implemented.");
261 bool wxComboBox::CanCut() const
263 wxFAIL_MSG("Method Not Implemented.");
267 bool wxComboBox::CanPaste() const
269 wxFAIL_MSG("Method Not Implemented.");
273 bool wxComboBox::CanUndo() const
275 wxFAIL_MSG("Method Not Implemented.");
279 bool wxComboBox::CanRedo() const
281 wxFAIL_MSG("Method Not Implemented.");
285 void wxComboBox::EnableTextChangedEvents(bool enable
)
287 wxFAIL_MSG("Method Not Implemented.");
290 void wxComboBox::WriteText(const wxString
& text
)
292 wxFAIL_MSG("Method Not Implemented.");
295 wxString
wxComboBox::DoGetValue() const
297 wxFAIL_MSG("Method Not Implemented.");
298 return wxEmptyString
;
301 wxClientDataType
wxComboBox::GetClientDataType() const
303 wxFAIL_MSG("Method Not Implemented.");
304 return wxClientData_None
;
307 void wxComboBox::SetClientDataType(wxClientDataType clientDataItemsType
)
309 wxFAIL_MSG("Method Not Implemented.");
312 bool wxComboBox::OSXHandleClicked( double timestampsec
)
314 wxCommandEvent
event(wxEVT_COMMAND_COMBOBOX_SELECTED
, m_windowId
);
315 event
.SetInt(GetSelection());
316 event
.SetEventObject(this);
317 event
.SetString(GetStringSelection());
318 ProcessCommand(event
);
322 #endif // wxUSE_COMBOBOX && defined(wxOSX_USE_NATIVE_COMBOBOX)