当前位置: 首页>>代码示例>>C++>>正文


C++ DocView::SetCurrent方法代码示例

本文整理汇总了C++中DocView::SetCurrent方法的典型用法代码示例。如果您正苦于以下问题:C++ DocView::SetCurrent方法的具体用法?C++ DocView::SetCurrent怎么用?C++ DocView::SetCurrent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DocView的用法示例。


在下文中一共展示了DocView::SetCurrent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DoExport

BOOL ThumbnailFilterPNG::DoExport(Operation* pOp, CCLexFile* pFile, PathName* pPath, 
								Document* TheDocument, BOOL ShowOptions)
{
	// set ourselves up - this flags the BaseBitmapFilter to do resizing, which needs to be
	// done there because of Accusoft.
	SetPreviewBitmap(TRUE);

	// create a new view for the document
	DocView *pView = new DocView(TheDocument);

	if (pView && pView->Init())
	{
		// set the view as current, but remember the last current one
		View *pOldView = View::GetCurrent();
		pView->SetCurrent();

		// Export the thumbnail to the file by doing what our base class does
		BOOL ok = PNGFilter::DoExport(pOp, pFile, pPath, TheDocument, TRUE);

		// restore the last view
		if (pOldView != NULL)
			pOldView->SetCurrent();
		else
			View::SetNoCurrent();

		// delete our view
		delete pView;

		return ok;
	}
	else
		return FALSE; // view creation failed
}
开发者ID:vata,项目名称:xarino,代码行数:33,代码来源:prvwflt.cpp

示例2: OnSize

void ScreenCamView::OnSize( wxSizeEvent &event )
{
	// This is called early, so if pDocView is null do nothing
	if( NULL == pDocView )
		return;

	SetCurrentStates();

	Document* pCurDoc = Document::GetCurrent();
	DocView* pCurView = DocView::GetCurrent();
	
	// these lines are here to stop very strange things happening on exit under Win32s
	// when this fn gets called when it really shouldn't. I would like to really know
	// just what on earth os going on under Win32s but it iss something strange in message
	// handling as far as I can tell.

	wxSize	size( event.GetSize() );

	// Check for irrelevant or potty messages.
	if (size.x <= 0 || size.y <= 0)
	{
//		TRACEUSER( "JustinF", _T("Strange size msg in ScreenView::OnSize(0x%X, %d, %d)\n"), 
//					nType, cx, cy);
		return;
	}

	// Handle OLE 2.0 in-place activation stuff.
#if (_OLE_VER >= 0x200)
	if(GetDocument())
	{
		COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
		if (pActiveItem) pActiveItem->SetItemRects();
	}	
#endif

	if (Status->ScrollersVisible)
	{
PORTNOTETRACE( "other", "ScreenCamView::OnSize - Removed scroller usage" );
#if !defined(EXCLUDE_FROM_XARALX)
		// Resize and reposition the proportional scrollers.
		wxRect hrect, vrect;
		HScrollBar->CalcPosFromParentClient(&hrect);

		UINT32 RulerWidth = OILRuler::GetWidth();
		//if rulers are switched on the scroll bars are made
		// smaller to accomodate them
		if (Status->RulersVisible)
			hrect.left += RulerWidth;
		if (RULER_BORDERS)
			hrect.left-=2;

		HScrollBar->MoveWindow(&hrect, TRUE);
		VScrollBar->CalcPosFromParentClient(&vrect);

		if (Status->RulersVisible)
			vrect.top += RulerWidth;
		if (RULER_BORDERS)
			vrect.top-=2;

		VScrollBar->MoveWindow(&vrect, TRUE);

 		// Reposition the corner window at the bottom-right.
		Corner->MoveWindow(vrect.left, hrect.top, vrect.Width(), hrect.Height());
	 
		// Resize/reposition the rendering window.
		CurrentSize.left = CurrentSize.top = 0;
		CurrentSize.right = cx - vrect.Width() + 1;
		CurrentSize.bottom = cy - hrect.Height() + 1;
#endif
	}
	else
	{	
		CurrentSize.x = CurrentSize.y = 0;
		CurrentSize.width  = size.x;
		CurrentSize.height = size.y;
	}

	if (Status->RulersVisible)
	{
PORTNOTETRACE( "other", "ScreenCamView::OnSize - Removed scroller / ruler usage" );
#if !defined(EXCLUDE_FROM_XARALX)
	 	wxRect hRect, vRect, oRect;

	 	HRuler->CalcPosFromParentClient(&hRect);
		HRuler->MoveWindow(&hRect, TRUE);
		HRuler->PositionLegend();
		
		CurrentSize.top = 0 + hRect.Height() ;
			
	 	VRuler->CalcPosFromParentClient(&vRect);
		VRuler->MoveWindow(&vRect, TRUE);
		CurrentSize.left = 0 + vRect.Width(); 

	 	OGadget->CalcPosFromParentClient(&oRect);
		OGadget->MoveWindow(&oRect, TRUE);
		if (RULER_BORDERS)
		{
			CurrentSize.top --;
			CurrentSize.left--; 
		}
//.........这里部分代码省略.........
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:101,代码来源:scrcamvw.cpp


注:本文中的DocView::SetCurrent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。