UMAGetControlData( m_macControl , kControlNoPart , kControlListBoxListHandleTag , sizeof( ListHandle ) , (char*) &m_macList , &result ) ;
NewExtLDEFInfo( m_macList , MacDrawStringCell , (long) this ) ;
- (**m_macList).selFlags = lOnlyOne ;
- if ( style & wxLB_MULTIPLE )
+ (**m_macList).selFlags = 0 ;
+ if ( style & wxLB_MULTIPLE )
{
(**m_macList).selFlags += lNoExtend ;
}
{
(**m_macList).selFlags += lExtendDrag ;
}
+ else
+ {
+ (**m_macList).selFlags = lOnlyOne ;
+ }
Point pt = (**m_macList).cellSize ;
pt.v = 14 ;
LCellSize( pt , m_macList ) ;
}
#endif // wxUSE_OWNER_DRAWN/!wxUSE_OWNER_DRAWN
m_stringArray.Remove( N ) ;
+ m_dataArray.Remove( N ) ;
m_noItems --;
MacDelete( N ) ;
wxASSERT_MSG(clientData[i] == NULL,
wxT("Can't use client data with owner-drawn listboxes"));
#else // !wxUSE_OWNER_DRAWN
- Append( choices[i] , clientData[0] ) ;
+ Append( choices[i] , clientData[i] ) ;
#endif
}
else
wxFAIL_MSG(wxT("Can't use client data with owner-drawn listboxes"));
}
#endif // wxUSE_OWNER_DRAWN
- m_dataArray[N] = (char*) Client_data ;
+ wxASSERT_MSG( m_dataArray.GetCount() >= N , "invalid client_data array" ) ;
+
+ if ( m_dataArray.GetCount() > N )
+ {
+ m_dataArray[N] = (char*) Client_data ;
+ }
+ else
+ {
+ m_dataArray.Add( (char*) Client_data ) ;
+ }
}
void wxListBox::DoSetItemClientObject(int n, wxClientData* clientData)
MacSet( N , s ) ;
}
-wxSize wxListBox::DoGetBestSize()
+wxSize wxListBox::DoGetBestSize() const
{
return wxSize(100, 100);
}