From: Jeffrey D. <ha...@us...> - 2003-09-23 07:35:57
|
Log Message: ----------- Solo views can release and won't have a ghost Modified Files: -------------- /cvsroot/decaldev/source/Inject: View.cpp Revision Data ------------- Index: View.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/View.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- View.cpp 17 Sep 2003 23:22:11 -0000 1.22 +++ View.cpp 23 Sep 2003 07:35:24 -0000 1.23 @@ -15,13 +15,19 @@ cView::~cView( ) { m_bActivated = false; - m_pRoot->m_pBars->RemoveBar( m_nViewID ); - m_pPanel->RemoveView( m_nViewID ); - m_pRoot->removeView( this ); - m_pPanel.Release( ); + m_pRoot->m_pBars->RemoveBar( m_nViewID ); + m_pPanel->RemoveView( m_nViewID ); + m_pRoot->removeView( this ); - if( cManager::_p->m_bContainer ) - cManager::_p->clearDestroyList( ); + long nActiveView; + m_pPanel->get_ActiveView( &nActiveView ); + m_pRoot->SelectBar( nActiveView ); + m_pRoot->SelectBar( nActiveView ); + + m_pPanel.Release(); + + if( cManager::_p->m_bContainer ) + cManager::_p->clearDestroyList( ); } long cView::loadSchema( BSTR strSchema, IUnknown **ppRootControl ) @@ -325,11 +331,15 @@ STDMETHODIMP cView::put_Title(BSTR newVal) { - _ASSERTE( newVal != NULL ); + _ASSERTE( newVal != NULL ); - m_VP.label = _bstr_t( newVal ).copy( ); + bool bActivated = m_bActivated; - m_pRoot->m_pBars->put_Bar( m_nViewID, &m_VP ); + m_VP.label = _bstr_t( newVal ).copy( ); + m_pRoot->m_pBars->put_Bar( m_nViewID, &m_VP ); + + if( bActivated ) + m_pPanel->Deactivate(), m_pRoot->SelectBar( m_nViewID ); return S_OK; } @@ -382,10 +392,10 @@ { long nActiveView; m_pPanel->get_ActiveView( &nActiveView ); - + if (nActiveView != m_nViewID) m_pRoot->SelectBar( m_nViewID ); - + return S_OK; } |