本文整理汇总了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);
}
示例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
}
示例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 );
}
}
}
}
示例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();
}
示例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);
}
示例6: SetBgColor
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHudLabel::ApplySchemeSettings(vgui::IScheme *pScheme)
{
Panel::ApplySchemeSettings(pScheme);
if ( m_bSelected )
{
SetBgColor( GetSchemeColor("HudStatusSelectedBgColor", pScheme) );
}
else
{
SetBgColor( GetSchemeColor("HudStatusBgColor", pScheme) );
}
}
示例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) );
}
}
示例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();
}
}
示例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));
}
示例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 );
}
示例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));
}
}
}
示例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) );
}
示例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 ();
}
示例14: SetBgColor
NS_IMETHODIMP
HTMLBodyElement::SetBgColor(const nsAString& aBgColor)
{
ErrorResult rv;
SetBgColor(aBgColor, rv);
return rv.StealNSResult();
}
示例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);
}