X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/11e62fe658531aaa2891351f19bd0a4c076717ae..1a1f3e4b53fd5d1515b16905edf4250dfb2fc676:/src/cocoa/combobox.mm diff --git a/src/cocoa/combobox.mm b/src/cocoa/combobox.mm index 0e19e3d340..4e016fb200 100644 --- a/src/cocoa/combobox.mm +++ b/src/cocoa/combobox.mm @@ -75,15 +75,17 @@ // ---------------------------------------------------------------------------- #include "wx/wxprec.h" + #if wxUSE_COMBOBOX +#include "wx/combobox.h" + #ifndef WX_PRECOMP #include "wx/window.h" + #include "wx/log.h" + #include "wx/app.h" #endif // WX_PRECOMP -#include "wx/cocoa/ObjcPose.h" -#include "wx/combobox.h" - #import #import #import @@ -157,10 +159,6 @@ void wxCocoaNSComboBox::DisassociateNSComboBox(WX_NSComboBox cocoaNSComboBox) @end // implementation wxPoserNSComboBox -#include "wx/app.h" -#include "wx/combobox.h" -#include "wx/log.h" - #include "wx/cocoa/autorelease.h" #include "wx/cocoa/string.h" @@ -254,23 +252,23 @@ void wxComboBox::Clear() m_Datas.Clear(); } -void wxComboBox::Delete(int nIndex) +void wxComboBox::Delete(unsigned int n) { - [GetNSComboBox() removeItemAtIndex:nIndex]; - m_Datas.RemoveAt(nIndex); + [GetNSComboBox() removeItemAtIndex:n]; + m_Datas.RemoveAt(n); } -int wxComboBox::GetCount() const +unsigned int wxComboBox::GetCount() const { - return [GetNSComboBox() numberOfItems]; + return (unsigned int)[GetNSComboBox() numberOfItems]; } -wxString wxComboBox::GetString(int nIndex) const +wxString wxComboBox::GetString(unsigned int nIndex) const { return wxStringWithNSString([GetNSComboBox() itemObjectValueAtIndex:nIndex]); } -void wxComboBox::SetString(int nIndex, const wxString& szString) +void wxComboBox::SetString(unsigned int nIndex, const wxString& szString) { wxAutoNSAutoreleasePool pool; //FIXME: There appears to be no "set item data" method - maybe @@ -298,30 +296,30 @@ int wxComboBox::DoAppend(const wxString& szItem) return [GetNSComboBox() numberOfItems]; } -int wxComboBox::DoInsert(const wxString& szItem, int nIndex) +int wxComboBox::DoInsert(const wxString& szItem, unsigned int nIndex) { m_Datas.Insert(NULL, nIndex); wxAutoNSAutoreleasePool pool; [GetNSComboBox() insertItemWithObjectValue:wxNSStringWithWxString(szItem) atIndex:nIndex]; - return nIndex; + return (int)nIndex; } -void wxComboBox::DoSetItemClientData(int nIndex, void* pData) +void wxComboBox::DoSetItemClientData(unsigned int nIndex, void* pData) { m_Datas[nIndex] = pData; } -void* wxComboBox::DoGetItemClientData(int nIndex) const +void* wxComboBox::DoGetItemClientData(unsigned int nIndex) const { return m_Datas[nIndex]; } -void wxComboBox::DoSetItemClientObject(int nIndex, wxClientData* pClientData) +void wxComboBox::DoSetItemClientObject(unsigned int nIndex, wxClientData* pClientData) { m_Datas[nIndex] = (void*) pClientData; } -wxClientData* wxComboBox::DoGetItemClientObject(int nIndex) const +wxClientData* wxComboBox::DoGetItemClientObject(unsigned int nIndex) const { return (wxClientData*) m_Datas[nIndex]; }