m_strings.unsorted = new wxArrayString;
m_peer = wxWidgetImpl::CreateListBox( this, parent, id, pos, size, style, GetExtraStyle() );
-
+
MacPostControlCreate( pos, size );
m_textColumn = GetListPeer()->InsertTextColumn(0,wxEmptyString);
wxListBox::~wxListBox()
{
+ m_blockEvents = true;
FreeData();
+ m_blockEvents = false;
+
// make sure no native events get sent to a object in destruction
delete m_peer;
m_peer = NULL;
GetListPeer()->ListDelete( n );
m_blockEvents = false;
-
+
UpdateOldSelections();
}
m_blockEvents = true;
FreeData();
m_blockEvents = false;
-
+
UpdateOldSelections();
}
wxT("invalid index in wxListBox::SetSelection") );
m_blockEvents = true;
-
+
if ( n == wxNOT_FOUND )
GetListPeer()->ListDeselectAll();
else
GetListPeer()->ListSetSelection( n, select, HasMultipleSelection() );
-
+
m_blockEvents = false;
-
+
UpdateOldSelections();
}
value.Set( GetString( n ) );
}
-void wxListBox::SetValueCallback( unsigned int n, wxListWidgetColumn* col , wxListWidgetCellValue& value )
+void wxListBox::SetValueCallback( unsigned int WXUNUSED(n), wxListWidgetColumn* WXUNUSED(col) , wxListWidgetCellValue& WXUNUSED(value) )
{
}
void wxListBox::SetString(unsigned int n, const wxString& s)
{
- wxCHECK_RET( !IsSorted(), _T("can't set string in sorted listbox") );
+ wxCHECK_RET( !IsSorted(), wxT("can't set string in sorted listbox") );
if ( IsSorted() )
(*m_strings.sorted)[n] = s;
void wxListBox::HandleLineEvent( unsigned int n, bool doubleClick )
{
- wxCommandEvent event( doubleClick ? wxEVT_COMMAND_LISTBOX_DOUBLECLICKED :
+ wxCommandEvent event( doubleClick ? wxEVT_COMMAND_LISTBOX_DOUBLECLICKED :
wxEVT_COMMAND_LISTBOX_SELECTED, GetId() );
event.SetEventObject( this );
if ( HasClientObjectData() )
HandleWindowEvent(event);
}
+//
+// common list cell value operations
+//
+
+void wxListWidgetCellValue::Check( bool check )
+{
+ Set( check ? 1 : 0 );
+}
+
+bool wxListWidgetCellValue::IsChecked() const
+{
+ return GetIntValue() != 0;
+}
+
+
+
#endif // wxUSE_LISTBOX