BEGIN_EVENT_TABLE(wxListBox, wxControl)
#ifndef __WXMAC_OSX__
- EVT_SIZE( wxListBox::OnSize )
+// EVT_SIZE( wxListBox::OnSize )
EVT_CHAR( wxListBox::OnChar )
#endif
END_EVENT_TABLE()
void wxListBox::SetSelection(int N, bool select)
{
- if ( N == wxNOT_FOUND )
- {
- // unselect everything
- int sel = MacGetSelection() ;
- if ( sel != wxNOT_FOUND )
- {
- UInt32 id = sel + 1 ;
- verify_noerr(
- m_peer->SetSelectedItems( 1 , & id , kDataBrowserItemsRemove )
- );
- }
-
- return;
- }
-
- wxCHECK_RET( N >= 0 && N < m_noItems,
+ wxCHECK_RET( N == wxNOT_FOUND || (N >= 0 && N < m_noItems) ,
wxT("invalid index in wxListBox::SetSelection") );
if ( N == wxNOT_FOUND )
UInt32 id = m_noItems+1 ;
verify_noerr( m_peer->RemoveItems( kDataBrowserNoItem , 1 , (UInt32*) &id , kDataBrowserItemNoProperty ) ) ;
- for ( int i = 0 ; i < selectionBefore.GetCount() ; ++i )
+ for ( size_t i = 0 ; i < selectionBefore.GetCount() ; ++i )
{
int current = selectionBefore[i] ;
if ( current == n )
m_peer->GetSelectionAnchor( &first , &last ) ;
if ( first != kDataBrowserNoItem )
{
- for ( int i = first ; i <= last ; ++i )
+ for ( size_t i = first ; i <= last ; ++i )
{
if ( m_peer->IsItemSelected( i ) )
{
n = -1;
}
- event.m_commandInt = n;
+ event.SetInt(n);
GetEventHandler()->ProcessEvent(event);
}
event.SetClientData( GetClientData(line) );
event.SetString( GetString(line) );
- event.m_commandInt = line ;
+ event.SetInt(line);
GetEventHandler()->ProcessEvent(event);
}