本文整理汇总了C++中BaseModHybridButton::SetEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseModHybridButton::SetEnabled方法的具体用法?C++ BaseModHybridButton::SetEnabled怎么用?C++ BaseModHybridButton::SetEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseModHybridButton
的用法示例。
在下文中一共展示了BaseModHybridButton::SetEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ApplySchemeSettings
//=============================================================================
void InGameMainMenu::ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
// We cant remove button and resize flyout menu from code, but we can use another .res file for base menu.
#ifdef UI_USING_GAMEPLAYCONFIGDIALOG
if ( demo_ui_enable.GetString()[0] )
{
LoadControlSettings( CFmtStr( "Resource/UI/BaseModUI/InGameMainMenu_%s.res", demo_ui_enable.GetString() ) );
}
else
{
LoadControlSettings( "Resource/UI/BaseModUI/InGameMainMenu.res" );
}
#else
// all that "demoui" stuff confuse me [str]
const char *pSettings = "Resource/UI/BaseModUI/InGameMainMenu_NoGameplay.res";
#endif
BaseModHybridButton *button = dynamic_cast< BaseModHybridButton* >( FindChildByName( "BtnDeveloperCommentaries" ) );
if ( button )
{
#ifdef UI_USING_DEVCOMMENTARIES
button->SetEnabled( true ); // we're not just removing button, because of ASWUI flyout system [str]
// thought: maybe just use different control setting
#endif
}
SetPaintBackgroundEnabled( true );
SetFooterState();
}
示例2: LoadLayout
//=============================================================================
void InGameDifficultySelect::LoadLayout()
{
BaseClass::LoadLayout();
CGameUIConVarRef z_difficulty("z_difficulty");
if ( z_difficulty.IsValid() )
{
// set a label that tells us what the current difficulty is
char chBuffer[64];
Q_snprintf( chBuffer, ARRAYSIZE( chBuffer ), "#L4D360UI_Difficulty_%s", z_difficulty.GetString() );
const char *pszDifficultyLoc = chBuffer;
wchar_t *pwcDifficulty = g_pVGuiLocalize->Find( pszDifficultyLoc );
if ( pwcDifficulty )
{
wchar_t szWideBuff[200];
g_pVGuiLocalize->ConstructString( szWideBuff, sizeof( szWideBuff ), g_pVGuiLocalize->Find( "#L4D360UI_GameSettings_Current_Difficulty" ), 1, pwcDifficulty );
SetControlString( "LblCurrentDifficulty", szWideBuff );
}
// Disable the current difficulty's button, and navigate to it.
BaseModHybridButton *pButton = dynamic_cast< BaseModHybridButton* >( FindChildByName( VarArgs( "Btn%s", z_difficulty.GetString() ) ) );
if ( pButton )
{
pButton->SetEnabled( false );
pButton->NavigateTo();
}
}
}
示例3: Demo_DisableButton
void Demo_DisableButton( Button *pButton )
{
BaseModHybridButton *pHybridButton = dynamic_cast<BaseModHybridButton *>(pButton);
if (pHybridButton)
{
pHybridButton->SetEnabled( false );
char szTooltip[512];
wchar_t *wUnicode = g_pVGuiLocalize->Find( "#L4D360UI_MainMenu_DemoVersion" );
if ( !wUnicode )
wUnicode = L"";
g_pVGuiLocalize->ConvertUnicodeToANSI( wUnicode, szTooltip, sizeof( szTooltip ) );
pHybridButton->SetHelpText( szTooltip , false );
}
}