本文整理汇总了C++中Panel::IsVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ Panel::IsVisible方法的具体用法?C++ Panel::IsVisible怎么用?C++ Panel::IsVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Panel
的用法示例。
在下文中一共展示了Panel::IsVisible方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RelinkNavigation
void GenericPanelList::RelinkNavigation( void )
{
int i;
for( i = 0; i != m_PanelItems.Count(); ++i )
{
m_PanelItems[i]->SetNavUp( (vgui::Panel *)NULL );
m_PanelItems[i]->SetNavDown( (vgui::Panel *)NULL );
}
if ( m_ItemSelectionModeMask & GenericPanelList::ISM_PERITEM )
{
Panel *pLastValid = NULL;
Panel *pFirstValid = NULL;
for( i = 0; i != m_PanelItems.Count(); ++i )
{
if( m_PanelItems[i]->IsVisible() )
{
pFirstValid = m_PanelItems[i];
pLastValid = pFirstValid;
++ i;
break;
}
}
for( ; i != m_PanelItems.Count(); ++i )
{
Panel *pCurrentPanel = m_PanelItems[i];
if( pCurrentPanel->IsVisible() )
{
pLastValid->SetNavDown( pCurrentPanel );
pCurrentPanel->SetNavUp( pLastValid );
pLastValid = pCurrentPanel;
}
}
if( pFirstValid )
{
pFirstValid->SetNavUp( pLastValid );
pLastValid->SetNavDown( pFirstValid );
}
}
if( m_pItemNavigationChangedCallback )
{
for( i = 0; i != m_PanelItems.Count(); ++i )
{
m_pItemNavigationChangedCallback( this, m_PanelItems[i] );
}
}
}
示例2:
//-----------------------------------------------------------------------------
// Purpose: finds the panel which is activated by the specified key
// Input : code - the keycode of the hotkey
// Output : Panel * - NULL if no panel found
//-----------------------------------------------------------------------------
Panel *FocusNavGroup::FindPanelByHotkey(wchar_t key)
{
for (int i = 0; i < _mainPanel->GetChildCount(); i++)
{
Panel *child = _mainPanel->GetChild(i);
if ( !child )
continue;
Panel *hot = child->HasHotkey(key);
if (hot && hot->IsVisible() && hot->IsEnabled())
{
return hot;
}
}
return NULL;
}
示例3: GetChild
//-----------------------------------------------------------------------------
// Purpose: Gets the panel with the specified hotkey
//-----------------------------------------------------------------------------
Panel *EditablePanel::HasHotkey(wchar_t key)
{
if( !IsVisible() || !IsEnabled()) // not visible, so can't respond to a hot key
{
return NULL;
}
for (int i = 0; i < GetChildCount(); i++)
{
Panel *hot = GetChild(i)->HasHotkey(key);
if (hot && hot->IsVisible() && hot->IsEnabled())
{
return hot;
}
}
return NULL;
}
示例4: ResetKeyFocus
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void WizardPanel::ResetKeyFocus()
{
// set the focus on the default
FocusNavGroup &navGroup = GetFocusNavGroup();
Panel *def = navGroup.GetDefaultPanel();
if (def)
{
if (def->IsEnabled() && def->IsVisible())
{
def->RequestFocus();
}
else
{
def->RequestFocusNext();
}
}
ResetDefaultButton();
}
示例5: RequestFocusPrev
//-----------------------------------------------------------------------------
// Purpose: Sets the focus to the previous panel in the tab order
// Input : *panel - panel currently with focus
//-----------------------------------------------------------------------------
bool FocusNavGroup::RequestFocusPrev(VPANEL panel)
{
if(panel==NULL)
return false;
_currentFocus = NULL;
int newPosition = 9999999;
if (panel)
{
newPosition = ipanel()->GetTabPosition(panel);
}
bool bFound = false;
bool bRepeat = true;
Panel *best = NULL;
while (1)
{
newPosition--;
if (newPosition > 0)
{
int bestPosition = 0;
// look for the next tab position
for (int i = 0; i < _mainPanel->GetChildCount(); i++)
{
Panel *child = _mainPanel->GetChild(i);
if (child && child->IsVisible() && child->IsEnabled() && child->GetTabPosition())
{
int tabPosition = child->GetTabPosition();
if (tabPosition == newPosition)
{
// we've found the right tab
best = child;
bestPosition = newPosition;
// don't loop anymore since we've found the correct panel
break;
}
else if (tabPosition < newPosition && tabPosition > bestPosition)
{
// record the match since this is the closest so far
bestPosition = tabPosition;
best = child;
}
}
}
if (!bRepeat)
break;
if (best)
break;
}
else
{
// reset new position for next loop
newPosition = 9999999;
}
// haven't found an item
if (!_topLevelFocus)
{
// check to see if we should push the focus request up
if (_mainPanel->GetVParent() && _mainPanel->GetVParent() != surface()->GetEmbeddedPanel())
{
// we're not a top level panel, so forward up the request instead of looping
if (ipanel()->RequestFocusPrev(_mainPanel->GetVParent(), _mainPanel->GetVPanel()))
{
bFound = true;
SetCurrentDefaultButton(NULL);
break;
}
}
}
// not found an item, loop back
newPosition = 9999999;
bRepeat = false;
}
if (best)
{
_currentFocus = best->GetVPanel();
best->RequestFocus(-1);
bFound = true;
if (!CanButtonBeDefault(best->GetVPanel()))
{
if (_defaultButton)
{
SetCurrentDefaultButton(_defaultButton);
}
else
{
SetCurrentDefaultButton(NULL);
//.........这里部分代码省略.........
示例6: RequestFocusNext
//-----------------------------------------------------------------------------
// Purpose: Sets the focus to the previous panel in the tab order
// Input : *panel - panel currently with focus
//-----------------------------------------------------------------------------
bool FocusNavGroup::RequestFocusNext(VPANEL panel)
{
// basic recursion guard, in case user has set up a bad focus hierarchy
static int stack_depth = 0;
stack_depth++;
_currentFocus = NULL;
int newPosition = 0;
if (panel)
{
newPosition = ipanel()->GetTabPosition(panel);
}
bool bFound = false;
bool bRepeat = true;
Panel *best = NULL;
while (1)
{
newPosition++;
int bestPosition = 999999;
// look for the next tab position
for (int i = 0; i < _mainPanel->GetChildCount(); i++)
{
Panel *child = _mainPanel->GetChild(i);
if ( !child )
continue;
if (child && child->IsVisible() && child->IsEnabled() && child->GetTabPosition())
{
int tabPosition = child->GetTabPosition();
if (tabPosition == newPosition)
{
// we've found the right tab
best = child;
bestPosition = newPosition;
// don't loop anymore since we've found the correct panel
break;
}
else if (tabPosition > newPosition && tabPosition < bestPosition)
{
// record the match since this is the closest so far
bestPosition = tabPosition;
best = child;
}
}
}
if (!bRepeat)
break;
if (best)
break;
// haven't found an item
// check to see if we should push the focus request up
if (!_topLevelFocus)
{
if (_mainPanel->GetVParent() && _mainPanel->GetVParent() != surface()->GetEmbeddedPanel())
{
// we're not a top level panel, so forward up the request instead of looping
if (stack_depth < 15)
{
if (ipanel()->RequestFocusNext(_mainPanel->GetVParent(), _mainPanel->GetVPanel()))
{
bFound = true;
SetCurrentDefaultButton(NULL);
break;
}
// if we find one then we break, otherwise we loop
}
}
}
// loop back
newPosition = 0;
bRepeat = false;
}
if (best)
{
_currentFocus = best->GetVPanel();
best->RequestFocus(1);
bFound = true;
if (!CanButtonBeDefault(best->GetVPanel()))
{
if (_defaultButton)
{
SetCurrentDefaultButton(_defaultButton);
}
else
{
//.........这里部分代码省略.........
示例7: PaintBackground
void LoadingProgress::PaintBackground()
{
int screenWide, screenTall;
surface()->GetScreenSize( screenWide, screenTall );
if ( m_bDrawBackground && m_pBGImage )
{
int x, y, wide, tall;
m_pBGImage->GetBounds( x, y, wide, tall );
surface()->DrawSetColor( Color( 255, 255, 255, 255 ) );
surface()->DrawSetTexture( m_pBGImage->GetImage()->GetID() );
surface()->DrawTexturedRect( x, y, x+wide, y+tall );
}
if ( m_bDrawPoster && m_pPoster && m_pPoster->GetImage() )
{
if ( m_bFullscreenPoster )
{
surface()->DrawSetColor( Color( 255, 255, 255, 255 ) );
surface()->DrawSetTexture( m_pPoster->GetImage()->GetID() );
surface()->DrawTexturedRect( 0, 0, screenWide, screenTall );
}
else
{
// fill black
surface()->DrawSetColor( Color( 0, 0, 0, 255 ) );
surface()->DrawFilledRect( 0, 0, screenWide, screenTall );
// overlay poster
int x, y, wide, tall;
m_pPoster->GetBounds( x, y, wide, tall );
surface()->DrawSetColor( Color( 255, 255, 255, 255 ) );
surface()->DrawSetTexture( m_pPoster->GetImage()->GetID() );
surface()->DrawTexturedRect( x, y, x+wide, y+tall );
}
}
if ( m_bDrawPoster && m_pFooter )
{
int screenWidth, screenHeight;
CBaseModPanel::GetSingleton().GetSize( screenWidth, screenHeight );
int x, y, wide, tall;
m_pFooter->GetBounds( x, y, wide, tall );
surface()->DrawSetColor( m_pFooter->GetBgColor() );
surface()->DrawFilledRect( 0, y, x+screenWidth, y+tall );
}
// this is where the spinner draws
bool bRenderSpinner = ( m_bDrawSpinner && m_pWorkingAnim );
Panel *pWaitscreen = CBaseModPanel::GetSingleton().GetWindow( WT_GENERICWAITSCREEN );
if ( pWaitscreen && pWaitscreen->IsVisible() && ( m_LoadingWindowType == LWT_BKGNDSCREEN ) )
bRenderSpinner = false; // Don't render spinner if the progress screen is displaying progress
if ( bRenderSpinner )
{
int x, y, wide, tall;
wide = tall = scheme()->GetProportionalScaledValue( 45 );
x = scheme()->GetProportionalScaledValue( 45 ) - wide/2;
y = screenTall - scheme()->GetProportionalScaledValue( 32 ) - tall/2;
m_pWorkingAnim->GetImage()->SetFrame( m_pWorkingAnim->GetFrame() );
surface()->DrawSetColor( Color( 255, 255, 255, 255 ) );
surface()->DrawSetTexture( m_pWorkingAnim->GetImage()->GetID() );
surface()->DrawTexturedRect( x, y, x+wide, y+tall );
}
if ( m_bDrawProgress && m_pProTotalProgress )
{
int x, y, wide, tall;
m_pProTotalProgress->GetBounds( x, y, wide, tall );
int iScreenWide, iScreenTall;
surface()->GetScreenSize( iScreenWide, iScreenTall );
float f = m_pProTotalProgress->GetProgress();
f = clamp( f, 0, 1.0f );
// Textured bar
surface()->DrawSetColor( Color( 255, 255, 255, 255 ) );
// Texture BG
surface()->DrawSetTexture( m_textureID_LoadingBarBG );
surface()->DrawTexturedRect( x, y, x + wide, y + tall );
surface()->DrawSetTexture( m_textureID_LoadingBar );
// YWB 10/13/2009: If we don't crop the texture coordinate down then we will see a jitter of the texture as the texture coordinate and the rounded width
// alias
int nIntegerWide = f * wide;
float flUsedFrac = (float)nIntegerWide / (float)wide;
DrawTexturedRectParms_t params;
params.x0 = x;
params.y0 = y;
params.x1 = x + nIntegerWide;
params.y1 = y + tall;
params.s0 = 0;
//.........这里部分代码省略.........
示例8: ProcessKey
int FilePanels::ProcessKey(const Manager::Key& Key)
{
auto LocalKey = Key.FarKey();
if (!LocalKey)
return TRUE;
if ((LocalKey==KEY_CTRLLEFT || LocalKey==KEY_CTRLRIGHT || LocalKey==KEY_CTRLNUMPAD4 || LocalKey==KEY_CTRLNUMPAD6
|| LocalKey==KEY_RCTRLLEFT || LocalKey==KEY_RCTRLRIGHT || LocalKey==KEY_RCTRLNUMPAD4 || LocalKey==KEY_RCTRLNUMPAD6
/* || LocalKey==KEY_CTRLUP || LocalKey==KEY_CTRLDOWN || LocalKey==KEY_CTRLNUMPAD8 || LocalKey==KEY_CTRLNUMPAD2 */) &&
(CmdLine->GetLength()>0 ||
(!LeftPanel->IsVisible() && !RightPanel->IsVisible())))
{
CmdLine->ProcessKey(Key);
return TRUE;
}
switch (LocalKey)
{
case KEY_F1:
{
if (!m_ActivePanel->ProcessKey(Manager::Key(KEY_F1)))
{
Help::create(L"Contents");
}
return TRUE;
}
case KEY_TAB:
{
SetAnhoterPanelFocus();
break;
}
case KEY_CTRLF1:
case KEY_RCTRLF1:
{
if (LeftPanel->IsVisible())
{
LeftPanel->Hide();
if (RightPanel->IsVisible())
RightPanel->SetFocus();
}
else
{
if (!RightPanel->IsVisible())
LeftPanel->SetFocus();
LeftPanel->Show();
}
Redraw();
break;
}
case KEY_CTRLF2:
case KEY_RCTRLF2:
{
if (RightPanel->IsVisible())
{
RightPanel->Hide();
if (LeftPanel->IsVisible())
LeftPanel->SetFocus();
}
else
{
if (!LeftPanel->IsVisible())
RightPanel->SetFocus();
RightPanel->Show();
}
Redraw();
break;
}
case KEY_CTRLB:
case KEY_RCTRLB:
{
Global->Opt->ShowKeyBar=!Global->Opt->ShowKeyBar;
m_KeyBarVisible = Global->Opt->ShowKeyBar;
if (!m_KeyBarVisible)
m_windowKeyBar->Hide();
SetScreenPosition();
Global->WindowManager->RefreshWindow();
break;
}
case KEY_CTRLT: case KEY_RCTRLT:
if (Global->Opt->Tree.TurnOffCompletely)
break;
case KEY_CTRLL: case KEY_RCTRLL:
case KEY_CTRLQ: case KEY_RCTRLQ:
{
if (m_ActivePanel->IsVisible())
{
Panel *AnotherPanel = PassivePanel();
int NewType;
if (LocalKey==KEY_CTRLL || LocalKey==KEY_RCTRLL)
NewType=INFO_PANEL;
//.........这里部分代码省略.........