本文整理汇总了C++中IScheme::GetBorder方法的典型用法代码示例。如果您正苦于以下问题:C++ IScheme::GetBorder方法的具体用法?C++ IScheme::GetBorder怎么用?C++ IScheme::GetBorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScheme
的用法示例。
在下文中一共展示了IScheme::GetBorder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PerformLayout
//-----------------------------------------------------------------------------
// Purpose: lays out controls
//-----------------------------------------------------------------------------
void CConsolePanel::PerformLayout()
{
BaseClass::PerformLayout();
// setup tab ordering
GetFocusNavGroup().SetDefaultButton(m_pSubmit);
IScheme *pScheme = scheme()->GetIScheme( GetScheme() );
m_pEntry->SetBorder(pScheme->GetBorder("DepressedButtonBorder"));
m_pHistory->SetBorder(pScheme->GetBorder("DepressedButtonBorder"));
// layout controls
int wide, tall;
GetSize(wide, tall);
if ( !m_bStatusVersion )
{
const int inset = 8;
const int entryHeight = 24;
const int topHeight = 4;
const int entryInset = 4;
const int submitWide = 64;
const int submitInset = 7; // x inset to pull the submit button away from the frame grab
m_pHistory->SetPos(inset, inset + topHeight);
m_pHistory->SetSize(wide - (inset * 2), tall - (entryInset * 2 + inset * 2 + topHeight + entryHeight));
m_pHistory->InvalidateLayout();
int nSubmitXPos = wide - ( inset + submitWide + submitInset );
m_pSubmit->SetPos( nSubmitXPos, tall - (entryInset * 2 + entryHeight));
m_pSubmit->SetSize( submitWide, entryHeight);
m_pEntry->SetPos( inset, tall - (entryInset * 2 + entryHeight) );
m_pEntry->SetSize( nSubmitXPos - entryInset - 2 * inset, entryHeight);
}
else
{
const int inset = 2;
int entryWidth = wide / 2;
if ( wide > 400 )
{
entryWidth = 200;
}
m_pEntry->SetBounds( inset, inset, entryWidth, tall - 2 * inset );
m_pHistory->SetBounds( inset + entryWidth + inset, inset, ( wide - entryWidth ) - inset, tall - 2 * inset );
}
UpdateCompletionListPosition();
}
示例2: BaseTooltip
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
TextTooltip::TextTooltip(Panel *parent, const char *text) : BaseTooltip( parent, text )
{
if (!s_TooltipWindow.Get())
{
s_TooltipWindow = new TextEntry(NULL, "tooltip");
s_TooltipWindow->InvalidateLayout(false, true);
// this bit of hackery is necessary because tooltips don't get ApplySchemeSettings called from their parents
IScheme *pScheme = scheme()->GetIScheme( s_TooltipWindow->GetScheme() );
s_TooltipWindow->SetBgColor(s_TooltipWindow->GetSchemeColor("Tooltip.BgColor", s_TooltipWindow->GetBgColor(), pScheme));
s_TooltipWindow->SetFgColor(s_TooltipWindow->GetSchemeColor("Tooltip.TextColor", s_TooltipWindow->GetFgColor(), pScheme));
s_TooltipWindow->SetBorder(pScheme->GetBorder("ToolTipBorder"));
s_TooltipWindow->SetFont( pScheme->GetFont("DefaultSmall", s_TooltipWindow->IsProportional()));
}
s_iTooltipWindowCount++;
// this line prevents the main window from losing focus
// when a tooltip pops up
s_TooltipWindow->MakePopup(false, true);
s_TooltipWindow->SetKeyBoardInputEnabled( false );
s_TooltipWindow->SetMouseInputEnabled( false );
SetText(text);
s_TooltipWindow->SetText(m_Text.Base());
s_TooltipWindow->SetEditable(false);
s_TooltipWindow->SetMultiline(true);
s_TooltipWindow->SetVisible(false);
}
示例3: UpdateColors
void ImageButton::UpdateColors()
{
if (m_bButtonEnabled)
{
if (m_pLabel)
{
if (!IsCursorOver() || !m_bDoMouseOvers)
m_pLabel->SetFgColor(m_TextColor);
else
m_pLabel->SetFgColor(m_MouseOverTextColor);
}
if (m_pBackdrop)
{
m_pBackdrop->SetDrawColor(m_ImageColor);
}
IScheme *pScheme = scheme()->GetIScheme( GetScheme() );
if (pScheme)
{
int bg = GetPaintBackgroundType();
SetBorder(pScheme->GetBorder(m_szBorder));
SetPaintBackgroundType(bg);
}
}
else
{
if (m_pLabel)
{
m_pLabel->SetFgColor(m_DisabledTextColor);
}
if (m_pBackdrop)
{
m_pBackdrop->SetDrawColor(m_DisabledImageColor);
}
IScheme *pScheme = scheme()->GetIScheme( GetScheme() );
if (pScheme)
{
int bg = GetPaintBackgroundType();
SetBorder(pScheme->GetBorder(m_szBorderDisabled));
SetPaintBackgroundType(bg);
}
}
}
示例4: Paint
void MenuBar::Paint()
{
IScheme *pScheme = scheme()->GetIScheme( GetScheme() );
for ( int i = 0; i < m_pMenuButtons.Count(); i++)
{
if (!m_pMenuButtons[i]->IsArmed())
m_pMenuButtons[i]->SetDefaultBorder(NULL);
else
{
m_pMenuButtons[i]->SetDefaultBorder(pScheme->GetBorder( "ButtonBorder"));
}
}
}
示例5: ApplySettings
//-----------------------------------------------------------------------------
// Purpose: Applies designer settings from res file
//-----------------------------------------------------------------------------
void ImagePanel::ApplySettings(KeyValues *inResourceData)
{
delete [] m_pszImageName;
delete [] m_pszFillColorName;
delete [] m_pszDrawColorName; // HPE addition
m_pszImageName = NULL;
m_pszFillColorName = NULL;
m_pszDrawColorName = NULL; // HPE addition
//Center image isn't implemented in Source 2013. - Solokiller
m_bCenterImage = inResourceData->GetInt( "centerImage", 0 ) != 0;
m_bScaleImage = inResourceData->GetInt("scaleImage", 0) != 0;
m_fScaleAmount = inResourceData->GetFloat( "scaleAmount", 0.0f );
m_bTileImage = inResourceData->GetInt( "tileImage", 0 ) != 0;
m_bTileHorizontally = inResourceData->GetInt( "tileHorizontally", m_bTileImage ) != 0;
m_bTileVertically = inResourceData->GetInt( "tileVertically", m_bTileImage ) != 0;
const char *imageName = inResourceData->GetString("image", "");
if (*imageName)
{
SetImage( imageName );
}
const char *pszFillColor = inResourceData->GetString("fillcolor", "");
if (*pszFillColor)
{
int r = 0, g = 0, b = 0, a = 255;
int len = Q_strlen(pszFillColor) + 1;
m_pszFillColorName = new char[ len ];
Q_strncpy( m_pszFillColorName, pszFillColor, len );
if (sscanf(pszFillColor, "%d %d %d %d", &r, &g, &b, &a) >= 3)
{
// it's a direct color
m_FillColor = SDK_Color(r, g, b, a);
}
else
{
IScheme *pScheme = scheme()->GetIScheme( GetScheme() );
m_FillColor = pScheme->GetColor(pszFillColor, SDK_Color(0, 0, 0, 0));
}
}
//=============================================================================
// HPE_BEGIN:
// [pfreese] Added support for specifying drawcolor
//=============================================================================
const char *pszDrawColor = inResourceData->GetString( "drawcolor", "" );
if( *pszDrawColor )
{
int r = 255, g = 255, b = 255, a = 255;
int len = Q_strlen( pszDrawColor ) + 1;
m_pszDrawColorName = new char[ len ];
Q_strncpy( m_pszDrawColorName, pszDrawColor, len );
if( sscanf( pszDrawColor, "%d %d %d %d", &r, &g, &b, &a ) >= 3 )
{
// it's a direct color
m_DrawColor = SDK_Color( r, g, b, a );
}
else
{
IScheme *pScheme = scheme()->GetIScheme( GetScheme() );
m_DrawColor = pScheme->GetColor( pszDrawColor, SDK_Color( 255, 255, 255, 255 ) );
}
}
//=============================================================================
// HPE_END
//=============================================================================
const char *pszBorder = inResourceData->GetString("border", "");
if (*pszBorder)
{
IScheme *pScheme = scheme()->GetIScheme( GetScheme() );
SetBorder(pScheme->GetBorder(pszBorder));
}
BaseClass::ApplySettings(inResourceData);
}