insert was not correctly implemented
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29348 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -73,8 +73,8 @@ static pascal void DataBrowserItemNotificationProc(ControlRef browser, DataBrow
|
||||
if ( ref )
|
||||
{
|
||||
wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ;
|
||||
for ( size_t i = 0 ; i < list->m_idArray.GetCount() ; ++i )
|
||||
if ( list->m_idArray[i] == (long) itemID )
|
||||
size_t i = itemID - 1 ;
|
||||
if (i >= 0 && i < list->GetCount() )
|
||||
{
|
||||
bool trigger = false ;
|
||||
wxCommandEvent event(
|
||||
@@ -110,8 +110,6 @@ static pascal void DataBrowserItemNotificationProc(ControlRef browser, DataBrow
|
||||
// direct notification is not always having the listbox GetSelection() having in synch with event
|
||||
// list->GetEventHandler()->ProcessEvent(event) ;
|
||||
}
|
||||
|
||||
break ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -134,13 +132,12 @@ static pascal OSStatus ListBoxGetSetItemData(ControlRef browser,
|
||||
if ( ref )
|
||||
{
|
||||
wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ;
|
||||
for ( size_t i = 0 ; i < list->m_idArray.GetCount() ; ++i )
|
||||
if ( list->m_idArray[i] == (long) itemID )
|
||||
size_t i = itemID - 1 ;
|
||||
if (i >= 0 && i < list->GetCount() )
|
||||
{
|
||||
wxMacCFStringHolder cf( list->GetString(i) , list->GetFont().GetEncoding() ) ;
|
||||
verify_noerr( ::SetDataBrowserItemDataText( itemData , cf ) ) ;
|
||||
err = noErr ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,12 +148,11 @@ static pascal OSStatus ListBoxGetSetItemData(ControlRef browser,
|
||||
if ( ref )
|
||||
{
|
||||
wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ;
|
||||
for ( size_t i = 0 ; i < list->m_idArray.GetCount() ; ++i )
|
||||
if ( list->m_idArray[i] == (long) itemID )
|
||||
size_t i = itemID - 1 ;
|
||||
if (i >= 0 && i < list->GetCount() )
|
||||
{
|
||||
verify_noerr( ::SetDataBrowserItemDataButtonValue( itemData , list->IsChecked( i ) ? kThemeButtonOn : kThemeButtonOff ) ) ;
|
||||
err = noErr ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,8 +177,8 @@ static pascal OSStatus ListBoxGetSetItemData(ControlRef browser,
|
||||
if ( ref )
|
||||
{
|
||||
wxCheckListBox* list = wxDynamicCast( (wxObject*) ref , wxCheckListBox ) ;
|
||||
for ( size_t i = 0 ; i < list->m_idArray.GetCount() ; ++i )
|
||||
if ( list->m_idArray[i] == (long) itemID )
|
||||
size_t i = itemID - 1 ;
|
||||
if (i >= 0 && i < list->GetCount() )
|
||||
{
|
||||
// we have to change this behind the back, since Check() would be triggering another update round
|
||||
bool newVal = !list->IsChecked( i ) ;
|
||||
@@ -194,8 +190,6 @@ static pascal OSStatus ListBoxGetSetItemData(ControlRef browser,
|
||||
event.SetInt(i);
|
||||
event.SetEventObject(list);
|
||||
list->GetEventHandler()->ProcessEvent(event);
|
||||
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,8 +221,6 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
m_noItems = 0 ; // this will be increased by our append command
|
||||
m_selected = 0;
|
||||
m_nextId = 1 ;
|
||||
|
||||
|
||||
Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
|
||||
|
||||
@@ -341,7 +333,7 @@ void wxCheckListBox::Check(size_t item, bool check)
|
||||
if ( check != isChecked )
|
||||
{
|
||||
m_checks[item] = check;
|
||||
UInt32 id = m_idArray[item] ;
|
||||
UInt32 id = item + 1 ;
|
||||
verify_noerr( m_peer->UpdateItems(kDataBrowserNoItem , 1 , &id , kDataBrowserItemNoProperty , kDataBrowserItemNoProperty ) ) ;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user