replaced all int/size_t indices in wxControlWithItems API with unsigned int (committing on behalf of ABX)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38319 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-03-23 22:05:23 +00:00
parent 5aa67d6619
commit aa61d35253
112 changed files with 1367 additions and 1414 deletions

View File

@@ -236,7 +236,7 @@ int wxChoice::DoAppend(const wxString& item)
return n;
}
int wxChoice::DoInsert(const wxString& item, int pos)
int wxChoice::DoInsert(const wxString& item, unsigned int pos)
{
wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list"));
wxCHECK_MSG(IsValidInsert(pos), -1, wxT("invalid index"));
@@ -256,7 +256,7 @@ int wxChoice::DoInsert(const wxString& item, int pos)
return n;
}
void wxChoice::Delete(int n)
void wxChoice::Delete(unsigned int n)
{
wxCHECK_RET( IsValid(n), wxT("invalid item index in wxChoice::Delete") );
@@ -289,8 +289,8 @@ void wxChoice::Free()
{
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++ )
{
delete GetClientObject(n);
}
@@ -326,9 +326,9 @@ void wxChoice::SetSelection(int n)
// string list functions
// ----------------------------------------------------------------------------
size_t wxChoice::GetCount() const
unsigned int wxChoice::GetCount() const
{
return (size_t)SendMessage(GetHwnd(), CB_GETCOUNT, 0, 0);
return (unsigned int)SendMessage(GetHwnd(), CB_GETCOUNT, 0, 0);
}
int wxChoice::FindString(const wxString& s, bool bCase) const
@@ -336,11 +336,11 @@ int wxChoice::FindString(const wxString& s, bool bCase) const
#if defined(__WATCOMC__) && defined(__WIN386__)
// For some reason, Watcom in WIN386 mode crashes in the CB_FINDSTRINGEXACT message.
// wxChoice::Do it the long way instead.
size_t count = GetCount();
for ( size_t i = 0; i < count; i++ )
unsigned int count = GetCount();
for ( unsigned int i = 0; i < count; i++ )
{
// as CB_FINDSTRINGEXACT is case insensitive, be case insensitive too
if ( GetString(i).IsSameAs(s, bCase) )
if (GetString(i).IsSameAs(s, bCase))
return i;
}
@@ -350,10 +350,10 @@ int wxChoice::FindString(const wxString& s, bool bCase) const
//passed to SendMessage, so we have to do it ourselves in that case
if ( s.empty() )
{
size_t count = GetCount();
for ( size_t i = 0; i < count; i++ )
unsigned int count = GetCount();
for ( unsigned int i = 0; i < count; i++ )
{
if ( GetString(i).empty() )
if (GetString(i).empty())
return i;
}
@@ -374,7 +374,7 @@ int wxChoice::FindString(const wxString& s, bool bCase) const
#endif // Watcom/!Watcom
}
void wxChoice::SetString(int n, const wxString& s)
void wxChoice::SetString(unsigned int n, const wxString& s)
{
wxCHECK_RET( IsValid(n), wxT("invalid item index in wxChoice::SetString") );
@@ -404,7 +404,7 @@ void wxChoice::SetString(int n, const wxString& s)
InvalidateBestSize();
}
wxString wxChoice::GetString(int n) const
wxString wxChoice::GetString(unsigned int n) const
{
int len = (int)::SendMessage(GetHwnd(), CB_GETLBTEXTLEN, n, 0);
@@ -430,7 +430,7 @@ wxString wxChoice::GetString(int n) const
// client data
// ----------------------------------------------------------------------------
void wxChoice::DoSetItemClientData( int n, void* clientData )
void wxChoice::DoSetItemClientData(unsigned int n, void* clientData)
{
if ( ::SendMessage(GetHwnd(), CB_SETITEMDATA,
n, (LPARAM)clientData) == CB_ERR )
@@ -439,7 +439,7 @@ void wxChoice::DoSetItemClientData( int n, void* clientData )
}
}
void* wxChoice::DoGetItemClientData( int n ) const
void* wxChoice::DoGetItemClientData(unsigned int n) const
{
LPARAM rc = SendMessage(GetHwnd(), CB_GETITEMDATA, n, 0);
if ( rc == CB_ERR )
@@ -453,12 +453,12 @@ void* wxChoice::DoGetItemClientData( int n ) const
return (void *)rc;
}
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
void wxChoice::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
{
DoSetItemClientData(n, clientData);
}
wxClientData* wxChoice::DoGetItemClientObject( int n ) const
wxClientData* wxChoice::DoGetItemClientObject(unsigned int n) const
{
return (wxClientData *)DoGetItemClientData(n);
}
@@ -516,7 +516,7 @@ void wxChoice::DoSetSize(int x, int y,
{
// don't make the drop down list too tall, arbitrarily limit it to 40
// items max and also don't leave it empty
size_t nItems = GetCount();
unsigned int nItems = GetCount();
if ( !nItems )
nItems = 9;
else if ( nItems > 24 )
@@ -595,8 +595,8 @@ wxSize wxChoice::DoGetBestSize() const
{
// find the widest string
int wChoice = 0;
const size_t nItems = GetCount();
for ( size_t i = 0; i < nItems; i++ )
const unsigned int nItems = GetCount();
for ( unsigned int i = 0; i < nItems; i++ )
{
int wLine;
GetTextExtent(GetString(i), &wLine, NULL);