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


C++ CDisplay类代码示例

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


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

示例1: connect

void CWorkspaceViewsDialog::Wire()
{
    //	Setup things

	connect( mViewsListWidget, SIGNAL( itemActivated(QListWidgetItem*) ), this, SLOT( accept() ) );

	connect( mButtonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
	connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );

	auto displays = mModel.Workspace< CWorkspaceDisplay >()->GetDisplays();
	for ( auto const &display_entry : *displays )
	{
		CDisplay *display = dynamic_cast<CDisplay*>( display_entry.second );							assert__( display );
		auto v = display->GetOperations();
		if ( v.size() == 0 )				//old workspace ?
			continue;

		QListWidgetItem *item = new QListWidgetItem( display->GetName().c_str(), mViewsListWidget );
		std::string tip = 
			display->IsZLatLonType() ? "Type: map" : ( display->IsZYFXType() ? "Type: Z=F(X,Y)" : "Type: Y=F(X)" );
		std::string operation_names;
		for ( auto *op : v )
		{
			operation_names	+= ( "\n\t" + op->GetName() );
		}
		if ( !operation_names.empty() )
		{
			tip += ( "\nOperation:" + operation_names );
		}
		item->setToolTip( tip.c_str() );
	}
	mViewsListWidget->setCurrentRow( 0 );
}
开发者ID:BRAT-DEV,项目名称:main,代码行数:33,代码来源:WorkspaceViewsDialog.cpp

示例2: Assert

void UIMachineView::cleanupFrameBuffer()
{
    if (m_pFrameBuffer)
    {
        /* Process pending frame-buffer resize events: */
        QApplication::sendPostedEvents(this, VBoxDefs::ResizeEventType);
#ifdef VBOX_WITH_VIDEOHWACCEL
        if (m_fAccelerate2DVideo)
        {
            /* When 2D is enabled we do not re-create Framebuffers. This is done to
             * 1. avoid 2D command loss during the time slot when no framebuffer is assigned to the display
             * 2. make it easier to preserve the current 2D state */
            Assert(m_pFrameBuffer == uisession()->frameBuffer(screenId()));
            m_pFrameBuffer->setView(NULL);
#ifdef VBOX_WITH_CROGL
            /* Call SetFramebuffer to ensure 3D gets notified of view being destroyed */
            CDisplay display = session().GetConsole().GetDisplay();
            display.SetFramebuffer(m_uScreenId, CFramebuffer(m_pFrameBuffer));
#endif
        }
        else
#endif /* VBOX_WITH_VIDEOHWACCEL */
        {
            /* Warn framebuffer about its no more necessary: */
            m_pFrameBuffer->setDeleted(true);
            /* Detach framebuffer from Display: */
            CDisplay display = session().GetConsole().GetDisplay();
            display.SetFramebuffer(m_uScreenId, CFramebuffer(NULL));
            /* Release the reference: */
            m_pFrameBuffer->Release();
//          delete m_pFrameBuffer; // TODO_NEW_CORE: possibly necessary to really cleanup
            m_pFrameBuffer = NULL;
        }
    }
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:35,代码来源:UIMachineView.cpp

示例3: DebugPrintf

void UISingleTextInputDialog::MoveWindow(int _iLeft, int _iTop, int _iWidth, int _iHeight)
{
    DebugPrintf(DLC_UISINGLETEXTINPUTDLG, "%s, %d, %s, %s START", __FILE__,  __LINE__, GetClassName(), __FUNCTION__);
    CDisplay* pDisplay = CDisplay::GetDisplay();
    if (pDisplay)
    {
        _iWidth = m_DEFAULT_WIDTH;
        _iHeight = m_DEFAULT_HEIGHT;
        _iLeft = (pDisplay->GetScreenWidth() - _iWidth) >> 1;
        _iTop = 200;
    }
    UIWindow::MoveWindow(_iLeft, _iTop, _iWidth, _iHeight);

    int iTop = m_DEFAULT_MARGIN;
    int iLeft = m_DEFAULT_MARGIN;
    int iWidth = m_iWidth - (m_DEFAULT_MARGIN << 1);
    m_txtPasswordHintLabel.MoveWindow (iLeft, iTop, iWidth, m_DEFAULT_ELEMHEIGHT);
    iTop += m_DEFAULT_ELEMHEIGHT + m_DEFAULT_ELEMSPACING;
    
    m_tbPassword.MoveWindow(iLeft, iTop, iWidth, m_DEFAULT_ELEMHEIGHT);
    iTop += (m_DEFAULT_ELEMHEIGHT + m_DEFAULT_ELEMSPACING);
    
    if(m_iDialogType == Type_Default)
    {
        const int iBtnWidth = (iWidth - m_DEFAULT_ELEMSPACING) >> 1;
        m_btnCancel.MoveWindow(iLeft, iTop, iBtnWidth, m_DEFAULT_ELEMHEIGHT);
        iLeft += iBtnWidth + m_DEFAULT_ELEMSPACING;

        m_btnOK.MoveWindow(iLeft, iTop, iBtnWidth, m_DEFAULT_ELEMHEIGHT);
    }
    else if(m_iDialogType == Type_AddLabel)
开发者ID:chenhbzl,项目名称:OriginApp,代码行数:31,代码来源:UISingleTextInputDialog.cpp

示例4: uisession

void UIMachineView::sltMachineStateChanged()
{
    /* Get machine state: */
    KMachineState state = uisession()->machineState();
    switch (state)
    {
        case KMachineState_Paused:
        case KMachineState_TeleportingPausedVM:
        {
            if (   vboxGlobal().vmRenderMode() != VBoxDefs::TimerMode
                && m_pFrameBuffer
                &&
                (   state           != KMachineState_TeleportingPausedVM
                 || m_previousState != KMachineState_Teleporting))
            {
                takePauseShotLive();
                /* Fully repaint to pick up m_pauseShot: */
                viewport()->update();
            }
            break;
        }
        case KMachineState_Restoring:
        {
            /* Only works with the primary screen currently. */
            if (screenId() == 0)
            {
                takePauseShotSnapshot();
                /* Fully repaint to pick up m_pauseShot: */
                viewport()->update();
            }
            break;
        }
        case KMachineState_Running:
        {
            if (   m_previousState == KMachineState_Paused
                || m_previousState == KMachineState_TeleportingPausedVM
                || m_previousState == KMachineState_Restoring)
            {
                if (vboxGlobal().vmRenderMode() != VBoxDefs::TimerMode && m_pFrameBuffer)
                {
                    /* Reset the pixmap to free memory: */
                    resetPauseShot();
                    /* Ask for full guest display update (it will also update
                     * the viewport through IFramebuffer::NotifyUpdate): */
                    CDisplay dsp = session().GetConsole().GetDisplay();
                    dsp.InvalidateAndUpdate();
                }
            }
            break;
        }
        default:
            break;
    }

    m_previousState = state;
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:56,代码来源:UIMachineView.cpp

示例5: QImage

void UIMachineViewScale::takePauseShotLive()
{
    /* Take a screen snapshot. Note that TakeScreenShot() always needs a 32bpp image: */
    QImage shot = QImage(m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32);
    /* If TakeScreenShot fails or returns no image, just show a black image. */
    shot.fill(0);
    CDisplay dsp = session().GetConsole().GetDisplay();
    dsp.TakeScreenShot(screenId(), shot.bits(), shot.width(), shot.height());
    m_pPauseImage = new QImage(shot);
    scalePauseShot();
}
开发者ID:etiago,项目名称:vbox,代码行数:11,代码来源:UIMachineViewScale.cpp

示例6: while

///////////////////////////////////////
// FindOtherNote: 用于回溯 寻找另一个节点 
// 参数:当前G值
// 返回值:是否找到新节点
///////////////////////////////////////
BOOL CMain::FindOtherNote(int CurrentG)
{
	POSITION pos = m_DispList.GetTailPosition();
	while(pos)
	{
		CDisplay *Item = (CDisplay *)m_DispList.GetPrev(pos);
		if(Item->GetCurrentG() != CurrentG) continue;//没有到当前层
		if(Item->GetNoteType() != NotYet) continue;//当前结点不是没有被扩展的结点
		m_CurOpItem = Item;
		return TRUE;
	}
	return FALSE;
}
开发者ID:WenyuChang,项目名称:8PuzzleProblem,代码行数:18,代码来源:Main.cpp

示例7: DebugPrintf

void UIFootNoteDialog::MoveWindow(int left, int top, int width, int height)
{
    DebugPrintf(DLC_UIFOOTNOTEDIALOG, "%s:%d:%s  %s start", __FILE__, __LINE__, __FUNCTION__, GetClassName());
    CDisplay* pDisplay = CDisplay::GetDisplay();
    if (pDisplay)
    {
        left = (pDisplay->GetScreenWidth() - m_maxWidth) >> 1;
    }
    UIWindow::MoveWindow(left, top, m_maxWidth, height);
    m_bottomSizer->Show(m_totalPage > 1);

    Layout();
    DebugPrintf(DLC_UIFOOTNOTEDIALOG, "%s:%d:%s  %s end", __FILE__, __LINE__, __FUNCTION__, GetClassName());
}
开发者ID:chenhbzl,项目名称:OriginApp,代码行数:14,代码来源:UIFootNoteDialog.cpp

示例8: QImage

void UIMachineView::takePauseShotLive()
{
    /* Take a screen snapshot. Note that TakeScreenShot() always needs a 32bpp image: */
    QImage shot = QImage(m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32);
    /* If TakeScreenShot fails or returns no image, just show a black image. */
    shot.fill(0);
    CDisplay dsp = session().GetConsole().GetDisplay();
    dsp.TakeScreenShot(screenId(), shot.bits(), shot.width(), shot.height());
    /* TakeScreenShot() may fail if, e.g. the Paused notification was delivered
     * after the machine execution was resumed. It's not fatal: */
    if (dsp.isOk())
        dimImage(shot);
    m_pauseShot = QPixmap::fromImage(shot);
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:14,代码来源:UIMachineView.cpp

示例9: Game

int Game()
{
    int x = 0;
    int y = 0;
    CDisplay GameDisplay;//sets up the display object for curses
    Player playerONE(1);
    Enemy EnemyONE(1);
    //sets up time layout for 1 seconds
    // struct timespec tim,tim2;
    // tim.tv_sec = 0;
    // tim.tv_nsec = 50000000L;

    while(play == true)
    {

        clear();
        GameDisplay.init_StatusBar(0,playerONE);
        GameDisplay.Display(WinWidth,WinHeight,x,y,26,13,Map[maplocation]);
        //GameDisplay.DebugScreen(x,y,Map1);
        //GameDisplay.Message(WinWidth/6,(4*WinHeight)/5,(2*WinWidth)/3,WinHeight/5,"Hello young one, i am a traveler from a different land, please help me and I will give you a magic ball");
        //GameDisplay.Message(0,0,WinWidth,WinHeight,"abcdefghijklmnopqrstuvwxyz");
        GameDisplay.init_Border(Displaycenset);
        //GameDisplay.Message("test");
        Move(x,y,26,13,Map[maplocation]);
        // nanosleep(&tim,&tim2);

        if(BattleMode == true)
        {
            Battle battle1;
            battle1.StartBattle(playerONE,EnemyONE);
        }

        if(DungeonMode == true)
        {
            Dungeon Dungeon1;
            Dungeon1.StartDungeon(playerONE,1);
        }

        if(AutoDisplay==true)
        {
            getmaxyx(stdscr,WinHeight,WinWidth);
        }
        refresh();//refreshes the screen
        //GameDisplay.wait(10000);
    }

    return 0;
}
开发者ID:Reiuiji,项目名称:Outer-World,代码行数:48,代码来源:Game.cpp

示例10: OnLButtonDown

void CPointTool::OnLButtonDown(_CVIEW * pView, UINT nFlags, CPoint& point)
{
	CMiniCADDoc* pDoc = pView->GetDocument();
	if (pDoc==NULL)return;
	CADGraphics	*pGraphics = &pDoc->m_Graphics;
	CDisplay *pDisplay = pGraphics->m_pDisplay;
	if (pDisplay == NULL) return;
	CADPoint* pPoint;
	pPoint=new CADPoint();
	ADPOINT adPoint=pDoc->m_Graphics.ClientToDoc(point);
	pPoint->pt=adPoint;
	pPoint->m_nLayer=pDoc->m_LayerGroup.indexOf(pDoc->m_curLayer);
	pDoc->m_Graphics.m_Entities.Add((CObject*)pPoint);
	pDoc->m_Graphics.DrawGraphics(pDisplay->GetDC(),pPoint);
	pView->ReBitBlt();
	CDrawTool::OnLButtonDown(pView, nFlags, point);
}
开发者ID:yaoyushun,项目名称:sdcad,代码行数:17,代码来源:PointTool.cpp

示例11: IsReadyExist

///////////////////////////////////////////
// FindBestMoveFlag:寻找最佳移动方式 并移动之
// 入口: GenerateChild();
// 参数:子节点集
// 返回值:错误代码
//////////////////////////////////////////
UINT CMain::FindBestMoveFlag(List *pList)
{
	//计算移动后是否有重复项 重复项不参加最佳选择运算
	IsReadyExist(pList);
	//在没有出现过移动结果中选择最佳解
	POSITION Pos = pList->GetHeadPosition();
	int H[4]={65535,65535,65535,65535},i=0,Min = 65535;
	POSITION MinPos;
	while(Pos)
	{
	 POSITION CurPos = Pos;
	 CDisplay *Item = (CDisplay *)pList->GetNext(Pos);
	 if(Item->GetNoteType() == AlReady) {i++;continue;}
	 H[i] = CaculateH(Item);
	 if(Min>H[i]) {Min=H[i];MinPos = CurPos;}
	 i++;
	}
	
	if(Min == 65535)
	{/*
	 //没有找到最佳方法 表示这个结点所有子项都已扩展。要回溯
	 //但在本程序中 由于输入值一定有解,可以不要回溯
	 for(int CurrentG = this->m_CurrentG;CurrentG>0;CurrentG--)
	  if(FindOtherNote(CurrentG)) return NoError;//找到了另一个未扩展的结点返回
	 */
		return ErrorCode;//没有未扩展的结点了 本题无解
	}	

	//标记最佳解
	Pos = pList->GetHeadPosition();
	while(Pos)
	{
	 POSITION CurPos = Pos;
	 CDisplay *Item = (CDisplay *)m_DispList.GetNext(Pos);
	 if(CurPos == MinPos) 
	 {
	  Item->SetThisIsAAnswer();//是解
	  Item->SetNoteType(AlReady);//被扩展
	  m_CurOpItem = Item;
	 }
	 m_DispList.AddTail(Item);
	}
	return NoError;
}
开发者ID:WenyuChang,项目名称:8PuzzleProblem,代码行数:50,代码来源:Main.cpp

示例12: SafeDeletePointer

void WebBrowserLauncher::ShowBlockUITip()
{
	CDisplay::CacheDisabler forceDraw;
	if(m_msgBoxTip)
	{
		SafeDeletePointer(m_msgBoxTip);
	}
	m_msgBoxTip = new UIMessageBox(GUISystem::GetInstance()->GetTopFullScreenContainer(), StringManager::GetStringById(WEBBROSER_START), MB_WITHOUTBTN);
	m_msgBoxTip->SetTipText(StringManager::GetStringById(WEBBROSER_START_TIP));
	m_msgBoxTip->SetEnableHookTouch(true);
	UIText* displayText = m_msgBoxTip->GetTextDisplay();
	displayText->SetAlign(ALIGN_CENTER);
	displayText->SetFontSize(GetWindowFontSize(FontSize24Index));

	UIText* tipText = m_msgBoxTip->GetTextTip();
	tipText->SetFontSize(GetWindowFontSize(FontSize16Index));
	tipText->SetAlign(ALIGN_CENTER);
    m_msgBoxTip->Popup();

	CDisplay* display = CDisplay::GetDisplay();
    display->ForceDraw(PAINT_FLAG_FULL);
}
开发者ID:chenhbzl,项目名称:OriginApp,代码行数:22,代码来源:WebBrowserUtil.cpp

示例13: OnLButtonUp

void CPanTool::OnLButtonUp(_CVIEW* pView, UINT nFlags, CPoint& point)
{
	CMiniCADDoc* pDoc = pView->GetDocument();
	if (pDoc==NULL)return;
	CADGraphics	*pGraphics = &pDoc->m_Graphics;
	CDisplay *pDisplay = pGraphics->m_pDisplay;
	if (pDisplay == NULL) return;
	double ddx,ddy;
	int dx,dy;
	dx = point.x - c_PtDown.x;
	dy = point.y - c_PtDown.y;
	if (pView->m_curWorkSpace==MODELSPACE)
	{
		ddx = dx/pDoc->m_Graphics.m_ZoomRate;
		ddy = dy/pDoc->m_Graphics.m_ZoomRate;
		pDoc->m_Graphics.m_Bound.Offset(-ddx,-ddy);
		pView->ReDraw();
	}
	else
	{
		CDC* pPaperDC=pDisplay->GetPaperDC();
		ddx = dx/pDoc->m_Graphics.m_ZoomRate;
		ddy = dy/pDoc->m_Graphics.m_ZoomRate;
		pDoc->m_Graphics.m_Bound.Offset(-ddx,-ddy);

		CPoint point1;
		point1 = pDoc->m_Graphics.DocToClient(pView->m_RotatePt);
		pDoc->m_Graphics.RotateAll(pDisplay->GetDC(),point1,-(int)pDoc->m_Graphics.m_RotateAngle);

		//pDoc->m_Graphics.DrawGraphics(m_pDisplay->GetDC());
		pPaperDC->BitBlt(pView->m_ModelRect.left,pView->m_ModelRect.top,pView->m_ModelRect.Width(),pView->m_ModelRect.Height(),pDisplay->GetDC(),0,0,SRCCOPY);	
		pView->Invalidate(false);			
	}
	
	CDrawTool::OnLButtonUp(pView, nFlags, point);
}
开发者ID:yaoyushun,项目名称:sdcad,代码行数:36,代码来源:PanTool.cpp

示例14: Draw

bool Sprite::Draw(CDisplay& displayref)
{
	if(!mSurf)
		return false;
	POINT pt;
	pt.x = (long)mXOrigin;
	pt.y = (long)mYOrigin;
	RECT copyfromrect = GetCurrentRectToDraw(displayref);
	if(pt.x < 0)
		pt.x = 0;
	if(pt.y < 0)
		pt.y = 0;
	displayref.ColorKeyBlt(pt.x, pt.y, mSurf, &copyfromrect);
	return true;
}
开发者ID:agentcox,项目名称:TrainingCentreGame,代码行数:15,代码来源:Sprite.cpp

示例15: Initialize

void TimerUnit::Initialize(int LargeNumberSpriteID, int SmallNumberSpriteID, int CasingSpriteID, int CaptionFontID)
{
	LargeNumberSprite.InitializeSpriteCopy(GetGlobalSpriteData(LargeNumberSpriteID));
	SmallNumberSprite.InitializeSpriteCopy(GetGlobalSpriteData(SmallNumberSpriteID));
	CasingSprite.InitializeSpriteCopy(GetGlobalSpriteData(CasingSpriteID));
	CaptionFont = GetFontBySizeIndex(CaptionFontID);

	

	//NOW WE MUST FIGURE OUT WHERE TO PUT EVERYTHING.
	//FIRST, THE CASING.
	RECT Client;
	GetClientRect(TheDisplay.GetHWnd(), &Client);
	AbsCasingOrigin.x = ((Client.right - Client.left) / 2) - (CasingSprite.GetWidth() / 2) + 100;
	AbsCasingOrigin.y = CasingSprite.GetHeight() * -1;
	CasingSprite.SetLoc(AbsCasingOrigin); 
	RelCaptionOrigin.y = CasingSprite.GetHeight();
	SetCaption("TIMER");
	//TIME HEIGHT AND WIDTH
	RelTimeOrigin.y = 13;
	//5 BIG DIGITS AND 3 SMALL ONES
	int TimeWidth = 5 * LargeNumberSprite.GetWidth() + 3 * SmallNumberSprite.GetWidth();
	RelTimeOrigin.x = (CasingSprite.GetWidth() / 2);
	RelTimeOrigin.x -= (TimeWidth / 2);
	//ALL WIDTHS AND HEIGHTS ACCOUNTED FOR.
	Status = 3;
	
}
开发者ID:agentcox,项目名称:TrainingCentreGame,代码行数:28,代码来源:TimerUnit.cpp


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