Пример #1
0
void COleDocument::PreCloseFrame(CFrameWnd* pFrameArg)
{
	ASSERT_VALID(this);
	ASSERT_VALID(pFrameArg);

	// turn off redraw so the user doesn't see the deactivation happening
	BOOL bSetRedraw = FALSE;
	if (pFrameArg->GetStyle() & WS_VISIBLE)
	{
		pFrameArg->SendMessage(WM_SETREDRAW, (WPARAM)FALSE);
		bSetRedraw = TRUE;
	}

	// deactivate any inplace active items on this frame
	COleClientItem* pItem = GetInPlaceActiveItem(pFrameArg);
	if (pItem != NULL)
	{
		pItem->Deactivate();
		pItem->Close(OLECLOSE_NOSAVE);
	}

	// turn redraw back on
	if (bSetRedraw)
		pFrameArg->SendMessage(WM_SETREDRAW, (WPARAM)TRUE);

	// should not have any inplace active items
	ASSERT(GetInPlaceActiveItem(pFrameArg) == NULL);
}
Пример #2
0
void CDrawTool::ourDrawAttri(CDrawView* pView, const CPoint& point,const CPoint& centre, const CString &attrName)
{
	COleClientItem* pActiveItem = pView->GetDocument()->GetInPlaceActiveItem(pView);
	if (pActiveItem != NULL)
	{
		pActiveItem->Close();
		ASSERT(pView->GetDocument()->GetInPlaceActiveItem(pView) == NULL);
	}
	//pView->SetCapture();
	//c_down = point;
	//c_last = point;
	CPoint local;
	local.SetPoint(point.x,point.y);
	//pView->ClientToDoc(local);
	local.Offset(-20,20);
	CDrawRect* pObj =  new CDrawRect(CRect(local, centre),(CString)"");
	pObj->m_nShape = CDrawRect::line;
	pView->GetDocument()->Add(pObj);
	pView->Select(pObj);
	pView->OnObjectMoveToBack();
	local.Offset(20,-20);
	pObj =new CDrawRect(CRect(local, CSize(-60, 40)),attrName);
	pObj->m_nShape = CDrawRect::ellipse;
	pView->GetDocument()->Add(pObj);
	pView->Select(pObj);
	CDrawTool::c_drawShape = selection;

}
Пример #3
0
// The following command handler provides the standard keyboard
//  user interface to cancel an in-place editing session.  Here,
//  the container (not the server) causes the deactivation.
void CMy1553View::OnCancelEditCntr()
{
    // Close any in-place active item on this view.
    COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
    if (pActiveItem != NULL)
    {
        pActiveItem->Close();
    }
    ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
}
Пример #4
0
void
ZDrOleClient::OnActivate( )
{
   // Allow only one inplace activate item per frame
   COleClientItem* pItem = GetDocument( )->GetInPlaceActiveItem( GetParentView() );
   if ( pItem && pItem != this )
      pItem->Close( );

   COleClientItem::OnActivate( );
}
Пример #5
0
// 以下命令处理程序提供了标准键盘
//  用户界面以取消就地编辑会话。此处,
//  容器(而不是服务器)将导致停用
void CClientView::OnCancelEditCntr()
{
	// 关闭此视图中的任何就地活动项。
	COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
	if (pActiveItem != NULL)
	{
		pActiveItem->Close();
	}
	ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
}
Пример #6
0
void CMyExplorerCntrItem::OnActivate()
{
    // Allow only one inplace activate item per frame
    CMyExplorerView* pView = GetActiveView();
    ASSERT_VALID(pView);
    COleClientItem* pItem = GetDocument()->GetInPlaceActiveItem(pView);
    if (pItem != NULL && pItem != this)
        pItem->Close();
    
    COleClientItem::OnActivate();
}
Пример #7
0
void CRibbonSampleCntrItem::OnActivate()
{
	// allow only one inplace active item per frame
	CView* pView = GetActiveView();
	ASSERT_VALID(pView);
	COleClientItem* pItem = GetDocument()->GetInPlaceActiveItem(pView);
	if (pItem != NULL && pItem != this)
		pItem->Close();

	ActiveStateChanged(TRUE);

	COleClientItem::OnActivate();
}
Пример #8
0
void CRectItem::OnActivate()
{
	// allow only one inplace active item per frame
	CMainView* pView = GetActiveView();
	ASSERT_VALID(pView);
	COleClientItem* pItem = GetDocument()->GetInPlaceActiveItem(pView);
	if (pItem != NULL && pItem != this)
		pItem->Close();

	COleClientItem::OnActivate();

	// set selection to an item when it becomes active
	pView->SetSelection(this);
}
Пример #9
0
void CDrawTool::OnLButtonDown(CDrawView* pView, UINT nFlags, const CPoint& point)
{
	// deactivate any in-place active item on this view!
	COleClientItem* pActiveItem = pView->GetDocument()->GetInPlaceActiveItem(pView);
	if (pActiveItem != NULL)
	{
		pActiveItem->Close();
		ASSERT(pView->GetDocument()->GetInPlaceActiveItem(pView) == NULL);
	}

	pView->SetCapture();
	c_nDownFlags = nFlags;
	c_down = point;
	c_last = point;
}
Пример #10
0
void COleDocument::PreCloseFrame(CFrameWnd* pFrameArg)
{
	ASSERT_VALID(this);
	ASSERT_VALID(pFrameArg);

	// deactivate any inplace active items on this frame
	COleClientItem* pItem = GetInPlaceActiveItem(pFrameArg);
	if (pItem != NULL)
	{
		pItem->Deactivate();
		pItem->Close(OLECLOSE_NOSAVE);
	}

	// should not have any inplace active items
	ASSERT(GetInPlaceActiveItem(pFrameArg) == NULL);
}
Пример #11
0
void CDrawTool::ourDrawRelation(CDrawView* pView, const CPoint& entryPoint,const CPoint& point, const CString &Name)
{
	COleClientItem* pActiveItem = pView->GetDocument()->GetInPlaceActiveItem(pView);
	if (pActiveItem != NULL)
	{
		pActiveItem->Close();
		ASSERT(pView->GetDocument()->GetInPlaceActiveItem(pView) == NULL);
	}
	CPoint local;
	local.SetPoint(point.x,point.y);
	CDrawRect* pObj =  new CDrawRect(CRect(entryPoint, local),Name);
	pObj->m_nShape = CDrawRect::line;
	pView->GetDocument()->Add(pObj);
	pView->Select(pObj);
	pView->OnObjectMoveToBack();
	CDrawTool::c_drawShape = selection;
}