Property removal and deletion done from wxPropertyGrid event handler is now postponed to idle event

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63534 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2010-02-22 16:44:56 +00:00
parent e908dbcc92
commit f231df8aa8
5 changed files with 77 additions and 12 deletions

View File

@@ -1857,6 +1857,18 @@ void wxPropertyGridPageState::DoDelete( wxPGProperty* item, bool doDelete )
wxCHECK_RET( item != &m_regularArray && item != m_abcArray,
wxT("wxPropertyGrid: Do not attempt to remove the root item.") );
wxPropertyGrid* pg = GetGrid();
// Must defer deletion? Yes, if handling a wxPG event.
if ( pg && pg->m_processedEvent )
{
if ( doDelete )
pg->m_deletedProperties.push_back(item);
else
pg->m_removedProperties.push_back(item);
return;
}
unsigned int indinparent = item->GetIndexInParent();
wxPGProperty* pwc = (wxPGProperty*)item;
@@ -1867,8 +1879,6 @@ void wxPropertyGridPageState::DoDelete( wxPGProperty* item, bool doDelete )
wxASSERT( item->GetParentState() == this );
wxPropertyGrid* pg = GetGrid();
if ( DoIsPropertySelected(item) )
{
if ( pg && pg->GetState() == this )