X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d6f93922574f0733fde4817445c3575398e2bf7a..08670ea85abf4b4946a9ce64971b591d7b1ee30b:/src/osx/checklst_osx.cpp?ds=inline diff --git a/src/osx/checklst_osx.cpp b/src/osx/checklst_osx.cpp index 574d9ecf83..55e3b9ce4e 100644 --- a/src/osx/checklst_osx.cpp +++ b/src/osx/checklst_osx.cpp @@ -24,11 +24,9 @@ #include "wx/osx/private.h" -IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox) - BEGIN_EVENT_TABLE(wxCheckListBox, wxListBox) END_EVENT_TABLE() - + void wxCheckListBox::Init() { } @@ -58,9 +56,8 @@ bool wxCheckListBox::Create( long style, const wxValidator& validator, const wxString& name ) -{ - m_macIsUserPane = false; - +{ + wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED), wxT("only one of listbox selection modes can be specified") ); @@ -85,7 +82,7 @@ bool wxCheckListBox::Create( bool wxCheckListBox::IsChecked(unsigned int n) const { wxCHECK_MSG( IsValid(n), false, - _T("invalid index in wxCheckListBox::IsChecked") ); + wxT("invalid index in wxCheckListBox::IsChecked") ); return m_checks[n] != 0; } @@ -93,7 +90,7 @@ bool wxCheckListBox::IsChecked(unsigned int n) const void wxCheckListBox::Check(unsigned int n, bool check) { wxCHECK_RET( IsValid(n), - _T("invalid index in wxCheckListBox::Check") ); + wxT("invalid index in wxCheckListBox::Check") ); // intermediate var is needed to avoid compiler warning with VC++ bool isChecked = m_checks[n] != 0; @@ -108,7 +105,7 @@ void wxCheckListBox::Check(unsigned int n, bool check) void wxCheckListBox::GetValueCallback( unsigned int n, wxListWidgetColumn* col , wxListWidgetCellValue& value ) { if ( col == m_checkColumn ) - value.Set( IsChecked( n ) ); + value.Check( IsChecked( n ) ); else wxListBox::GetValueCallback( n, col, value ); } @@ -117,10 +114,11 @@ void wxCheckListBox::SetValueCallback( unsigned int n, wxListWidgetColumn* col , { if ( col == m_checkColumn ) { - Check( n, value.GetIntValue() ); - + Check( n, value.IsChecked() ); + wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId() ); event.SetInt( n ); + event.SetString( GetString( n ) ); event.SetEventObject( this ); HandleWindowEvent( event ); } @@ -134,6 +132,8 @@ void wxCheckListBox::SetValueCallback( unsigned int n, wxListWidgetColumn* col , void wxCheckListBox::OnItemInserted(unsigned int pos) { + wxListBox::OnItemInserted(pos); + m_checks.Insert(false, pos ); } @@ -146,6 +146,8 @@ void wxCheckListBox::DoDeleteOneItem(unsigned int n) void wxCheckListBox::DoClear() { + wxListBox::DoClear(); + m_checks.Empty(); }