• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PopState函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: PushState

void
AppGroupView::_DrawCloseButton(const BRect& updateRect)
{
	PushState();
	BRect closeRect = fCloseRect;

	rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
	float tint = B_DARKEN_2_TINT;

	if (fCloseClicked) {
		BRect buttonRect(closeRect.InsetByCopy(-4, -4));
		be_control_look->DrawButtonFrame(this, buttonRect, updateRect,
			base, base,
			BControlLook::B_ACTIVATED | BControlLook::B_BLEND_FRAME);
		be_control_look->DrawButtonBackground(this, buttonRect, updateRect,
			base, BControlLook::B_ACTIVATED);
		tint *= 1.2;
		closeRect.OffsetBy(1, 1);
	}

	base = tint_color(base, tint);
	SetHighColor(base);
	SetPenSize(2);
	StrokeLine(closeRect.LeftTop(), closeRect.RightBottom());
	StrokeLine(closeRect.LeftBottom(), closeRect.RightTop());
	PopState();
}
开发者ID:garodimb,项目名称:haiku,代码行数:27,代码来源:AppGroupView.cpp


示例2: while

nsAccessibleTreeWalker::~nsAccessibleTreeWalker()
{
  // Clear state stack from memory
  while (NS_SUCCEEDED(PopState()))
    /* do nothing */ ;
   MOZ_COUNT_DTOR(nsAccessibleTreeWalker);
}
开发者ID:mmadia,项目名称:bezilla,代码行数:7,代码来源:nsAccessibleTreeWalker.cpp


示例3: while

tGameEngine::~tGameEngine()
{
    while (m_States.empty() == false)
    {
        PopState();
    }
}
开发者ID:maxwellhouse,项目名称:SFML_Sandbox,代码行数:7,代码来源:GameEngine.cpp


示例4: Draw

	virtual void Draw(BRect updateRect)
	{
		BRegion region;
		region.Include(BRect(20, 20, 40, 40));
		region.Include(BRect(30, 30, 80, 80));
		ConstrainClippingRegion(&region);

		SetHighColor(55, 255, 128, 255);
		FillRect(BRect(0, 0, 100, 100));

		PushState();
			SetOrigin(15, 15);
	
			ConstrainClippingRegion(&region);
	
			SetHighColor(155, 255, 128, 255);
			FillRect(BRect(0, 0, 100, 100));
	
//			ConstrainClippingRegion(NULL);
	
			SetHighColor(0, 0, 0, 255);
			StrokeLine(BPoint(2, 2), BPoint(80, 80));
			SetHighColor(255, 0, 0, 255);
			StrokeLine(BPoint(2, 2), BPoint(4, 2));
		PopState();

		SetHighColor(0, 0, 0, 255);
		StrokeLine(BPoint(4, 2), BPoint(82, 80));
	}
开发者ID:mmanley,项目名称:Antares,代码行数:29,代码来源:main.cpp


示例5: get_current_theme_engine

void
BBox::Draw(BRect updateRect)
{
	if (!IsVisible() || fBorder == B_NO_BORDER) return;

	e_theme_engine *theme = get_current_theme_engine();
	if (theme == NULL || theme->get_border_margins == NULL || theme->draw_border == NULL) return;

	float l = 0, t = 0, r = 0, b = 0;
	theme->get_border_margins(theme, this, &l, &t, &r, &b, fBorder, PenSize());

	BRect rect = Frame().OffsetToSelf(B_ORIGIN);
	if (!(fLabelView == NULL || fLabelView->Frame().Width() <= 0 || fLabelView->Frame().Height() < t))
		rect.top += (fLabelView->Frame().Height() - t) / 2.f;

	PushState();

	BRegion clipping(updateRect);
	if (!(fLabelView == NULL || fLabelView->Frame().IsValid() == false)) clipping.Exclude(fLabelView->Frame());
	ConstrainClippingRegion(&clipping);

	if (clipping.CountRects() > 0) theme->draw_border(theme, this, rect, fBorder, PenSize());

	PopState();
}
开发者ID:D-os,项目名称:BeFree,代码行数:25,代码来源:Box.cpp


示例6: PushState

void VideoEngine::DrawGrid(float x, float y, float x_step, float y_step, const Color &c)
{
    PushState();

    Move(0, 0);

    float x_max = _current_context.coordinate_system.GetRight();
    float y_max = _current_context.coordinate_system.GetBottom();

    std::vector<GLfloat> vertices;
    int32 num_vertices = 0;
    for(; x <= x_max; x += x_step) {
        vertices.push_back(x);
        vertices.push_back(_current_context.coordinate_system.GetBottom());
        vertices.push_back(x);
        vertices.push_back(_current_context.coordinate_system.GetTop());
        num_vertices += 2;
    }
    for(; y < y_max; y += y_step) {
        vertices.push_back(_current_context.coordinate_system.GetLeft());
        vertices.push_back(y);
        vertices.push_back(_current_context.coordinate_system.GetRight());
        vertices.push_back(y);
        num_vertices += 2;
    }
    glColor4fv(&c[0]);
    DisableTexture2D();
    EnableVertexArray();
    glVertexPointer(2, GL_FLOAT, 0, &(vertices[0]));
    glDrawArrays(GL_LINES, 0, num_vertices);

    PopState();
}
开发者ID:IkarusDowned,项目名称:ValyriaTear,代码行数:33,代码来源:video.cpp


示例7: switch

void GameEngine::Escaper() //this should be done in seperate class if I'm correct?
{
	if(event.type == ALLEGRO_EVENT_KEY_DOWN) //this thing shouldn't be here imo
	{
		switch(event.keyboard.keycode)
		{
		case ALLEGRO_KEY_ESCAPE:
			if (IsGameStateActive())
			{
				PushState(menuState);
				menuState->SwitchToMenu("Wave Menu");
			}
			else if (menuState->CurrentMenu->GetName() == "Wave Menu")
			{
				PopState();
			}
			break;
		case ALLEGRO_KEY_B: //this should seriously be left somewhere else, or this method should change its name
			if (IsGameStateActive())
			{
				if (collisionDetector->IsHitboxDisplayEnabled())
					collisionDetector->EnableHitboxDisplay(false);
				else
					collisionDetector->EnableHitboxDisplay(true);
			}
			break;
		}
	}
	else if (event.type == ALLEGRO_EVENT_DISPLAY_CLOSE)
		Quit();
}
开发者ID:LibreGames,项目名称:Vinctus-Arce,代码行数:31,代码来源:GameEngine.cpp


示例8: switch

/*****************************************************************
* Update():			Handles updating the current state and
*					switching states at the correct point
*
* Ins:				N/A
*
* Outs:				N/A
*
* Returns:			N/A
*
* Mod. Date:		8/11/2015
* Mod. Initials:	SS
*****************************************************************/
bool CStateMachine::Update()
{
	m_AudioManager.Update();
	Input->Update();
	IState* m_pCurrState = activeStates.top();
	
	if (m_pCurrState)
	{
		EInputResult result = m_pCurrState->Input();
		switch (result)
		{
		case eContinue:
			m_pCurrState->Update();
			return true;
			break;
		case eRemove:
			PopState();
			break;
		default:
			break;
		}
	}

	return false;
}
开发者ID:CMcLaine92,项目名称:The-Exile,代码行数:38,代码来源:StateMachine.cpp


示例9: PushState

void NetListView::FrameResized(float width, float height)
{
	BListView::FrameResized(width, height);
	//Ensure the bevel on the right is drawn properly
	if(width < oldWidth)
		oldWidth = width;
	PushState();
	BRect invalRect(oldWidth, 0, oldWidth, height);
	ConvertFromParent(&invalRect);
	BRegion lineRegion(invalRect);
	ConstrainClippingRegion(&lineRegion);
	Draw(invalRect);
	oldWidth = width;
	PopState();
	
	//Do word wrapping
	BFont curFont;
	GetFont(&curFont);
	float itemWidth = Bounds().Width();
	float wrapWidth = (itemWidth - 6)/curFont.Size();
	for(int itemNum = 0; itemNum < CountItems(); itemNum++)
	{
		NetListItem* item = (NetListItem*)(Items()[itemNum]);
		item->SetWidth(itemWidth);
		item->CalcWordWrap(wrapWidth);
	}
	//DoForEach(UpdateItem, (void*)this);
	Invalidate();
	
	BListView::FrameResized(width, height);
}
开发者ID:thinkpractice,项目名称:bme,代码行数:31,代码来源:NetListView.cpp


示例10: PopState

void CShopState::KeyInput(const SDL_Event& rEvent)
{
	if (rEvent.type == SDL_KEYDOWN)
		if (rEvent.key.keysym.sym == SDLK_BACKQUOTE)
			PopState();
	mpShop->KeyInput(rEvent);
}
开发者ID:jollywho,项目名称:Tempest,代码行数:7,代码来源:ShopState.cpp


示例11: PushState

void TExportZone::DrawInMarker(BRect updateRect)
{
	// Set up environment
	PushState();
		
	BPoint drawPt;
	
	// Draw left marker
	if (updateRect.Intersects(m_InRect) )
	{
		// Draw indicator in new location
		drawPt.Set(m_InRect.left, m_InRect.top);
		DrawBitmap(m_InMarker, drawPt);
	}

	// Draw right marker
	if (updateRect.Intersects(m_OutRect) )
	{
		// Draw indicator in new location
		drawPt.Set(m_OutRect.left, m_OutRect.top);
		DrawBitmap(m_OutMarker, drawPt);
	}
		
	// Restore environment
	PopState();
}
开发者ID:ModeenF,项目名称:UltraDV,代码行数:26,代码来源:TExportZone.cpp


示例12: NS_ASSERTION

NS_IMETHODIMP nsAccessibleTreeWalker::GetNextSibling()
{
  // Make sure mState.prevState and mState.siblingIndex are initialized so we can walk forward
  NS_ASSERTION(mState.prevState && mState.siblingIndex != eSiblingsUninitialized,
               "Error - GetNextSibling() only works after a GetFirstChild(), so we must have a prevState.");
  mState.accessible = nsnull;

  while (PR_TRUE) {
    // Get next frame
    UpdateFrame(PR_FALSE);
    GetNextDOMNode();

    if (!mState.domNode) {  // Done with current siblings
      PopState();   // Use parent - go up in stack. Can always pop state because we have to start with a GetFirstChild().
      if (!mState.prevState) {
        mState.accessible = nsnull;
        break; // Back to original accessible that we did GetFirstChild() from
      }
    }
    else if ((mState.domNode != mState.prevState->domNode && GetAccessible()) || 
             NS_SUCCEEDED(GetFirstChild())) {
      return NS_OK; // if next is accessible, use it 
    }
  }
  return NS_ERROR_FAILURE;
}
开发者ID:mmadia,项目名称:bezilla,代码行数:26,代码来源:nsAccessibleTreeWalker.cpp


示例13: PopState

void tGameEngine::ChangeState(tState * pState)
{
    if (m_States.empty() == false)
    {
        PopState();
    }
    PushState(pState);
}
开发者ID:maxwellhouse,项目名称:SFML_Sandbox,代码行数:8,代码来源:GameEngine.cpp


示例14: PopState

void AudacityProject::SetStateTo(unsigned int n)
{
   TrackList *l = mUndoManager.SetStateTo(n, &mViewInfo.sel0, &mViewInfo.sel1);
   PopState(l);

   FixScrollbars();
   mTrackPanel->Refresh(false);
}
开发者ID:tuanmasterit,项目名称:audacity,代码行数:8,代码来源:Project.cpp


示例15: while

nsAccTreeWalker::~nsAccTreeWalker()
{
  // Clear state stack from memory
  while (mState)
    PopState();

  MOZ_COUNT_DTOR(nsAccTreeWalker);
}
开发者ID:jiaofeng,项目名称:Icefox,代码行数:8,代码来源:nsAccTreeWalker.cpp


示例16: while

void VikeWin::ResetState()
{
    while(m_state.Count() > 1){
        PopState();
    }
    SetState(VIKE_START);
    ClearDupNumber();
}
开发者ID:KurumiSerori,项目名称:cbvike,代码行数:8,代码来源:cbvike.cpp


示例17: PR_LOG

NS_IMETHODIMP
nsThebesRenderingContext::PopTranslation(PushedTranslation* aState)
{
    PR_LOG(gThebesGFXLog, PR_LOG_DEBUG, ("## %p nsTRC::PopTranslation\n", this));

    // XXX this is slow!
    PopState();
    return NS_OK;
}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:9,代码来源:nsThebesRenderingContext.cpp


示例18: PushState

void TCueSheetTimeView::Draw(BRect updateRect)
{
	// Set up environment
	PushState();
	
	const BRect bounds = Bounds();
	
	BPoint startPt, endPt;
	
	// Draw TimeRect frame
	SetHighColor(kLightGrey);
	FillRect(bounds);
	
	//	Draw black outline
	SetHighColor(kBlack);
	startPt.Set(bounds.left, bounds.top);
	endPt.Set(bounds.left, bounds.bottom);
	StrokeLine(startPt, endPt);
	startPt.Set(bounds.right, bounds.top);
	endPt.Set(bounds.right, bounds.bottom);
	StrokeLine(startPt, endPt);
	
	
	//	Draw shadow
	SetHighColor(kMediumGrey);
	startPt.Set(bounds.right-1, bounds.top);
	endPt.Set(bounds.right-1, bounds.bottom);
	StrokeLine(startPt, endPt);
	startPt.Set(bounds.right-1, bounds.bottom);
	endPt.Set(bounds.left+1, bounds.bottom);
	StrokeLine(startPt, endPt);
	
	//	Draw highlight	
	SetHighColor(kWhite);
	startPt.Set(bounds.left+1, bounds.bottom - 2);
	endPt.Set(bounds.left+1, bounds.top);
	StrokeLine(startPt, endPt);
	startPt.Set(bounds.left+1, bounds.top);
	endPt.Set(bounds.right-2, bounds.top);
	StrokeLine(startPt, endPt);

	// Draw cue sheet start time
	BFont font; 
   	GetFont(&font); 
	SetFont(be_bold_font);   
   	SetHighColor(kBlack);
   	
	BPoint 	textPt;
	char 	timeStr[256];
	int32 	startTime = m_CueSheetWindow->GetCueSheetView()->StartTime();
	textPt.Set(bounds.left + 9, bounds.top + 16);
	TimeToString(startTime, m_CueSheetWindow->GetCueSheetView()->GetTimeFormat(), timeStr, FALSE);		
	DrawString(timeStr, textPt);
	
	// Restore environment
	PopState();
}
开发者ID:ModeenF,项目名称:UltraDV,代码行数:57,代码来源:TCueSheetTimeView.cpp


示例19: RETURN_IF_ERROR

/* virtual */ OP_STATUS
Google2011NetworkApiResponseParser::LeaveObject()
{
	RETURN_IF_ERROR(PopState());

	// PopAttributeState returns ERR if there is nothing left on the state stack.
	// Here is it a valid situation if we're leaving the top-level object.
	OpStatus::Ignore(PopAttributeState());
	return OpStatus::OK;
}
开发者ID:prestocore,项目名称:browser,代码行数:10,代码来源:geo_google2011_network_api_response_parser.cpp


示例20: wxASSERT

void AudioView::Redo()
{
  wxASSERT(undoManager.RedoAvailable());
  
  TrackList *l = undoManager.Redo(&sel0, &sel1);
  PopState(l);

  FixScrollbars();
  REDRAW(trackPanel);
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:10,代码来源:AudioView.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Populate函数代码示例发布时间:2022-05-30
下一篇:
C++ PopCallStack函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap