X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8228b8932abaedadbf9568bb3a1eef3ae25fb2a3..ec5006bdc630dd6b3d4cad1a3b572ab4c695a029:/src/gtk1/combobox.cpp?ds=sidebyside diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp index aa879cab6f..3e519a1bc0 100644 --- a/src/gtk1/combobox.cpp +++ b/src/gtk1/combobox.cpp @@ -14,11 +14,12 @@ #include "wx/combobox.h" -#include "wx/settings.h" -#include "wx/arrstr.h" -#include "wx/intl.h" - -#include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED +#ifndef WX_PRECOMP + #include "wx/intl.h" + #include "wx/settings.h" + #include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED + #include "wx/arrstr.h" +#endif #include "wx/gtk1/private.h" @@ -282,7 +283,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, gtk_signal_connect_after( GTK_OBJECT(combo->list), "select-child", GTK_SIGNAL_FUNC(gtk_combo_select_child_callback), (gpointer)this ); - SetBestSize(size); // need this too because this is a wxControlWithItems + SetInitialSize(size); // need this too because this is a wxControlWithItems // This is required for tool bar support // wxSize setsize = GetSize(); @@ -347,7 +348,7 @@ int wxComboBox::DoAppend( const wxString &item ) gtk_widget_show( list_item ); - const size_t count = GetCount(); + const unsigned int count = GetCount(); if ( m_clientDataList.GetCount() < count ) m_clientDataList.Append( (wxObject*) NULL ); @@ -361,7 +362,7 @@ int wxComboBox::DoAppend( const wxString &item ) return count - 1; } -int wxComboBox::DoInsert( const wxString &item, int pos ) +int wxComboBox::DoInsert( const wxString &item, unsigned int pos ) { wxCHECK_MSG( !(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list")); @@ -370,7 +371,7 @@ int wxComboBox::DoInsert( const wxString &item, int pos ) wxCHECK_MSG( IsValidInsert(pos), -1, wxT("invalid index") ); - if ((size_t)pos == GetCount()) + if (pos == GetCount()) return Append(item); DisableEvents(); @@ -393,7 +394,7 @@ int wxComboBox::DoInsert( const wxString &item, int pos ) gtk_widget_show( list_item ); - const size_t count = GetCount(); + const unsigned int count = GetCount(); if ( m_clientDataList.GetCount() < count ) m_clientDataList.Insert( pos, (wxObject*) NULL ); @@ -407,7 +408,7 @@ int wxComboBox::DoInsert( const wxString &item, int pos ) return pos; } -void wxComboBox::DoSetItemClientData( int n, void* clientData ) +void wxComboBox::DoSetItemClientData(unsigned int n, void* clientData) { wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); @@ -417,7 +418,7 @@ void wxComboBox::DoSetItemClientData( int n, void* clientData ) node->SetData( (wxObject*) clientData ); } -void* wxComboBox::DoGetItemClientData( int n ) const +void* wxComboBox::DoGetItemClientData(unsigned int n) const { wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid combobox") ); @@ -426,7 +427,7 @@ void* wxComboBox::DoGetItemClientData( int n ) const return node ? node->GetData() : NULL; } -void wxComboBox::DoSetItemClientObject( int n, wxClientData* clientData ) +void wxComboBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData) { wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); @@ -438,7 +439,7 @@ void wxComboBox::DoSetItemClientObject( int n, wxClientData* clientData ) node->SetData( (wxObject*) clientData ); } -wxClientData* wxComboBox::DoGetItemClientObject( int n ) const +wxClientData* wxComboBox::DoGetItemClientObject(unsigned int n) const { wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, wxT("invalid combobox") ); @@ -472,7 +473,7 @@ void wxComboBox::Clear() InvalidateBestSize(); } -void wxComboBox::Delete( int n ) +void wxComboBox::Delete(unsigned int n) { wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); @@ -509,7 +510,7 @@ void wxComboBox::Delete( int n ) InvalidateBestSize(); } -void wxComboBox::SetString(int n, const wxString &text) +void wxComboBox::SetString(unsigned int n, const wxString &text) { wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); @@ -583,7 +584,7 @@ int wxComboBox::GetCurrentSelection() const return wxNOT_FOUND; } -wxString wxComboBox::GetString( int n ) const +wxString wxComboBox::GetString(unsigned int n) const { wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid combobox") ); @@ -625,14 +626,14 @@ wxString wxComboBox::GetStringSelection() const return wxEmptyString; } -size_t wxComboBox::GetCount() const +unsigned int wxComboBox::GetCount() const { wxCHECK_MSG( m_widget != NULL, 0, wxT("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; GList *child = GTK_LIST(list)->children; - size_t count = 0; + unsigned int count = 0; while (child) { count++; child = child->next; } return count; } @@ -929,10 +930,10 @@ wxSize wxComboBox::DoGetBestSize() const if ( m_widget ) { int width; - size_t count = GetCount(); - for ( size_t n = 0; n < count; n++ ) + unsigned int count = GetCount(); + for ( unsigned int n = 0; n < count; n++ ) { - GetTextExtent( GetString(n), &width, NULL, NULL, NULL ); + GetTextExtent(GetString(n), &width, NULL, NULL, NULL ); if ( width > ret.x ) ret.x = width; }