- if ( scheduledParent )
- {
- // Use parent's colours.
- property->m_bgColIndex = scheduledParent->m_bgColIndex;
- property->m_fgColIndex = scheduledParent->m_fgColIndex;
-
- // Fix no parent does not yet have parenting flag yet, set one now
- if ( !scheduledParent->HasFlag(wxPG_PROP_PARENTAL_FLAGS) )
- scheduledParent->SetParentalType(wxPG_PROP_MISC_PARENT);
- //scheduledParent->SetFlag(wxPG_PROP_MISC_PARENT);
- }
-
- // If in hideable adding mode, or if assigned parent is hideable, then
- // make this one hideable.
- if (
- ( scheduledParent && (scheduledParent->m_flags & wxPG_PROP_HIDDEN) ) ||
- ( propGrid && (propGrid->m_iFlags & wxPG_FL_ADDING_HIDEABLES) )
- )
- property->SetFlag( wxPG_PROP_HIDDEN );
-
- // Set custom image flag.
- int custImgHeight = property->OnMeasureImage().y;
- if ( custImgHeight < 0 /*|| custImgHeight > 1*/ )
- {
- property->m_flags |= wxPG_PROP_CUSTOMIMAGE;
- }
-
- if ( propGrid && (propGrid->GetWindowStyleFlag() & wxPG_LIMITED_EDITING) )
- property->m_flags |= wxPG_PROP_NOEDITOR;
-
- if ( !property->IsCategory() )
- {
- // This is not a category.
+ // NULL parent == root parent
+ if ( !scheduledParent )
+ scheduledParent = DoGetRoot();