#include "wx/wxprec.h"
#ifdef __BORLANDC__
-#pragma hdrstop
+ #pragma hdrstop
#endif
#if wxUSE_CHECKLISTBOX
-#ifndef WX_PRECOMP
-#endif
-
#include "wx/checklst.h"
-// include <commctrl.h> "properly"
-#include "wx/msw/wrapcctl.h"
+#ifndef WX_PRECOMP
+ #include "wx/msw/wrapcctl.h" // include <commctrl.h> "properly"
+#endif
// ============================================================================
// implementation
m_itemsClientData.SetCount(n);
// now we can compute our best size correctly, so do it if necessary
- SetBestSize(size);
+ SetInitialSize(size);
return true;
}
// misc overloaded methods
// -----------------------
-void wxCheckListBox::Delete(int n)
+void wxCheckListBox::Delete(unsigned int n)
{
wxCHECK_RET( IsValid( n ), _T("invalid index in wxCheckListBox::Delete") );
// check items
// -----------
-bool wxCheckListBox::IsChecked(size_t uiIndex) const
+bool wxCheckListBox::IsChecked(unsigned int uiIndex) const
{
wxCHECK_MSG( IsValid( uiIndex ), false,
_T("invalid index in wxCheckListBox::IsChecked") );
return (ListView_GetCheckState(((HWND)GetHWND()), uiIndex) != 0);
}
-void wxCheckListBox::Check(size_t uiIndex, bool bCheck)
+void wxCheckListBox::Check(unsigned int uiIndex, bool bCheck)
{
wxCHECK_RET( IsValid( uiIndex ),
_T("invalid index in wxCheckListBox::Check") );
void wxCheckListBox::Clear()
{
- int n = (int)GetCount();
+ unsigned int n = GetCount();
while ( n > 0 )
{
_T("broken wxCheckListBox::Clear()") );
}
-size_t wxCheckListBox::GetCount() const
+unsigned int wxCheckListBox::GetCount() const
{
- return (size_t)ListView_GetItemCount( (HWND)GetHWND() );
+ return (unsigned int)ListView_GetItemCount( (HWND)GetHWND() );
}
int wxCheckListBox::GetSelection() const
{
int i;
- for (i = 0; (size_t)i < GetCount(); i++)
+ for (i = 0; (unsigned int)i < GetCount(); i++)
{
int selState = ListView_GetItemState(GetHwnd(), i, LVIS_SELECTED);
if (selState == LVIS_SELECTED)
int wxCheckListBox::GetSelections(wxArrayInt& aSelections) const
{
int i;
- for (i = 0; (size_t)i < GetCount(); i++)
+ for (i = 0; (unsigned int)i < GetCount(); i++)
{
int selState = ListView_GetItemState(GetHwnd(), i, LVIS_SELECTED);
if (selState == LVIS_SELECTED)
return aSelections.GetCount();
}
-wxString wxCheckListBox::GetString(int n) const
+wxString wxCheckListBox::GetString(unsigned int n) const
{
const int bufSize = 513;
wxChar buf[bufSize];
return (selState == LVIS_SELECTED);
}
-void wxCheckListBox::SetString(int n, const wxString& s)
+void wxCheckListBox::SetString(unsigned int n, const wxString& s)
{
wxCHECK_RET( IsValid( n ),
_T("invalid index in wxCheckListBox::SetString") );
return ret;
}
-void* wxCheckListBox::DoGetItemClientData(int n) const
+void* wxCheckListBox::DoGetItemClientData(unsigned int n) const
{
return m_itemsClientData.Item(n);
}
-wxClientData* wxCheckListBox::DoGetItemClientObject(int n) const
+wxClientData* wxCheckListBox::DoGetItemClientObject(unsigned int n) const
{
return (wxClientData *)DoGetItemClientData(n);
}
-void wxCheckListBox::DoInsertItems(const wxArrayString& items, int pos)
+void wxCheckListBox::DoInsertItems(const wxArrayString& items, unsigned int pos)
{
wxCHECK_RET( IsValidInsert( pos ),
wxT("invalid index in wxListBox::InsertItems") );
- for( size_t i = 0; i < items.GetCount(); i++ )
+ for( unsigned int i = 0; i < items.GetCount(); i++ )
{
LVITEM newItem;
wxZeroMemory(newItem);
ListView_Scroll( (HWND)GetHWND(), 0, ppt.y );
}
-void wxCheckListBox::DoSetItemClientData(int n, void* clientData)
+void wxCheckListBox::DoSetItemClientData(unsigned int n, void* clientData)
{
m_itemsClientData.Item(n) = clientData;
}
-void wxCheckListBox::DoSetItemClientObject(int n, wxClientData* clientData)
+void wxCheckListBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
{
DoSetItemClientData(n, clientData);
}
{
ListView_SetItemCount( GetHwnd(), GetCount() + items.GetCount() );
- for( size_t i = 0; i < items.GetCount(); i++ )
+ for( unsigned int i = 0; i < items.GetCount(); i++ )
{
int pos = Append(items[i]);
if( pos >= 0 && clientData )