From: Jeffrey D. <ha...@us...> - 2004-01-08 23:14:17
|
Log Message: ----------- Drak's view hindrances Modified Files: -------------- /cvsroot/decaldev/source/Inject: BarLayer.cpp Panel.cpp View.cpp Revision Data ------------- Index: BarLayer.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/BarLayer.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- BarLayer.cpp 23 Dec 2003 00:51:44 -0000 1.18 +++ BarLayer.cpp 8 Jan 2004 23:14:15 -0000 1.19 @@ -572,8 +572,6 @@ pParams.state = m_nMinMax; pBarNative->put_Params(&pParams); - // We always give bars their desired size - pBarNative->get_RenderWidth( &nDesired ); if (m_nBarDock != DOCK_TOP) // Side Dock { nDesired = 20; @@ -584,6 +582,8 @@ } else // Top Dock { + // We always give bars their desired size + pBarNative->get_RenderWidth( &nDesired ); rc.left = nOffset; rc.top = 0; rc.right = nOffset + nDesired; @@ -640,7 +640,7 @@ { if( !m_bLocked && ( m_nPosition < ( m_offsets.size() - 1 ) ) ) { - m_bLocked = TRUE; + //m_bLocked = TRUE; m_nPosition++; *pnX = m_offsets[ m_nPosition ]; *pnY = 0; @@ -667,7 +667,7 @@ { if( !m_bLocked && m_nPosition > 0 ) { - m_bLocked = TRUE; + //m_bLocked = TRUE; m_nPosition--; *pnX = m_offsets[ m_nPosition ]; *pnY = 0; Index: Panel.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/Panel.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Panel.cpp 5 Oct 2003 18:00:41 -0000 1.17 +++ Panel.cpp 8 Jan 2004 23:14:15 -0000 1.18 @@ -8,7 +8,7 @@ enum ePanelChildren { - eViewFirst = 1000 + eViewFirst = 1000 }; cPanel::cPanel() @@ -26,89 +26,89 @@ void cPanel::hideView() { - m_pSite->Invalidate(); + m_pSite->Invalidate(); - if( m_nActiveView == -1 ) - // No active view currently - return; + if( m_nActiveView == -1 ) + // No active view currently + return; - CComPtr< ILayerSite > pActive; - m_pSite->get_Child( m_nActiveView, ePositionByID, &pActive ); + CComPtr< ILayerSite > pActive; + m_pSite->get_Child( m_nActiveView, ePositionByID, &pActive ); - static RECT rcHide = { 0, 0, 0, 0 }; - pActive->put_Position( &rcHide ); + static RECT rcHide = { 0, 0, 0, 0 }; + pActive->put_Position( &rcHide ); - if( m_pSink.p != NULL ) - m_pSink->PanelDeactivate( m_nActiveView ); + if( m_pSink.p != NULL ) + m_pSink->PanelDeactivate( m_nActiveView ); - m_nActiveView = -1; + m_nActiveView = -1; } void cPanel::onCreate() { - CComPtr< IPluginSite > pPlugin; - m_pSite->get_PluginSite( &pPlugin ); + CComPtr< IPluginSite > pPlugin; + m_pSite->get_PluginSite( &pPlugin ); - pPlugin->LoadBitmapPortal( 0x0600126F, &m_pBackground ); - pPlugin->LoadBitmapPortal( 0x06001277, &m_pBorder ); - BSTR bstrFontName; - pPlugin->get_FontName(&bstrFontName); - pPlugin->CreateFont( bstrFontName /*_bstr_t( _T( "Times New Roman" ) )*/, 15, eFontBold, &m_pTitle ); + pPlugin->LoadBitmapPortal( 0x0600126F, &m_pBackground ); + pPlugin->LoadBitmapPortal( 0x06001277, &m_pBorder ); + BSTR bstrFontName; + pPlugin->get_FontName(&bstrFontName); + pPlugin->CreateFont( bstrFontName /*_bstr_t( _T( "Times New Roman" ) )*/, 15, eFontBold, &m_pTitle ); - // Create the Button - CComPtr< IButton > pRollup; + // Create the Button + CComPtr< IButton > pRollup; - HRESULT hRes = ::CoCreateInstance( CLSID_Button, NULL, CLSCTX_INPROC_SERVER, IID_IButton, - reinterpret_cast< void ** >( &pRollup ) ); + HRESULT hRes = ::CoCreateInstance( CLSID_Button, NULL, CLSCTX_INPROC_SERVER, IID_IButton, + reinterpret_cast< void ** >( &pRollup ) ); - _ASSERTE( SUCCEEDED( hRes ) ); + _ASSERTE( SUCCEEDED( hRes ) ); - CComPtr< ILayer > pBtnLayer; - pRollup->QueryInterface( &pBtnLayer ); + CComPtr< ILayer > pBtnLayer; + pRollup->QueryInterface( &pBtnLayer ); - LayerParams lp = { 1, { 180 - 16, 0, 180, 16 }, eRenderClipped }; - m_pSite->CreateChild( &lp, pBtnLayer ); + LayerParams lp = { 1, { 180 - 16, 0, 180, 16 }, eRenderClipped }; + m_pSite->CreateChild( &lp, pBtnLayer ); - pRollup->put_Matte( RGB( 0, 0, 0 ) ); - pRollup->SetImages( 0, 0x0600113C, 0x0600113B ); - ICommandEventsImpl< BUTTON_CLOSE, cPanel >::advise( pRollup ); + pRollup->put_Matte( RGB( 0, 0, 0 ) ); + pRollup->SetImages( 0, 0x0600113C, 0x0600113B ); + ICommandEventsImpl< BUTTON_CLOSE, cPanel >::advise( pRollup ); - // Create the Increment Button - hRes = ::CoCreateInstance( CLSID_Button, NULL, CLSCTX_INPROC_SERVER, IID_IButton, - reinterpret_cast< void ** >( &m_pButtonInc ) ); + // Create the Increment Button + hRes = ::CoCreateInstance( CLSID_Button, NULL, CLSCTX_INPROC_SERVER, IID_IButton, + reinterpret_cast< void ** >( &m_pButtonInc ) ); - _ASSERTE( SUCCEEDED( hRes ) ); + _ASSERTE( SUCCEEDED( hRes ) ); - CComPtr< ILayer > pBtnIncLayer; - m_pButtonInc->QueryInterface( &pBtnIncLayer ); + CComPtr< ILayer > pBtnIncLayer; + m_pButtonInc->QueryInterface( &pBtnIncLayer ); - LayerParams lpInc = { 2, { 180 - 32, 0, 180 - 32 + 16, 16 }, eRenderClipped }; - m_pSite->CreateChild( &lpInc, pBtnIncLayer ); + LayerParams lpInc = { 2, { 180 - 32, 0, 180 - 32 + 16, 16 }, eRenderClipped }; + m_pSite->CreateChild( &lpInc, pBtnIncLayer ); - m_pButtonInc->put_Matte( RGB( 0, 0, 0 ) ); - m_pButtonInc->SetImages( 0, 0x06001298, 0x06001299 ); + m_pButtonInc->put_Matte( RGB( 0, 0, 0 ) ); + m_pButtonInc->SetImages( 0, 0x06001298, 0x06001299 ); - ICommandEventsImpl< BUTTON_INC, cPanel >::advise( m_pButtonInc ); + ICommandEventsImpl< BUTTON_INC, cPanel >::advise( m_pButtonInc ); - // Create the Decrement Button - hRes = ::CoCreateInstance( CLSID_Button, NULL, CLSCTX_INPROC_SERVER, IID_IButton, - reinterpret_cast< void ** >( &m_pButtonDec ) ); + // Create the Decrement Button + hRes = ::CoCreateInstance( CLSID_Button, NULL, CLSCTX_INPROC_SERVER, IID_IButton, + reinterpret_cast< void ** >( &m_pButtonDec ) ); - _ASSERTE( SUCCEEDED( hRes ) ); + _ASSERTE( SUCCEEDED( hRes ) ); - CComPtr< ILayer > pBtnDecLayer; - m_pButtonDec->QueryInterface( &pBtnDecLayer ); + CComPtr< ILayer > pBtnDecLayer; + m_pButtonDec->QueryInterface( &pBtnDecLayer ); - LayerParams lpDec = { 3, { 180 - 48, 0, 180 - 48 + 16, 16 }, eRenderClipped }; - m_pSite->CreateChild( &lpDec, pBtnDecLayer ); + LayerParams lpDec = { 3, { 180 - 48, 0, 180 - 48 + 16, 16 }, eRenderClipped }; + m_pSite->CreateChild( &lpDec, pBtnDecLayer ); - m_pButtonDec->put_Matte( RGB( 0, 0, 0 ) ); - m_pButtonDec->SetImages( 0, 0x06001295, 0x06001296 ); + m_pButtonDec->put_Matte( RGB( 0, 0, 0 ) ); + m_pButtonDec->SetImages( 0, 0x06001295, 0x06001296 ); - ICommandEventsImpl< BUTTON_DEC, cPanel >::advise( m_pButtonDec ); + ICommandEventsImpl< BUTTON_DEC, cPanel >::advise( m_pButtonDec ); - // Set this layer not transparent to be transparent - m_pSite->put_Transparent( VARIANT_FALSE ); + // Set this layer not transparent to be transparent + m_pSite->put_Transparent( VARIANT_FALSE ); RegKey key; key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal" ) ); @@ -119,278 +119,278 @@ void cPanel::onDestroy() { - m_pBorder.Release(); - m_pBackground.Release(); - m_pTitle.Release(); - m_pButtonInc.Release(); - m_pButtonDec.Release(); + m_pBorder.Release(); + m_pBackground.Release(); + m_pTitle.Release(); + m_pButtonInc.Release(); + m_pButtonDec.Release(); } STDMETHODIMP cPanel::Render( ICanvas *pCanvas ) { - RECT rc; - m_pSite->get_Position( &rc ); + RECT rc; + m_pSite->get_Position( &rc ); - SIZE szBorder; - m_pBorder->get_Size( &szBorder ); + SIZE szBorder; + m_pBorder->get_Size( &szBorder ); - // Draw the background - RECT rc_pat = { 0, 0, rc.right - rc.left, rc.bottom - rc.top }; - static POINT pt_pat = { 0, 0 }; + // Draw the background + RECT rc_pat = { 0, 0, rc.right - rc.left, rc.bottom - rc.top }; + static POINT pt_pat = { 0, 0 }; if( ! m_bTransparent ) m_pBackground->PatBlt( pCanvas, &rc_pat, &pt_pat ); - // Draw the borders - RECT rc_border_top = { 0, 0, rc.right - rc.left, szBorder.cy }, - rc_border_bottom = { 0, rc.bottom - rc.top - szBorder.cy, - rc.right - rc.left, rc.bottom - rc.top }; + // Draw the borders + RECT rc_border_top = { 0, 0, rc.right - rc.left, szBorder.cy }, + rc_border_bottom = { 0, rc.bottom - rc.top - szBorder.cy, + rc.right - rc.left, rc.bottom - rc.top }; - pCanvas->Fill( &rc_border_top, RGB( 0, 0, 0 ) ); - m_pBorder->PatBlt( pCanvas, &rc_border_top, &pt_pat ); - pCanvas->Fill( &rc_border_bottom, RGB( 0, 0, 0 ) ); - m_pBorder->PatBlt( pCanvas, &rc_border_bottom, &pt_pat ); + pCanvas->Fill( &rc_border_top, RGB( 0, 0, 0 ) ); + m_pBorder->PatBlt( pCanvas, &rc_border_top, &pt_pat ); + pCanvas->Fill( &rc_border_bottom, RGB( 0, 0, 0 ) ); + m_pBorder->PatBlt( pCanvas, &rc_border_bottom, &pt_pat ); - // Draw the title text - if( _bstr_t(m_pVP->label).length() > 0 ) - { - POINT ptText = { 24, szBorder.cy + 5 }; - m_pTitle->DrawText( &ptText, m_pVP->label, 0, pCanvas ); - } + // Draw the title text + if( _bstr_t(m_pVP->label).length() > 0 ) + { + POINT ptText = { 24, szBorder.cy + 5 }; + m_pTitle->DrawText( &ptText, m_pVP->label, 0, pCanvas ); + } - if( m_pVP->icon != 0 ) - { - CComPtr< IPluginSite > pPlugin; - m_pSite->get_PluginSite( &pPlugin ); + if( m_pVP->icon != 0 ) + { + CComPtr< IPluginSite > pPlugin; + m_pSite->get_PluginSite( &pPlugin ); - CComPtr< IIconCache > pIconCache; - static SIZE szIcon = { 16, 16 }; - pPlugin->GetIconCache( &szIcon, &pIconCache ); + CComPtr< IIconCache > pIconCache; + static SIZE szIcon = { 16, 16 }; + pPlugin->GetIconCache( &szIcon, &pIconCache ); - static POINT pt = { 4, szBorder.cy + 4 }; - pIconCache->DrawIcon( &pt, m_pVP->icon, m_pVP->iconLibrary, pCanvas ); - } + static POINT pt = { 4, szBorder.cy + 4 }; + pIconCache->DrawIcon( &pt, m_pVP->icon, m_pVP->iconLibrary, pCanvas ); + } - _ASSERTMEM( _CrtCheckMemory( ) ); + _ASSERTMEM( _CrtCheckMemory( ) ); - return S_OK; + return S_OK; } STDMETHODIMP cPanel::Reformat() { - // Reset the size - CComPtr< IPluginSite > pPlugin; - m_pSite->get_PluginSite( &pPlugin ); + // Reset the size + CComPtr< IPluginSite > pPlugin; + m_pSite->get_PluginSite( &pPlugin ); - SIZE szScreen; - pPlugin->GetScreenSize( &szScreen ); + SIZE szScreen; + pPlugin->GetScreenSize( &szScreen ); - RECT rc = { m_pVP->left, m_pVP->top, m_pVP->left + m_pVP->width, m_pVP->top + m_pVP->height }; + RECT rc = { m_pVP->left, m_pVP->top, m_pVP->left + m_pVP->width, m_pVP->top + m_pVP->height }; - m_pSite->put_Position( &rc ); + m_pSite->put_Position( &rc ); - RECT rcCloseBtn = { m_pVP->width - 16, 0, m_pVP->width, 16 }; - CComPtr< ILayerSite > pCloseBtnLS; - m_pSite->get_Child(1, ePositionByID, &pCloseBtnLS); + RECT rcCloseBtn = { m_pVP->width - 16, 0, m_pVP->width, 16 }; + CComPtr< ILayerSite > pCloseBtnLS; + m_pSite->get_Child(1, ePositionByID, &pCloseBtnLS); - pCloseBtnLS->put_Position(&rcCloseBtn); - - RECT rcIncBtn = { m_pVP->width - 32, 0, m_pVP->width - 32 + 16, 16 }; - CComPtr< ILayerSite > pButtonInc; - m_pSite->get_Child(2, ePositionByID, &pButtonInc); - pButtonInc->put_Position( &rcIncBtn ); + pCloseBtnLS->put_Position(&rcCloseBtn); + + RECT rcIncBtn = { m_pVP->width - 32, 0, m_pVP->width - 32 + 16, 16 }; + CComPtr< ILayerSite > pButtonInc; + m_pSite->get_Child(2, ePositionByID, &pButtonInc); + pButtonInc->put_Position( &rcIncBtn ); - RECT rcDecBtn = { m_pVP->width - 48, 0, m_pVP->width - 48 + 16, 16 }; - CComPtr< ILayerSite > pButtonDec; - m_pSite->get_Child(3, ePositionByID, &pButtonDec); - pButtonDec->put_Position( &rcDecBtn ); + RECT rcDecBtn = { m_pVP->width - 48, 0, m_pVP->width - 48 + 16, 16 }; + CComPtr< ILayerSite > pButtonDec; + m_pSite->get_Child(3, ePositionByID, &pButtonDec); + pButtonDec->put_Position( &rcDecBtn ); - if( m_nActiveView != -1 ) - { - // Position the active view - SIZE szBorder; - m_pBorder->get_Size( &szBorder ); + if( m_nActiveView != -1 ) + { + // Position the active view + SIZE szBorder; + m_pBorder->get_Size( &szBorder ); - CComPtr< ILayerSite > pActive; - m_pSite->get_Child( m_nActiveView, ePositionByID, &pActive ); + CComPtr< ILayerSite > pActive; + m_pSite->get_Child( m_nActiveView, ePositionByID, &pActive ); - RECT rcChild = { 0, 24 + szBorder.cy, m_pVP->width, m_pVP->height - szBorder.cy }; - pActive->put_Position( &rcChild ); - } + RECT rcChild = { 0, 24 + szBorder.cy, m_pVP->width, m_pVP->height - szBorder.cy }; + pActive->put_Position( &rcChild ); + } - return S_OK; + return S_OK; } STDMETHODIMP cPanel::AddView(long nViewID, ILayer *pLayer) { - _ASSERTE( pLayer != NULL ); + _ASSERTE( pLayer != NULL ); - LayerParams p = { nViewID, { 0, 0, 0, 0 }, eRenderClipped }; + LayerParams p = { nViewID, { 0, 0, 0, 0 }, eRenderClipped }; - // Set up the layer - note that it is not visible - return m_pSite->CreateChild( &p, pLayer ); + // Set up the layer - note that it is not visible + return m_pSite->CreateChild( &p, pLayer ); } STDMETHODIMP cPanel::ActivateView(long nViewID, ViewParams *pParams, long *pView) { - // Hide the current view by resizing to 0,0 - hideView(); + // Hide the current view by resizing to 0,0 + hideView(); - m_pVP = pParams; + m_pVP = pParams; - m_pcView = (cView*)pView; + m_pcView = (cView*)pView; VARIANT_BOOL isTransparent=VARIANT_FALSE ; if (m_pcView) m_pcView->get_Transparent(&isTransparent) ; put_Transparent(isTransparent) ; - if( m_pVP->alpha == -1 ) - m_pSite->put_Alpha( m_Alpha ); - else - m_pSite->put_Alpha( m_pVP->alpha ); + if( m_pVP->alpha == -1 ) + m_pSite->put_Alpha( m_Alpha ); + else + m_pSite->put_Alpha( m_pVP->alpha ); #ifdef _DEBUG - // Make sure the child exists - CComPtr< ILayerSite > pChildSite; - _ASSERTE( SUCCEEDED( m_pSite->get_Child( nViewID, ePositionByID, &pChildSite ) ) ); + // Make sure the child exists + CComPtr< ILayerSite > pChildSite; + _ASSERTE( SUCCEEDED( m_pSite->get_Child( nViewID, ePositionByID, &pChildSite ) ) ); #endif - // Locate the child - m_nActiveView = nViewID; + // Locate the child + m_nActiveView = nViewID; - // Trick it into reformatting next frame - static RECT rcBig = { 0, 0, 1, 1 }; - m_pSite->put_Position( &rcBig ); + // Trick it into reformatting next frame + static RECT rcBig = { 0, 0, 1, 1 }; + m_pSite->put_Position( &rcBig ); - // Pop us to the front - m_pSite->moveToFront(); + // Pop us to the front + m_pSite->moveToFront(); return S_OK; } STDMETHODIMP cPanel::RemoveView( long nViewID ) { - if( nViewID == m_nActiveView ) - // If this is the current view, run and hide - Deactivate(); + if( nViewID == m_nActiveView ) + // If this is the current view, run and hide + Deactivate(); - CComPtr< ILayerSite > pChildSite; - HRESULT hRes = m_pSite->get_Child( nViewID, ePositionByID, &pChildSite ); - _ASSERTE( SUCCEEDED( hRes ) ); - if( SUCCEEDED( hRes ) ) + CComPtr< ILayerSite > pChildSite; + HRESULT hRes = m_pSite->get_Child( nViewID, ePositionByID, &pChildSite ); + _ASSERTE( SUCCEEDED( hRes ) ); + if( SUCCEEDED( hRes ) ) pChildSite->Destroy(); - else - return E_FAIL; + else + return E_FAIL; return S_OK; } void cPanel::onCloseAccepted(long nID) { - // We should only be getting commands from the button - _ASSERTE( nID == 1 ); + // We should only be getting commands from the button + _ASSERTE( nID == 1 ); - Deactivate(); + Deactivate(); } void cPanel::onAlphaInc(long nID) { - // We should only be getting commands from the button - _ASSERTE( nID == 2 ); + // We should only be getting commands from the button + _ASSERTE( nID == 2 ); - if(m_pVP->alpha == -1 ) - { - m_pVP->alpha = m_Alpha + 5; - m_pSite->put_Alpha( m_pVP->alpha ); - } - else - { - m_pVP->alpha += 5; - - if( m_pVP->alpha > 255 ) - m_pVP->alpha = 255; - - m_pSite->put_Alpha( m_pVP->alpha ); - } + if(m_pVP->alpha == -1 ) + { + m_pVP->alpha = m_Alpha + 5; + m_pSite->put_Alpha( m_pVP->alpha ); + } + else + { + m_pVP->alpha += 5; + + if( m_pVP->alpha > 255 ) + m_pVP->alpha = 255; + + m_pSite->put_Alpha( m_pVP->alpha ); + } } void cPanel::onAlphaDec(long nID) { - // We should only be getting commands from the button - _ASSERTE( nID == 3 ); + // We should only be getting commands from the button + _ASSERTE( nID == 3 ); - if(m_pVP->alpha == -1 ) - { - m_pVP->alpha = m_Alpha - 5; - m_pSite->put_Alpha( m_pVP->alpha ); - } - else - { - m_pVP->alpha -= 5; - - if( m_pVP->alpha < 0 ) - m_pVP->alpha = 0; - - m_pSite->put_Alpha( m_pVP->alpha ); - } + if(m_pVP->alpha == -1 ) + { + m_pVP->alpha = m_Alpha - 5; + m_pSite->put_Alpha( m_pVP->alpha ); + } + else + { + m_pVP->alpha -= 5; + + if( m_pVP->alpha < 0 ) + m_pVP->alpha = 0; + + m_pSite->put_Alpha( m_pVP->alpha ); + } } STDMETHODIMP cPanel::get_ActiveView(long *pVal) { - _ASSERTE( pVal != NULL ); + _ASSERTE( pVal != NULL ); - *pVal = m_nActiveView; + *pVal = m_nActiveView; - return S_OK; + return S_OK; } STDMETHODIMP cPanel::LoadView(long nViewID, IView *pView, IUnknown *pSchema) { - _ASSERTE( pView != NULL ); - _ASSERTE( pSchema != NULL ); + _ASSERTE( pView != NULL ); + _ASSERTE( pSchema != NULL ); - long nAssigned; + long nAssigned; - // Set up the layer - note that it is not visible - return pView->LoadControl( m_pSite, nViewID, pSchema, &nAssigned ); + // Set up the layer - note that it is not visible + return pView->LoadControl( m_pSite, nViewID, pSchema, &nAssigned ); } STDMETHODIMP cPanel::LoadViewEx(long nViewID, IView *pView, IUnknown *pSchema, long lViewFlags) { - _ASSERTE( pView != NULL ); - _ASSERTE( pSchema != NULL ); + _ASSERTE( pView != NULL ); + _ASSERTE( pSchema != NULL ); - long nAssigned; + long nAssigned; - if( lViewFlags & eTransparent ) - m_bTransparent = true; + if( lViewFlags & eTransparent ) + m_bTransparent = true; - // Set up the layer - note that it is not visible - return pView->LoadControl( m_pSite, nViewID, pSchema, &nAssigned ); + // Set up the layer - note that it is not visible + return pView->LoadControl( m_pSite, nViewID, pSchema, &nAssigned ); } STDMETHODIMP cPanel::Deactivate() { - if( m_nActiveView == -1 ) - // No active view currently - return S_OK; + if( m_nActiveView == -1 ) + // No active view currently + return S_OK; - // Hide the current view by resizing to 0,0 - hideView(); + // Hide the current view by resizing to 0,0 + hideView(); - // Hide the entire panel - static RECT rcHide = { 0, 0, 0, 0 }; - m_pSite->put_Position( &rcHide ); + // Hide the entire panel + static RECT rcHide = { 0, 0, 0, 0 }; + m_pSite->put_Position( &rcHide ); - m_nActiveView = -1; + m_nActiveView = -1; return S_OK; } STDMETHODIMP cPanel::putref_Sink(IPanelSink *newVal) { - m_pSink = newVal; + m_pSink = newVal; return S_OK; } @@ -478,6 +478,55 @@ { m_pVP->left = ptm.x-m_DeltaX; m_pVP->top = ptm.y-m_DeltaY; + + /* Drakier: make sure they aren't being bad little kittens and + moving the view offscreen! */ + // Drakier: Get the pSite and Screen Size + + CComPtr< IPluginSite > pPlugin; + CComPtr< IACHooks > pHooks; + m_pSite->get_PluginSite( &pPlugin ); + + SIZE szScreen, sz; + pPlugin->GetScreenSize( &sz ); + szScreen.cx = sz.cx; + szScreen.cy = sz.cy; + + long lX = sz.cx, lY = sz.cy; + + // Drakier: if we are not in the container, get the 3D Area + if ( !cManager::_p->m_bContainer ) + { + pPlugin->get_Hooks( &pHooks ); + pHooks->get_Area3DHeight( &lY ); + pHooks->get_Area3DWidth( &lX ); + pHooks.Release(); + } + pPlugin.Release(); + + // Drakier: if we are in the container, or the 3D area's are NULL + if ( (cManager::_p->m_bContainer) || (&lX == NULL) || (&lY == NULL) ) + { + szScreen.cx = sz.cx - 308; // 308 = PANEL_SIZE + szScreen.cy = sz.cy; + } + else // Drakier: If everything comes out right and we are not in container + { + if( (&lX != NULL) && (lX > 0) && (lX < 5000) ) + szScreen.cx = lX; + if( (&lY != NULL) && (lY > 0) && (lY < 5000) ) + szScreen.cy = lY; + } + + if ( m_pVP->left < 0 ) + m_pVP->left = 0; + if ( m_pVP->top < 0 ) + m_pVP->top = 0; + if ( (m_pVP->left + m_pVP->width) > szScreen.cx ) + m_pVP->left = szScreen.cx - m_pVP->width; + if ( (m_pVP->top + m_pVP->height) > szScreen.cy ) + m_pVP->top = szScreen.cy - m_pVP->height; + bUpdate = true; } else @@ -561,7 +610,7 @@ break; } } - return S_OK; + return S_OK; } STDMETHODIMP cPanel::get_Transparent(VARIANT_BOOL *pVal) Index: View.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/View.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- View.cpp 23 Dec 2003 00:51:44 -0000 1.32 +++ View.cpp 8 Jan 2004 23:14:15 -0000 1.33 @@ -32,198 +32,198 @@ long cView::loadSchema( BSTR strSchema, IUnknown **ppRootControl ) { - USES_CONVERSION; + USES_CONVERSION; - _ASSERTE( strSchema != NULL ); + _ASSERTE( strSchema != NULL ); - // Create a new XML document and load this up - MSXML::IXMLDOMDocumentPtr pDoc; - pDoc.CreateInstance( __uuidof( MSXML::DOMDocument ), NULL, CLSCTX_INPROC_SERVER ); + // Create a new XML document and load this up + MSXML::IXMLDOMDocumentPtr pDoc; + pDoc.CreateInstance( __uuidof( MSXML::DOMDocument ), NULL, CLSCTX_INPROC_SERVER ); - VARIANT_BOOL bSuccess; - if( strSchema[ 0 ] == OLESTR( '<' ) ) - bSuccess = pDoc->loadXML( strSchema ); - else - { - // Load from a file source - pDoc->async = VARIANT_FALSE; + VARIANT_BOOL bSuccess; + if( strSchema[ 0 ] == OLESTR( '<' ) ) + bSuccess = pDoc->loadXML( strSchema ); + else + { + // Load from a file source + pDoc->async = VARIANT_FALSE; - TCHAR szPath[ MAX_PATH ]; - bSuccess = pDoc->load( ::InjectMapPath( eInjectPathAgent, OLE2T( strSchema ), szPath ) ); - } + TCHAR szPath[ MAX_PATH ]; + bSuccess = pDoc->load( ::InjectMapPath( eInjectPathAgent, OLE2T( strSchema ), szPath ) ); + } - if( !bSuccess ) - { - USES_CONVERSION; + if( !bSuccess ) + { + USES_CONVERSION; - // The document failed to load, get the error info for posterity - MSXML::IXMLDOMParseErrorPtr pErr = pDoc->parseError; + // The document failed to load, get the error info for posterity + MSXML::IXMLDOMParseErrorPtr pErr = pDoc->parseError; - long nCode = pErr->errorCode; - long nFilePos = pErr->filepos; - long nLine = pErr->line; - long nLinePos = pErr->linepos; - _bstr_t strReason = pErr->reason; - _bstr_t strText = pErr->srcText; + long nCode = pErr->errorCode; + long nFilePos = pErr->filepos; + long nLine = pErr->line; + long nLinePos = pErr->linepos; + _bstr_t strReason = pErr->reason; + _bstr_t strText = pErr->srcText; - TCHAR szError[ 1024 ]; - ::_stprintf( szError, _T( "0x%08X (%i, %i): %s" ), - nCode, nLine, nLinePos, OLE2T( strReason ) ); + TCHAR szError[ 1024 ]; + ::_stprintf( szError, _T( "0x%08X (%i, %i): %s" ), + nCode, nLine, nLinePos, OLE2T( strReason ) ); - ::MessageBox( cManager::_p->m_hMain, szError, _T( "XML Parse Error" ), MB_ICONERROR | MB_OK ); + ::MessageBox( cManager::_p->m_hMain, szError, _T( "XML Parse Error" ), MB_ICONERROR | MB_OK ); - // Give the user a chance to break and look at this lovely info - _ASSERTE( FALSE ); + // Give the user a chance to break and look at this lovely info + _ASSERTE( FALSE ); pDoc.Release( ); - return 0; - } + return 0; + } - // Get the root element and check it out - long lViewFlags = loadSchemaObject( pDoc->documentElement, ppRootControl ); - pDoc.Release( ); + // Get the root element and check it out + long lViewFlags = loadSchemaObject( pDoc->documentElement, ppRootControl ); + pDoc.Release( ); - return lViewFlags; + return lViewFlags; } long cView::loadSchemaObject( IUnknown *pObject, IUnknown **ppRootControl ) { - MSXML::IXMLDOMElementPtr pRoot = pObject; + MSXML::IXMLDOMElementPtr pRoot = pObject; - _ASSERTE( pRoot->tagName == _bstr_t( _T( "view" ) ) ); + _ASSERTE( pRoot->tagName == _bstr_t( _T( "view" ) ) ); - // Get the view parameters - _variant_t vIconModule = pRoot->getAttribute( _T( "iconlibrary" ) ), - vIcon = pRoot->getAttribute( _T( "icon" ) ), - vTitle = pRoot->getAttribute( _T( "title" ) ), + // Get the view parameters + _variant_t vIconModule = pRoot->getAttribute( _T( "iconlibrary" ) ), + vIcon = pRoot->getAttribute( _T( "icon" ) ), + vTitle = pRoot->getAttribute( _T( "title" ) ), vLeft = pRoot->getAttribute( _T( "left" ) ), vTop = pRoot->getAttribute( _T( "top" ) ), vWidth = pRoot->getAttribute( _T( "width" ) ), vHeight = pRoot->getAttribute( _T( "height" ) ), vTrans = pRoot->getAttribute( _T( "transparent" ) ); - // We *must* have a title - _ASSERTE( vTitle.vt == VT_BSTR ); + // We *must* have a title + _ASSERTE( vTitle.vt == VT_BSTR ); - // Fill this into a view param - if( vIconModule.vt == VT_BSTR ) - cManager::_p->LoadResourceModule( vIconModule.bstrVal, &m_VP.iconLibrary ); - else - m_VP.iconLibrary = 0; + // Fill this into a view param + if( vIconModule.vt == VT_BSTR ) + cManager::_p->LoadResourceModule( vIconModule.bstrVal, &m_VP.iconLibrary ); + else + m_VP.iconLibrary = 0; // GKusnick: Handle no-icon case without asserting. -// _ASSERTE( vIcon.vt != VT_NULL ); - m_VP.icon = ( vIcon.vt != VT_NULL ) ? static_cast< long >( vIcon ) : 0; - // Para: shouldn't add 0x06000000 if there's an iconlibrary - if (m_VP.iconLibrary == 0 && m_VP.icon != 0) - m_VP.icon += 0x06000000; +// _ASSERTE( vIcon.vt != VT_NULL ); + m_VP.icon = ( vIcon.vt != VT_NULL ) ? static_cast< long >( vIcon ) : 0; + // Para: shouldn't add 0x06000000 if there's an iconlibrary + if (m_VP.iconLibrary == 0 && m_VP.icon != 0) + m_VP.icon += 0x06000000; -// if(vLeft.vt == VT_NULL) +// if(vLeft.vt == VT_NULL) // m_VP.left = 0; // else - if(vLeft.vt != VT_NULL) - m_VP.left = static_cast< long >(vLeft); - else - m_VP.left = 25; + if(vLeft.vt != VT_NULL) + m_VP.left = static_cast< long >(vLeft); + else + m_VP.left = 25; -// if(vTop.vt == VT_NULL) +// if(vTop.vt == VT_NULL) // m_VP.top = 70; // else - if(vTop.vt != VT_NULL) - m_VP.top = static_cast< long >(vTop); - else - m_VP.top = 25; + if(vTop.vt != VT_NULL) + m_VP.top = static_cast< long >(vTop); + else + m_VP.top = 25; - if(vWidth.vt == VT_NULL) - m_VP.width = 180; - else - m_VP.width = static_cast< long >(vWidth); + if(vWidth.vt == VT_NULL) + m_VP.width = 180; + else + m_VP.width = static_cast< long >(vWidth); - if(vHeight.vt == VT_NULL) - { + if(vHeight.vt == VT_NULL) + { SIZE szScreen; cManager::_p->GetScreenSize( &szScreen ); m_VP.height = szScreen.cy/2; - } - else - m_VP.height = static_cast< long >(vHeight); + } + else + m_VP.height = static_cast< long >(vHeight); - if(vTrans.vt == VT_NULL) - m_bTransparent = false; - else - m_bTransparent = static_cast< bool >( vTrans ); + if(vTrans.vt == VT_NULL) + m_bTransparent = false; + else + m_bTransparent = static_cast< bool >( vTrans ); if( m_bTransparent ) m_VP.alpha = 255; else m_VP.alpha = -1; - m_VP.label = _bstr_t(vTitle.bstrVal).copy(); + m_VP.label = _bstr_t(vTitle.bstrVal).copy(); - // The properly made schema should have a single control child - MSXML::IXMLDOMElementPtr pControl = pRoot->selectSingleNode( _T( "control" ) ); + // The properly made schema should have a single control child + MSXML::IXMLDOMElementPtr pControl = pRoot->selectSingleNode( _T( "control" ) ); - _ASSERTE( pControl.GetInterfacePtr() != NULL ); + _ASSERTE( pControl.GetInterfacePtr() != NULL ); - pControl->QueryInterface( ppRootControl ); + pControl->QueryInterface( ppRootControl ); long lViewFlags = 0; if( m_bTransparent ) lViewFlags |= eTransparent; - return lViewFlags; + return lViewFlags; } STDMETHODIMP cView::get_Control(BSTR strName, IControl **pVal) { - _ASSERTE( strName != NULL ); - _ASSERTE( pVal != NULL ); + _ASSERTE( strName != NULL ); + _ASSERTE( pVal != NULL ); - // Search for a matching control name - for( cNamedControlList::iterator i = m_controls.begin(); i != m_controls.end(); ++ i ) - { - if( i->m_strName == _bstr_t( strName ) ) - { - *pVal = i->m_pControl; - ( *pVal )->AddRef(); + // Search for a matching control name + for( cNamedControlList::iterator i = m_controls.begin(); i != m_controls.end(); ++ i ) + { + if( i->m_strName == _bstr_t( strName ) ) + { + *pVal = i->m_pControl; + ( *pVal )->AddRef(); - return S_OK; - } - } + return S_OK; + } + } - // The name was not found + // The name was not found return E_INVALIDARG; } STDMETHODIMP cView::putref_Control(BSTR strName, IControl *newVal) { - _ASSERTE( strName != NULL ); + _ASSERTE( strName != NULL ); - // First look for a matching name - for( cNamedControlList::iterator i = m_controls.begin(); i != m_controls.end(); ++ i ) - { - if( i->m_strName == _bstr_t( strName ) ) - { - if( newVal == NULL ) - m_controls.erase( i ); - else - i->m_pControl = newVal; + // First look for a matching name + for( cNamedControlList::iterator i = m_controls.begin(); i != m_controls.end(); ++ i ) + { + if( i->m_strName == _bstr_t( strName ) ) + { + if( newVal == NULL ) + m_controls.erase( i ); + else + i->m_pControl = newVal; - return S_OK; - } - } + return S_OK; + } + } - if( newVal == NULL ) - // No value to set - return S_OK; + if( newVal == NULL ) + // No value to set + return S_OK; - // Add in a new record - cNamedControl nc; - nc.m_strName = strName; - nc.m_pControl = newVal; + // Add in a new record + cNamedControl nc; + nc.m_strName = strName; + nc.m_pControl = newVal; - m_controls.push_back( nc ); + m_controls.push_back( nc ); return S_OK; } @@ -231,73 +231,73 @@ STDMETHODIMP cView::LoadControl(ILayerSite *pParent, long nID, IUnknown *pSource, long *pAssignedID) { // Usual parameter validation - _ASSERTE( pParent != NULL ); - _ASSERTE( pSource != NULL ); - _ASSERTE( pAssignedID != NULL ); + _ASSERTE( pParent != NULL ); + _ASSERTE( pSource != NULL ); + _ASSERTE( pAssignedID != NULL ); - MSXML::IXMLDOMElementPtr pElement = pSource; + MSXML::IXMLDOMElementPtr pElement = pSource; - // Make sure we're starting from the correct tag name - _ASSERTE( pElement->tagName == _bstr_t( _T( "control" ) ) ); + // Make sure we're starting from the correct tag name + _ASSERTE( pElement->tagName == _bstr_t( _T( "control" ) ) ); - // Get the progid and make an instance - _variant_t strProgID = pElement->getAttribute( _T( "progid" ) ); - _ASSERTE( strProgID.vt == VT_BSTR ); + // Get the progid and make an instance + _variant_t strProgID = pElement->getAttribute( _T( "progid" ) ); + _ASSERTE( strProgID.vt == VT_BSTR ); - CLSID clsid; - HRESULT hRes = ::CLSIDFromProgID( strProgID.bstrVal, &clsid ); + CLSID clsid; + HRESULT hRes = ::CLSIDFromProgID( strProgID.bstrVal, &clsid ); - _ASSERTE( SUCCEEDED( hRes ) ); + _ASSERTE( SUCCEEDED( hRes ) ); - CComPtr< ILayer > pChildLayer; - hRes = ::CoCreateInstance( clsid, NULL, CLSCTX_INPROC_SERVER, IID_ILayer, - reinterpret_cast< void ** >( &pChildLayer ) ); + CComPtr< ILayer > pChildLayer; + hRes = ::CoCreateInstance( clsid, NULL, CLSCTX_INPROC_SERVER, IID_ILayer, + reinterpret_cast< void ** >( &pChildLayer ) ); - _ASSERTE( SUCCEEDED( hRes ) ); + _ASSERTE( SUCCEEDED( hRes ) ); - // Get some position metrics - note, these are optional and will be - // loaded with 0s - this is for cases when the control is formatted - // entirely by the parent - _variant_t vLeft = pElement->getAttribute( _T( "left" ) ), - vTop = pElement->getAttribute( _T( "top" ) ), - vWidth = pElement->getAttribute( _T( "width" ) ), - vHeight = pElement->getAttribute( _T( "height" ) ), - vUnclipped = pElement->getAttribute( _T( "unclipped" ) ), - vID = pElement->getAttribute( _T( "ID" ) ); + // Get some position metrics - note, these are optional and will be + // loaded with 0s - this is for cases when the control is formatted + // entirely by the parent + _variant_t vLeft = pElement->getAttribute( _T( "left" ) ), + vTop = pElement->getAttribute( _T( "top" ) ), + vWidth = pElement->getAttribute( _T( "width" ) ), + vHeight = pElement->getAttribute( _T( "height" ) ), + vUnclipped = pElement->getAttribute( _T( "unclipped" ) ), + vID = pElement->getAttribute( _T( "ID" ) ); // check for lower case, since all other attributes are lower case. And // Legiondale_Superman can't seem to get it right... - if (vID.vt == VT_NULL ) { - vID = pElement->getAttribute( _T( "id" ) ); - } + if (vID.vt == VT_NULL ) { + vID = pElement->getAttribute( _T( "id" ) ); + } - long nRealID = ( vID.vt == VT_NULL ) ? nID : static_cast< long >( vID ); - *pAssignedID = nRealID; + long nRealID = ( vID.vt == VT_NULL ) ? nID : static_cast< long >( vID ); + *pAssignedID = nRealID; - POINT pt = { ( vLeft.vt != VT_NULL ) ? static_cast< long >( vLeft ) : 0, - ( vTop.vt != VT_NULL ) ? static_cast< long >( vTop ) : 0 }; + POINT pt = { ( vLeft.vt != VT_NULL ) ? static_cast< long >( vLeft ) : 0, + ( vTop.vt != VT_NULL ) ? static_cast< long >( vTop ) : 0 }; - LayerParams lp = { nRealID, { pt.x, pt.y, pt.x + ( ( vWidth.vt != VT_NULL ) ? static_cast< long >( vWidth ) : 0 ), - pt.y + ( ( vHeight.vt != VT_NULL ) ? static_cast< long >( vHeight ) : 0 ) }, - ( vUnclipped.vt != VT_NULL ) ? 0 : eRenderClipped }; + LayerParams lp = { nRealID, { pt.x, pt.y, pt.x + ( ( vWidth.vt != VT_NULL ) ? static_cast< long >( vWidth ) : 0 ), + pt.y + ( ( vHeight.vt != VT_NULL ) ? static_cast< long >( vHeight ) : 0 ) }, + ( vUnclipped.vt != VT_NULL ) ? 0 : eRenderClipped }; - pParent->CreateChild( &lp, pChildLayer ); + pParent->CreateChild( &lp, pChildLayer ); - // Check if this child is named - _variant_t vName = pElement->getAttribute( _T( "name" ) ); + // Check if this child is named + _variant_t vName = pElement->getAttribute( _T( "name" ) ); - if( vName.vt == VT_BSTR ) - { - // Add the named control - CComPtr< IControl > pControl; - pChildLayer->QueryInterface( &pControl ); - putref_Control( vName.bstrVal, pControl ); - } + if( vName.vt == VT_BSTR ) + { + // Add the named control + CComPtr< IControl > pControl; + pChildLayer->QueryInterface( &pControl ); + putref_Control( vName.bstrVal, pControl ); + } - // Ok, the child is made - trick it into loading it's own parameters - CComPtr< ILayerSchema > pSchema; + // Ok, the child is made - trick it into loading it's own parameters + CComPtr< ILayerSchema > pSchema; - if( SUCCEEDED( pChildLayer->QueryInterface( &pSchema ) ) ) - pSchema->SchemaLoad( this, pSource ); + if( SUCCEEDED( pChildLayer->QueryInterface( &pSchema ) ) ) + pSchema->SchemaLoad( this, pSource ); return S_OK; } @@ -308,32 +308,32 @@ m_pPanel->get_ActiveView( &nPreviousView ); m_pPanel->RemoveView( m_nViewID ); - CComPtr< IUnknown > pRootControl; - loadSchema( strXMLSchema, &pRootControl ); + CComPtr< IUnknown > pRootControl; + loadSchema( strXMLSchema, &pRootControl ); - // Set the bar params - m_pRoot->m_pBars->put_Bar( m_nViewID, &m_VP ); + // Set the bar params + m_pRoot->m_pBars->put_Bar( m_nViewID, &m_VP ); - long lViewFlags = 0; + long lViewFlags = 0; - if( m_bTransparent ) - lViewFlags |= eTransparent; + if( m_bTransparent ) + lViewFlags |= eTransparent; - // Last, create all the controls - m_pPanel->LoadViewEx( m_nViewID, this, pRootControl, lViewFlags ); + // Last, create all the controls + m_pPanel->LoadViewEx( m_nViewID, this, pRootControl, lViewFlags ); - if( nPreviousView == m_nViewID ) - // Reactivate the view - m_pRoot->SelectBar( m_nViewID ); + if( nPreviousView == m_nViewID ) + // Reactivate the view + m_pRoot->SelectBar( m_nViewID ); return S_OK; } STDMETHODIMP cView::get_Title(BSTR *pVal) { - USES_CONVERSION; + USES_CONVERSION; - *pVal = OLE2BSTR( m_VP.label ); + *pVal = OLE2BSTR( m_VP.label ); return S_OK; } @@ -360,41 +360,41 @@ STDMETHODIMP cView::SetIcon(long icon, VARIANT iconlibrary) { - USES_CONVERSION; + USES_CONVERSION; - m_VP.icon = icon; + m_VP.icon = icon; - switch( iconlibrary.vt ) - { - case VT_ERROR: - case VT_EMPTY: - case VT_NULL: - m_VP.iconLibrary = 0; - break; + switch( iconlibrary.vt ) + { + case VT_ERROR: + case VT_EMPTY: + case VT_NULL: + m_VP.iconLibrary = 0; + break; - case VT_BSTR: - m_VP.iconLibrary = reinterpret_cast< long >( ::GetModuleHandle( OLE2T( iconlibrary.bstrVal ) ) ); - break; + case VT_BSTR: + m_VP.iconLibrary = reinterpret_cast< long >( ::GetModuleHandle( OLE2T( iconlibrary.bstrVal ) ) ); + break; - default: - // Try and convert everything else to a number - try - { - _variant_t v = iconlibrary; - m_VP.iconLibrary = v; - } - catch( ... ) - { - m_VP.iconLibrary = 0; - return E_INVALIDARG; - } + default: + // Try and convert everything else to a number + try + { + _variant_t v = iconlibrary; + m_VP.iconLibrary = v; + } + catch( ... ) + { + m_VP.iconLibrary = 0; + return E_INVALIDARG; + } - break; - } + break; + } - m_pRoot->m_pBars->put_Bar( m_nViewID, &m_VP ); - - return S_OK; + m_pRoot->m_pBars->put_Bar( m_nViewID, &m_VP ); + + return S_OK; } STDMETHODIMP cView::Activate() @@ -421,15 +421,63 @@ STDMETHODIMP cView::put_Position(RECT *newVal) { - m_VP.left = newVal->left; + m_VP.left = newVal->left; m_VP.top = newVal->top; m_VP.width = newVal->right; m_VP.height = newVal->bottom; - long nActiveView; - m_pPanel->get_ActiveView( &nActiveView ); + /* Drakier: make sure they aren't being bad little kittens and + moving the view offscreen! */ + // Drakier: Get the pSite and Screen Size + + CComPtr< IPluginSite > pPlugin; + CComPtr< IACHooks > pHooks; + m_pRoot->m_pSite->get_PluginSite( &pPlugin ); + + SIZE szScreen, sz; + pPlugin->GetScreenSize( &sz ); + szScreen.cx = sz.cx; + szScreen.cy = sz.cy; + + long lX = sz.cx, lY = sz.cy; + + // Drakier: if we are not in the container, get the 3D Area + if ( !cManager::_p->m_bContainer ) + { + pPlugin->get_Hooks( &pHooks ); + pHooks->get_Area3DHeight( &lY ); + pHooks->get_Area3DWidth( &lX ); + pHooks.Release(); + } + pPlugin.Release(); + + // Drakier: if we are in the container, or the 3D area's are NULL + if ( (cManager::_p->m_bContainer) || (&lX == NULL) || (&lY == NULL) ) + { + szScreen.cx = sz.cx - 308; // 308 = PANEL_SIZE + szScreen.cy = sz.cy; + } + else // Drakier: If everything comes out right and we are not in container + { + if( (&lX != NULL) && (lX > 0) && (lX < 5000) ) + szScreen.cx = lX; + if( (&lY != NULL) && (lY > 0) && (lY < 5000) ) + szScreen.cy = lY; + } + + if ( m_VP.left < 0 ) + m_VP.left = 0; + if ( m_VP.top < 0 ) + m_VP.top = 0; + if ( (m_VP.left + m_VP.width) > szScreen.cx ) + m_VP.left = szScreen.cx - m_VP.width; + if ( (m_VP.top + m_VP.height) > szScreen.cy ) + m_VP.top = szScreen.cy - m_VP.height; + + long nActiveView; + m_pPanel->get_ActiveView( &nActiveView ); - if( nActiveView == m_nViewID ) + if( nActiveView == m_nViewID ) m_pPanel->ActivateView(m_nViewID, &m_VP, (long*)this); return S_OK; @@ -465,10 +513,10 @@ m_VP.alpha = Alpha; - long nActiveView; - m_pPanel->get_ActiveView( &nActiveView ); - - if( nActiveView == m_nViewID ) + long nActiveView; + m_pPanel->get_ActiveView( &nActiveView ); + + if( nActiveView == m_nViewID ) m_pPanel->ActivateView(m_nViewID, &m_VP, (long*)this); return S_OK; |