BOOL ZDrOleClient::FinishCreate( SCODE sc ) { HRESULT hResult = 0; BOOL bReturn = COleClientItem::FinishCreate( sc ); // Determine whether we have to set the ClientSite first // by passing our IOleClientSite m_lpObject->GetMiscStatus( DVASPECT_CONTENT, &m_dwMiscStatus ); if ( m_dwMiscStatus & OLEMISC_SETCLIENTSITEFIRST ) { hResult = m_lpObject->SetClientSite( GetClientSite( ) ); if ( FAILED( hResult ) ) { bReturn = FALSE; } } if ( bReturn ) { if ( IsInvisibleAtRuntime() ) { DoVerb( OLEIVERB_HIDE, GetParentView() ); } else { DoVerb( OLEIVERB_SHOW, GetParentView() ); } } return( bReturn ); }
void ZDrOleClient::OnGetItemPosition( CRect& rPosition ) { ASSERT_VALID( this ); // During in-place activation, ZDrOleClient::OnGetItemPosition // will be called to determine the location of this item. The default // implementation created from AppWizard simply returns a hard-coded // rectangle. Usually, this rectangle would reflect the current // position of the item relative to the view used for activation. // You can obtain the view by calling ZDrOleClient::GetActiveView. // TODO: return correct rectangle (in pixels) in rPosition if ( m_bFullClient ) { CView *pParentView = GetParentView( ); if ( pParentView ) { pParentView->GetClientRect( &rPosition ); rPosition.left = m_pAttr->X; rPosition.top = m_pAttr->Y; } else rPosition = GetRect( ); } else { rPosition = GetRect( ); } }
void ZDrOleClient::OnActivate( ) { // Allow only one inplace activate item per frame COleClientItem* pItem = GetDocument( )->GetInPlaceActiveItem( GetParentView() ); if ( pItem && pItem != this ) pItem->Close( ); COleClientItem::OnActivate( ); }
void ZDrOleClient::OnDeactivate( BOOL bNoRedraw ) { if ( m_bWindowless ) { if ( ((ZDrView *)GetParentView())->GetItemWithFocus() == this ) { ((ZDrView *)GetParentView())->OnWindowlessReleaseFocus(); } m_bWindowless = FALSE; m_pOleInPlaceObjectWindowless->Release(); m_pOleInPlaceObjectWindowless = 0; } if ( !bNoRedraw ) { GetDocument()->UpdateAllViews( NULL, 1, this ); } COleClientItem::OnDeactivate(); }
void ZDrOleClient::OnDeactivateUI( BOOL bUndoable ) { m_pView = GetParentView(); COleClientItem::OnDeactivateUI( bUndoable ); // Hide the object if it is not an outside-in object DWORD dwMisc = 0; m_lpObject->GetMiscStatus( GetDrawAspect( ), &dwMisc ); if ( dwMisc & OLEMISC_INSIDEOUT ) DoVerb( OLEIVERB_HIDE, 0 ); }
BOOL ZDrOleClient::OnChangeItemPosition( const CRect& rectPos ) { ASSERT_VALID( this ); // During in-place activation ZDrOleClient::OnChangeItemPosition // is called by the server to change the position of the in-place // window. Usually, this is a result of the data in the server // document changing such that the extent has changed or as a result // of in-place resizing. // // The default here is to call the base class, which will call // COleClientItem::SetItemRects to move the item // to the new position. m_pView = GetParentView(); if ( COleClientItem::OnChangeItemPosition( rectPos ) == 0 ) return( FALSE ); // TODO: update any cache you may have of the item's rectangle/extent return( TRUE ); }
} } mLastPoint = points[0]; return true; } /** * Clones the control and returns the new instance */ Control* Table::Clone() { Table* pTable = OTTER_NEW(Table, ()); memcpy((uint8*)pTable->GetData(), (uint8*)GetData(), sizeof(TableData)); ((ControlData*)pTable->GetData())->mID = GetParentView()->GenerateNewID(); mParent->AddControl(pTable); pTable->mEnableScrolling = this->mEnableScrolling; uint32 numRows = GetNumRows(); for(uint32 i = 0; i < numRows; i++) { pTable->AddRow((Row*)GetRow(i)->Clone()); } return pTable; } /* Draws the Table to screen */