bool SettersGettersModel::IsContainer(const wxDataViewItem& item) const
{
    SettersGettersModel_Item* node = reinterpret_cast<SettersGettersModel_Item*>(item.m_pItem);
    if ( node ) {
        return node->IsContainer();
    }
    return false;
}
void SettersGettersModel::DoChangeItemType(const wxDataViewItem& item, bool changeToContainer)
{
    SettersGettersModel_Item* node = reinterpret_cast<SettersGettersModel_Item*>(item.GetID());
    if ( !node )
        return;
    
    if ( ( changeToContainer && !node->IsContainer())  || // change an item from non-container to container type
         ( !changeToContainer && node->IsContainer()) ) { // change an item from container to non-container type
#if defined(__WXGTK__) || defined(__WXMAC__)
        // change the item to container type:
        // 1st we need to delete it
        ItemDeleted(wxDataViewItem(node->GetParent()), item);
        
        // update the node type
        node->SetIsContainer(changeToContainer);
        ItemAdded(wxDataViewItem(node->GetParent()), item);
#else
        node->SetIsContainer(changeToContainer);
#endif
    }
}