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


C++ SetBgColor函数代码示例

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


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

示例1: do_redisplay

/* Here is where all redrawing will take place for your program. 
 * When the window needs to be redrawn, this function will be called.
 * When your program starts up for the first time, this function will 
 * be called and you should draw anything you need to draw in here.
 */
void do_redisplay(MyProgram *me, int width, int height) 
{
  int i;
  char *str = "My Cool Program";

  if (me->in_color_mode)
   {
     do_colorstuff();
     return;
   }

  SetBgColor(me->draw_widget, WHITE);
  ClearDrawArea();       /* start with a clean slate */

  SetColor(BLACK);
  SetBgColor(me->draw_widget, GREEN);
  DrawText(str, (width-TextWidth(me->draw_font, str))/2, height/2); 

  SetBgColor(me->draw_widget, WHITE);
  SetColor(me->col1);
  for(i=0; i < width; i+=5)
     DrawLine(0,i, i,height);

  SetColor(me->col2);
  for(i=0; i < width; i+=5)
     DrawLine(width,i, width-i,height);
}
开发者ID:dervish77,项目名称:adgf,代码行数:32,代码来源:main.c

示例2: SetPaintBackgroundEnabled

void CBaseHudChat::ApplySchemeSettings( vgui::IScheme *pScheme )
{
	BaseClass::ApplySchemeSettings( pScheme );

	SetPaintBackgroundEnabled( false );
	SetKeyBoardInputEnabled( false );
	SetMouseInputEnabled( false );
	m_nVisibleHeight = 0;

	// Put input area at bottom
	if ( m_pChatInput )
	{
		int w, h;
		GetSize( w, h );
		m_pChatInput->SetBounds( 1, h - m_iFontHeight - 1, w-2, m_iFontHeight );
	}

#ifdef HL1_CLIENT_DLL
	SetBgColor( Color( 0, 0, 0, 0 ) );
	SetFgColor( Color( 0, 0, 0, 0 ) );
#else
	SetBgColor( Color( 0, 0, 0, 100 ) );
#endif

}
开发者ID:paralin,项目名称:hl2sdk,代码行数:25,代码来源:hud_basechat.cpp

示例3: clamp

void CBaseHudChat::FadeChatHistory( void )
{
	float frac = ( m_flHistoryFadeTime -  gpGlobals->curtime ) / CHAT_HISTORY_FADE_TIME;

	int alpha = frac * CHAT_HISTORY_ALPHA;
	alpha = clamp( alpha, 0, CHAT_HISTORY_ALPHA );

	if ( alpha >= 0 )
	{
		if ( GetChatHistory() )
		{
			if ( IsMouseInputEnabled() )
			{
				SetAlpha( 255 );
				GetChatHistory()->SetBgColor( Color( 0, 0, 0, CHAT_HISTORY_ALPHA - alpha ) );
				m_pChatInput->GetPrompt()->SetAlpha( (CHAT_HISTORY_ALPHA*2) - alpha );
				m_pChatInput->GetInputPanel()->SetAlpha( (CHAT_HISTORY_ALPHA*2) - alpha );
				SetBgColor( Color( GetBgColor().r(), GetBgColor().g(), GetBgColor().b(), CHAT_HISTORY_ALPHA - alpha ) );
				m_pFiltersButton->SetAlpha( (CHAT_HISTORY_ALPHA*2) - alpha );
			}
			else
			{
				GetChatHistory()->SetBgColor( Color( 0, 0, 0, alpha ) );
				SetBgColor( Color( GetBgColor().r(), GetBgColor().g(), GetBgColor().b(), alpha ) );
			
				m_pChatInput->GetPrompt()->SetAlpha( alpha );
				m_pChatInput->GetInputPanel()->SetAlpha( alpha );
				m_pFiltersButton->SetAlpha( alpha );
			}
		}
	}
}
开发者ID:Epic-xx,项目名称:impending,代码行数:32,代码来源:hud_basechat.cpp

示例4: SetBgColor

void CCommanderStatusPanel::PaintBackground()
{
	if ( m_flCurrentAlpha <= 0.0f )
		return;

	if ( m_Type == TYPE_INFO )
	{
		int alpha = MAX_FILLED_INFO_ALPHA * m_flCurrentAlpha;

		SetBgColor( Color( 0, 0, 0, alpha ) );

		alpha += ( 255 - alpha ) / 2;

		// hogsy start
		surface()->DrawSetColor(Color(120, 120, 180, alpha));
		// hogsy end
	}
	else
	{
		SetBgColor( Color( 0, 0, 0, 0 ) );
		// hogsy start
		surface()->DrawSetColor(Color(0,0,0,0));
		// hogsy end
	}

	// hogsy start
	int w, h;
	GetSize(w, h);

	surface()->DrawOutlinedRect(0, 0, w, h);
	surface()->DrawOutlinedRect(1, 1, w - 1, h - 1);
	// hogsy end

	BaseClass::PaintBackground();
}
开发者ID:TalonBraveInfo,项目名称:InvasionSource,代码行数:35,代码来源:hud_commander_statuspanel.cpp

示例5: LoadControlSettings

void PlayerListPanel::ApplySchemeSettings(vgui::IScheme *pScheme)
{
    BaseClass::ApplySchemeSettings(pScheme);

    LoadControlSettings( "resource/ui/PlayerListPanel.res" );

    vgui::HFont DefaultFont = pScheme->GetFont( "Default", IsProportional() );
    m_pPlayerHeader->SetFont(DefaultFont);
    m_pPlayerHeader->SetFgColor(Color(255,255,255,255));
    m_pMarinesHeader->SetFont(DefaultFont);
    m_pMarinesHeader->SetFgColor(Color(255,255,255,255));
    m_pPingHeader->SetFont(DefaultFont);
    m_pPingHeader->SetFgColor(Color(255,255,255,255));
    SetPaintBackgroundEnabled(true);
    SetPaintBackgroundType(0);

    // more translucent when viewed ingame
    if (GetParent() && GetParent()->GetParent() && GetParent()->GetParent() == GetClientMode()->GetViewport())
        SetBgColor(Color(0,0,0,128));
    else
        SetBgColor(Color(0,0,0,220));


    m_pLeaderButtonsBackground->SetPaintBackgroundEnabled(false);	// temp removal of this
    m_pLeaderButtonsBackground->SetPaintBackgroundType(0);
    m_pLeaderButtonsBackground->SetBgColor(Color(0,0,0,128));

    m_pStartSavedCampaignVoteButton->m_pLabel->SetFont(DefaultFont);

    Color col_white(255,255,255,255);
    Color col_grey(128,128,128,255);
    m_pStartSavedCampaignVoteButton->SetColors(col_white, col_grey, col_white, col_grey, col_white);
}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:33,代码来源:playerlistpanel.cpp

示例6: SetBgColor

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CHudLabel::ApplySchemeSettings(vgui::IScheme *pScheme)
{
	Panel::ApplySchemeSettings(pScheme);

	if ( m_bSelected )
	{
		SetBgColor( GetSchemeColor("HudStatusSelectedBgColor", pScheme) );
	}
	else
	{
		SetBgColor( GetSchemeColor("HudStatusBgColor", pScheme) );
	}
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:16,代码来源:vgui_basepanel.cpp

示例7: SetBgColor

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CHudOrder::ApplySchemeSettings(vgui::IScheme *pScheme)
{
	Panel::ApplySchemeSettings(pScheme);

	if ( m_pOrder && m_pOrder->IsPersonalOrder() )
	{
		SetBgColor( GetSchemeColor("HudStatusSelectedBgColor", pScheme) );
	}
	else
	{
		SetBgColor( GetSchemeColor("HudStatusBgColor", pScheme) );
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:16,代码来源:hud_orders.cpp

示例8: SetBgColor

void CHudFlagCarrier::Paint ( void )
{
	SetBgColor( Color( GetBgColor().r(), GetBgColor().g(), GetBgColor().b(), 128 ) );

	DisplayText
	(
		m_Text[ TEAM_BLUE ], 
		m_flBlueTextX, 
		m_flBlueTextY,
		m_BlueForegroundColor
	);
	
	DisplayText
	(
		m_Text[ TEAM_RED ], 
		m_flRedTextX,
		m_flRedTextY, 
		m_RedForegroundColor
	);

	if ( m_iTakenByPlayer[ TEAM_RED ] != TAKEN_INVALID_PLAYER )
	{
		m_pAvatar[ TEAM_RED ].Paint();
	}

	if ( m_iTakenByPlayer[ TEAM_BLUE ] != TAKEN_INVALID_PLAYER )
	{
		m_pAvatar[ TEAM_BLUE ].Paint();
	}
}
开发者ID:hekar,项目名称:luminousforts-2013,代码行数:30,代码来源:Hud_FlagCarrier.cpp

示例9: SetBgColor

Container::Container()
{
	m_transparent = true;
	SetBgColor(Theme::Colors::bg);
	onMouseLeave.connect(sigc::mem_fun(this, &Container::_OnMouseLeave));
	onSetSize.connect(sigc::mem_fun(this, &Container::_OnSetSize));
}
开发者ID:Ikesters,项目名称:pioneer,代码行数:7,代码来源:GuiContainer.cpp

示例10: LoadControlSettings

void CHudChat::ApplySchemeSettings( vgui::IScheme *pScheme )
{
	if ( m_bIntermissionSet )
		LoadControlSettings( "resource/UI/BaseChat_Intermission.res" );
	else
		LoadControlSettings( "resource/UI/BaseChat.res" );

	m_IScheme = pScheme;

	// Skip over the BaseChat so we don't reload non-intermission settings
	EditablePanel::ApplySchemeSettings( pScheme );

	SetPaintBackgroundType( 2 );
	SetPaintBorderEnabled( true );
	SetPaintBackgroundEnabled( true );

	SetKeyBoardInputEnabled( false );
	SetMouseInputEnabled( false );
	m_nVisibleHeight = 0;

	Color cColor = pScheme->GetColor( "DullWhite", GetBgColor() );
	SetBgColor( Color ( cColor.r(), cColor.g(), cColor.b(), CHAT_HISTORY_ALPHA ) );

	GetChatHistory()->SetVerticalScrollbar( false );
}
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:25,代码来源:ge_hudchat.cpp

示例11: IsCursorOver

void CASW_Difficulty_Entry::OnThink()
{
	bool bCursorOver = IsCursorOver();
	if (m_bMouseOver != bCursorOver)
	{
		m_bMouseOver = bCursorOver;
		if (m_bMouseOver)
		{
			SetBgColor(Color(75,84,106,255));
		}
		else
		{
			SetBgColor(Color(0,0,0,0));
		}
	}	
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:16,代码来源:asw_difficulty_chooser.cpp

示例12: Color

void CBaseHudChatInputLine::ApplySchemeSettings(vgui::IScheme *pScheme)
{
	BaseClass::ApplySchemeSettings(pScheme);
	
	// FIXME:  Outline
	vgui::HFont hFont = pScheme->GetFont( "ChatFont" );

	m_pPrompt->SetFont( hFont );
	m_pInput->SetFont( hFont );

	m_pInput->SetFgColor( pScheme->GetColor( "Chat.TypingText", pScheme->GetColor( "Panel.FgColor", Color( 255, 255, 255, 255 ) ) ) );

	SetPaintBackgroundEnabled( true );
	m_pPrompt->SetPaintBackgroundEnabled( true );
	m_pPrompt->SetContentAlignment( vgui::Label::a_west );
	m_pPrompt->SetTextInset( 2, 0 );

	m_pInput->SetMouseInputEnabled( true );

#ifdef HL1_CLIENT_DLL
	m_pInput->SetBgColor( Color( 255, 255, 255, 0 ) );
#endif

	SetBgColor( Color( 0, 0, 0, 0) );

}
开发者ID:Epic-xx,项目名称:impending,代码行数:26,代码来源:hud_basechat.cpp

示例13: ZeroMemory

void TextWindow::Initialise (HWND hWnd, unsigned int uID)
{	
	// Make the ID global
	m_ID = uID;
	m_parenthwnd = hWnd;
	//m_hwnd = hWnd;

	// Temporary string value for uID
	char szID[SIZE_STRING];
	ZeroMemory (szID, SIZE_STRING);

	SetParentHWND (hWnd);
	SetBgColor (GetSysColor (COLOR_BTNFACE));
	SetCaption (TEXT ("Decrypted Text"));
	SetWindowStyle (FS_STYLESTANDARD);

	// Create the class name
	strcat_s (m_szClassname, SIZE_STRING, "TextWindowClass");
	sprintf_s (szID, SIZE_STRING, "%d", uID);
	strcat_s (m_szClassname, SIZE_STRING, szID);

	if (m_binitialised == false) {
		CreateAppWindow (m_szClassname, 70, 0, 400, 550, true);
		m_uihandler.SetWindowProperties (0, 0, 300, 0, RGB (230, 230, 240));
		SetWindowPosition (FS_CENTER);
		m_binitialised = true;
	}

	Show ();
}
开发者ID:dannydraper,项目名称:CedeCryptClassic,代码行数:30,代码来源:TextWindow.cpp

示例14: SetBgColor

NS_IMETHODIMP 
HTMLBodyElement::SetBgColor(const nsAString& aBgColor)
{
  ErrorResult rv;
  SetBgColor(aBgColor, rv);
  return rv.StealNSResult();
}
开发者ID:MekliCZ,项目名称:positron,代码行数:7,代码来源:HTMLBodyElement.cpp

示例15: SetPaintBackgroundEnabled

void FontTestPanel::ApplySchemeSettings(vgui::IScheme *pScheme)
{
	BaseClass::ApplySchemeSettings(pScheme);

	SetPaintBackgroundEnabled(true);
	SetPaintBackgroundType(0);
	SetBgColor(Color(0,0,0,255));

	for (int i=0;i<ASW_FONT_TEST_LABELS;i++)
	{
		m_pLabel[i]->SetFgColor(pScheme->GetColor("White", Color(255,255,255,255)));
	}
	int k=0;
	SetLabelFont(pScheme, k++, "Default", "Default 123456 NO", false);
	SetLabelFont(pScheme, k++, "Default", "Default proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "DefaultUnderline", "DefaultUnderline 123456 NO", false);
	SetLabelFont(pScheme, k++, "DefaultUnderline", "DefaultUnderline proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "DefaultSmall", "DefaultSmall 123456 NO", false);
	SetLabelFont(pScheme, k++, "DefaultSmall", "DefaultSmall proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "DefaultMedium", "DefaultMedium 123456 NO", false);
	SetLabelFont(pScheme, k++, "DefaultMedium", "DefaultMedium proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "DefaultVerySmall", "DefaultVerySmall 123456 NO", false);
	SetLabelFont(pScheme, k++, "DefaultVerySmall", "DefaultVerySmall proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "DefaultLarge", "DefaultLarge 123456 NO", false);
	SetLabelFont(pScheme, k++, "DefaultLarge", "DefaultLarge proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "DefaultExtraLarge", "DefaultExtraLarge 123456 NO", false);
	SetLabelFont(pScheme, k++, "DefaultExtraLarge", "DefaultExtraLarge proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "DefaultLarge", "DefaultLarge 123456 NO", false);
	SetLabelFont(pScheme, k++, "DefaultLarge", "DefaultLarge proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Sansman8", "Sansman8 123456 NO", false);
	SetLabelFont(pScheme, k++, "Sansman8", "Sansman8 proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Sansman10", "Sansman10 123456 NO", false);
	SetLabelFont(pScheme, k++, "Sansman10", "Sansman10 proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Sansman12", "Sansman12 123456 NO", false);
	SetLabelFont(pScheme, k++, "Sansman12", "Sansman12 proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Sansman14", "Sansman14 123456 NO", false);
	SetLabelFont(pScheme, k++, "Sansman14", "Sansman14 proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Sansman16", "Sansman16 123456 NO", false);
	SetLabelFont(pScheme, k++, "Sansman16", "Sansman16 proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Sansman18", "Sansman18 123456 NO", false);
	SetLabelFont(pScheme, k++, "Sansman18", "Sansman18 proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Sansman20", "Sansman20 123456 NO", false);
	SetLabelFont(pScheme, k++, "Sansman20", "Sansman20 proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "CleanHUD", "CleanHUD 123456 NO", false);
	SetLabelFont(pScheme, k++, "CleanHUD", "CleanHUD proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Courier", "Courier 123456 NO", false);
	SetLabelFont(pScheme, k++, "Courier", "Courier proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "SmallCourier", "SmallCourier 123456 NO", false);
	SetLabelFont(pScheme, k++, "SmallCourier", "SmallCourier proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Verdana", "Verdana 123456 NO", false);
	SetLabelFont(pScheme, k++, "Verdana", "Verdana proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "VerdanaSmall", "VerdanaSmall 123456 NO", false);
	SetLabelFont(pScheme, k++, "VerdanaSmall", "VerdanaSmall proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "CampaignTitle", "CampaignTitle 123456 NO", false);
	SetLabelFont(pScheme, k++, "CampaignTitle", "CampaignTitle proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "MainMenu", "MainMenu 123456 NO", false);
	SetLabelFont(pScheme, k++, "MainMenu", "MainMenu proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "MissionChooserFont", "MissionChooserFont 123456 NO", false);
	SetLabelFont(pScheme, k++, "MissionChooserFont", "MissionChooserFont proportional 123456 YES", true);
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:60,代码来源:fonttestpanel.cpp


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