/////////////////////////////////////////////////////////////////////////////
-// Name: combobox.cpp
+// Name: src/mac/carbon/combobox.cpp
// Purpose: wxComboBox class
// Author: Stefan Csomor
// Modified by:
#endif
}
-int wxComboBox::DoInsert(const wxString& item, int pos)
+int wxComboBox::DoInsert(const wxString& item, unsigned int pos)
{
#if USE_HICOMBOBOX
HIComboBoxInsertTextItemAtIndex( *m_peer, (CFIndex)pos, wxMacCFStringHolder(item, m_font.GetEncoding()) );
#endif
}
-void wxComboBox::DoSetItemClientData(int n, void* clientData)
+void wxComboBox::DoSetItemClientData(unsigned int n, void* clientData)
{
#if USE_HICOMBOBOX
return; //TODO
#endif
}
-void* wxComboBox::DoGetItemClientData(int n) const
+void* wxComboBox::DoGetItemClientData(unsigned int n) const
{
#if USE_HICOMBOBOX
return NULL; //TODO
#endif
}
-void wxComboBox::DoSetItemClientObject(int n, wxClientData* clientData)
+void wxComboBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
{
#if USE_HICOMBOBOX
return; //TODO
#endif
}
-wxClientData* wxComboBox::DoGetItemClientObject(int n) const
+wxClientData* wxComboBox::DoGetItemClientObject(unsigned int n) const
{
#if USE_HICOMBOBOX
return NULL;
void wxComboBox::FreeData()
{
- if ( HasClientObjectData() )
+ if (HasClientObjectData())
{
- size_t count = GetCount();
- for ( size_t n = 0; n < count; n++ )
+ unsigned int count = GetCount();
+ for ( unsigned int n = 0; n < count; n++ )
{
SetClientObject( n, NULL );
}
}
}
-int wxComboBox::GetCount() const {
+unsigned int wxComboBox::GetCount() const {
#if USE_HICOMBOBOX
- return (int) HIComboBoxGetItemCount( *m_peer );
+ return (unsigned int) HIComboBoxGetItemCount( *m_peer );
#else
return m_choice->GetCount() ;
#endif
}
-void wxComboBox::Delete(int n)
+void wxComboBox::Delete(unsigned int n)
{
#if USE_HICOMBOBOX
HIComboBoxRemoveItemAtIndex( *m_peer, (CFIndex)n );
if ( m_text != NULL )
{
- m_text->SetValue( GetString( n ) );
+ m_text->SetValue(GetString(n));
}
#endif
}
-int wxComboBox::FindString(const wxString& s) const
+int wxComboBox::FindString(const wxString& s, bool bCase) const
{
#if USE_HICOMBOBOX
- for( int i = 0 ; i < GetCount() ; i++ )
+ for( unsigned int i = 0 ; i < GetCount() ; i++ )
{
- if ( GetString( i ).IsSameAs(s, false) )
+ if (GetString(i).IsSameAs(s, bCase) )
return i ;
}
return wxNOT_FOUND ;
#else
- return m_choice->FindString( s );
+ return m_choice->FindString( s, bCase );
#endif
}
-wxString wxComboBox::GetString(int n) const
+wxString wxComboBox::GetString(unsigned int n) const
{
#if USE_HICOMBOBOX
CFStringRef itemText;
return wxMacCFStringHolder(m_peer->GetData<CFStringRef>(kHIComboBoxEditTextPart,kControlEditTextCFStringTag)).AsString() ;
#else
int sel = GetSelection ();
- if (sel > -1)
- return wxString(this->GetString (sel));
+ if (sel != wxNOT_FOUND)
+ return wxString(this->GetString((unsigned int)sel));
else
return wxEmptyString;
#endif
}
-void wxComboBox::SetString(int n, const wxString& s)
+void wxComboBox::SetString(unsigned int n, const wxString& s)
{
#if USE_HICOMBOBOX
verify_noerr ( HIComboBoxInsertTextItemAtIndex( *m_peer, (CFIndex) n,