コード例 #1
0
ファイル: oledoc1.cpp プロジェクト: anyue100/winscp
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
ファイル: drawtool.cpp プロジェクト: markraz/hhhjjjff
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
ファイル: ManCtrlView.cpp プロジェクト: gaodong0537/MainCtrl
// 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
ファイル: ZDrOLE.cpp プロジェクト: DeegC/ZeidonTools
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
ファイル: CntrItem.cpp プロジェクト: CheryJazz/gkEngine
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
ファイル: rectitem.cpp プロジェクト: jetlive/skiaming
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
ファイル: drawtool.cpp プロジェクト: markraz/hhhjjjff
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
ファイル: oledoc1.cpp プロジェクト: jbeaurain/omaha_vs2010
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
ファイル: drawtool.cpp プロジェクト: markraz/hhhjjjff
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;
}