本文整理汇总了C++中FlyoutMenu::GetNavFrom方法的典型用法代码示例。如果您正苦于以下问题:C++ FlyoutMenu::GetNavFrom方法的具体用法?C++ FlyoutMenu::GetNavFrom怎么用?C++ FlyoutMenu::GetNavFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlyoutMenu
的用法示例。
在下文中一共展示了FlyoutMenu::GetNavFrom方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnSiblingHybridButtonOpened
void BaseModHybridButton::OnSiblingHybridButtonOpened()
{
if ( !IsPC() )
return;
bool bClosed = false;
FlyoutMenu *pActiveFlyout = FlyoutMenu::GetActiveMenu();
if ( pActiveFlyout )
{
BaseModHybridButton *button = dynamic_cast< BaseModHybridButton* >( pActiveFlyout->GetNavFrom() );
if ( button && button == this )
{
// We need to close the flyout attached to this button
FlyoutMenu::CloseActiveMenu();
bClosed = true;
}
}
if ( !bClosed )
{
SetClosed();
}
m_isNavigateTo = false;
}
示例2: PaintButtonEx
//.........这里部分代码省略.........
break;
case Focus:
// active item
col.SetColor( 255, 255, 255, 255 );
bDrawGlow = true;
bAnimateGlow = true;
if ( m_nStyle == BUTTON_SIMPLE ||
m_nStyle == BUTTON_DROPDOWN ||
m_nStyle == BUTTON_DIALOG ||
m_nStyle == BUTTON_RED )
{
bDrawCursor = true;
}
break;
}
wchar_t szUnicode[512];
GetText( szUnicode, sizeof( szUnicode ) );
int len = V_wcslen( szUnicode );
int textWide, textTall;
surface()->GetTextSize( m_hTextFont, szUnicode, textWide, textTall );
textWide = clamp( textWide, 0, wide - m_textInsetX * 2 );
textTall = clamp( textTall, 0, tall - m_textInsetX * 2 );
int textInsetX = m_textInsetX;
if ( m_nStyle == BUTTON_DIALOG )
{
// dialog buttons are centered
textInsetX = ( wide - textWide ) / 2;
}
if ( FlyoutMenu::GetActiveMenu() && FlyoutMenu::GetActiveMenu()->GetNavFrom() != this )
{
bDrawCursor = false;
}
if ( bDrawCursor )
{
// draw backing rectangle
if ( curState == Open )
{
surface()->DrawSetColor( Color( 0, 0, 0, 255 ) );
surface()->DrawFilledRectFade( x, y, x+wide, y+tall, 0, 255, true );
}
// draw blotch
surface()->DrawSetColor( blotchColor );
if ( m_nStyle == BUTTON_DIALOG )
{
int blotchWide = textWide;
int blotchX = x + textInsetX;
surface()->DrawFilledRectFade( blotchX, y, blotchX + 0.50f * blotchWide, y+tall, 0, 150, true );
surface()->DrawFilledRectFade( blotchX + 0.50f * blotchWide, y, blotchX + blotchWide, y+tall, 150, 0, true );
}
else
{
int blotchWide = textWide + vgui::scheme()->GetProportionalScaledValueEx( GetScheme(), 40 );
int blotchX = x + textInsetX;
surface()->DrawFilledRectFade( blotchX, y, blotchX + 0.25f * blotchWide, y+tall, 0, 150, true );
surface()->DrawFilledRectFade( blotchX + 0.25f * blotchWide, y, blotchX + blotchWide, y+tall, 150, 0, true );
}
// draw border lines
surface()->DrawSetColor( borderColor );