// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
if ( !wxControl::Create( parent, id, pos, size, style, validator, name ) )
return false;
wxASSERT_MSG( !(style & wxCB_SORT),
"wxCB_SORT not currently supported by wxOSX/Cocoa");
if ( !wxControl::Create( parent, id, pos, size, style, validator, name ) )
return false;
wxASSERT_MSG( !(style & wxCB_SORT),
"wxCB_SORT not currently supported by wxOSX/Cocoa");
- m_peer = wxWidgetImpl::CreateComboBox( this, parent, id, NULL, pos, size, style, GetExtraStyle() );
+ SetPeer(wxWidgetImpl::CreateComboBox( this, parent, id, NULL, pos, size, style, GetExtraStyle() ));
AssignNewItemClientData(idx, clientData, i, type);
}
AssignNewItemClientData(idx, clientData, i, type);
}
// ----------------------------------------------------------------------------
void wxComboBox::DoSetItemClientData(unsigned int n, void* clientData)
{
// ----------------------------------------------------------------------------
void wxComboBox::DoSetItemClientData(unsigned int n, void* clientData)
{
- Delete(n);
- Insert(s, n);
+ // Notice that we shouldn't delete and insert the item in this control
+ // itself as this would also affect the client data which we need to
+ // preserve here.
+ GetComboPeer()->RemoveItem(n);
+ GetComboPeer()->InsertItem(n, s);
- return dynamic_cast<wxComboWidgetImpl*> (m_peer);
+ return dynamic_cast<wxComboWidgetImpl*> (GetPeer());
+}
+
+void wxComboBox::Popup()
+{
+ GetComboPeer()->Popup();
+}
+
+void wxComboBox::Dismiss()
+{
+ GetComboPeer()->Dismiss();