-void wxCheckListBox::DoSetItems(const wxArrayString& items, void **clientData)
-{
- // call it first as it does DoClear()
- wxListBox::DoSetItems( items, clientData );
+ virtual OSStatus GetSetData( wxMacDataItemBrowserControl *owner ,
+ DataBrowserPropertyID property,
+ DataBrowserItemDataRef itemData,
+ bool changeValue )
+ {
+ OSStatus err = errDataBrowserPropertyNotSupported;
+
+ wxCheckListBox *checklist = wxDynamicCast( owner->GetPeer() , wxCheckListBox );
+ wxCHECK_MSG( checklist != NULL , errDataBrowserPropertyNotSupported , wxT("wxCheckListBox expected"));
+
+ if ( !changeValue )
+ {
+ switch (property)
+ {
+ case kCheckboxColumnId:
+ verify_noerr(SetDataBrowserItemDataButtonValue( itemData, m_isChecked ? kThemeButtonOn : kThemeButtonOff ));
+ err = noErr;
+ break;
+
+ case kDataBrowserItemIsEditableProperty:
+ verify_noerr(SetDataBrowserItemDataBooleanValue( itemData, true ));
+ err = noErr;
+ break;
+
+ default:
+ break;
+ }
+ }
+ else
+ {
+ switch (property)
+ {
+ case kCheckboxColumnId:
+ {
+ // we have to change this behind the back, since Check() would be triggering another update round
+ bool newVal = !m_isChecked;
+ verify_noerr(SetDataBrowserItemDataButtonValue( itemData, newVal ? kThemeButtonOn : kThemeButtonOff ));
+ m_isChecked = newVal;
+ err = noErr;
+
+ wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, checklist->GetId() );
+ event.SetInt( owner->GetLineFromItem( this ) );
+ event.SetEventObject( checklist );
+ checklist->HandleWindowEvent( event );
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if ( err == errDataBrowserPropertyNotSupported )
+ err = wxMacListBoxItem::GetSetData( owner , property, itemData , changeValue);
+
+ return err;
+ }