本文整理汇总了C++中Panel::GetParent方法的典型用法代码示例。如果您正苦于以下问题:C++ Panel::GetParent方法的具体用法?C++ Panel::GetParent怎么用?C++ Panel::GetParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Panel
的用法示例。
在下文中一共展示了Panel::GetParent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BringConsoleToFront
void CCommEditTool::BringConsoleToFront()
{
CConsolePage *p = GetConsole();
Panel *pPage = p->GetParent();
if ( pPage == NULL )
{
OnToggleConsole();
}
else
{
ToolWindow *tw = dynamic_cast< ToolWindow * >( pPage->GetParent() );
if ( tw )
{
if ( tw->GetActivePage() != p )
{
tw->SetActivePage( p );
vgui::surface()->SetForegroundWindow( tw->GetVPanel() );
p->TextEntryRequestFocus();
}
else
{
PropertySheet *pSheet = tw->GetPropertySheet();
int nPageCount = pSheet->GetNumPages();
int i;
for ( i = 0; i < nPageCount; ++i )
{
if ( p == pSheet->GetPage(i) )
break;
}
i = ( i + 1 ) % nPageCount;
pSheet->SetActivePage( pSheet->GetPage(i) );
}
}
}
}
示例2: OnShowMenu
void CCommEditViewMenuButton::OnShowMenu(vgui::Menu *menu)
{
BaseClass::OnShowMenu( menu );
// Update the menu
int id;
CCommEditDoc *pDoc = m_pTool->GetDocument();
if ( pDoc )
{
id = m_Items.Find( "properties" );
m_pMenu->SetItemEnabled( id, true );
Panel *p;
p = m_pTool->GetProperties();
Assert( p );
m_pMenu->SetMenuItemChecked( id, ( p && p->GetParent() ) ? true : false );
id = m_Items.Find( "commentarynodebrowser" );
m_pMenu->SetItemEnabled( id, true );
p = m_pTool->GetCommentaryNodeBrowser();
Assert( p );
m_pMenu->SetMenuItemChecked( id, ( p && p->GetParent() ) ? true : false );
id = m_Items.Find( "console" );
m_pMenu->SetItemEnabled( id, true );
CConsolePage *console = m_pTool->GetConsole();
m_pMenu->SetMenuItemChecked( id, console->GetParent() );
}
else
{
id = m_Items.Find( "properties" );
m_pMenu->SetItemEnabled( id, false );
id = m_Items.Find( "commentarynodebrowser" );
m_pMenu->SetItemEnabled( id, false );
id = m_Items.Find( "console" );
m_pMenu->SetItemEnabled( id, false );
}
}
示例3: GetVPanel
CReplayBrowserThumbnail::CReplayBrowserThumbnail( Panel *pParent, const char *pName, QueryableReplayItemHandle_t hReplayItem,
IReplayItemManager *pReplayItemManager )
: CReplayBasePanel( pParent, pName ),
m_hReplayItem( hReplayItem ),
m_pReplayItemManager( pReplayItemManager ),
m_bMouseOver( false ),
m_pMoviePlayer( NULL ),
m_flLastMovieScrubTime( 0.0f ),
m_flHoverStartTime( 0.0f ),
m_flLastProgressChangeTime( 0.0f )
{
SetScheme( "ClientScheme" );
ivgui()->AddTickSignal( GetVPanel(), 10 );
// Add the list panel as an action signal target
// NOTE: Vile hack.
Panel *pTarget = GetParent();
while ( pTarget )
{
if ( !V_strcmp( "BasePage", pTarget->GetName() ) )
break;
pTarget = pTarget->GetParent();
}
Assert( pTarget );
AddActionSignalTarget( pTarget );
m_pScreenshotThumb = new CCrossfadableImagePanel( this, "ScreenshotThumbnail" );
m_pTitle = new Label( this, "TitleLabel", "" );
m_pDownloadLabel = new Label( this, "DownloadLabel", "" );
m_pRecordingInProgressLabel = new Label( this, "RecordingInProgressLabel", "" );
m_pDownloadProgress = new ProgressBar( this, "DownloadProgress" );
m_pDownloadButton = new CExButton( this, "DownloadButton", "#Replay_Download" );
m_pDeleteButton = new CExButton( this, "DeleteButton", "#X_Delete" );
m_pErrorLabel = new Label( this, "ErrorLabel", "" );
m_pDownloadOverlay = new Panel( this, "DownloadOverlay" );
m_pBorderPanel = new EditablePanel( this, "BorderPanel" );
m_pScreenshotThumb->InstallMouseHandler( this );
m_pDownloadButton->AddActionSignalTarget( this );
m_pDownloadButton->SetCommand( new KeyValues( "download" ) );
m_pDeleteButton->AddActionSignalTarget( this );
m_pDeleteButton->SetCommand( new KeyValues( "delete_replayitem" ) );
SetProportional( true );
SetReplayItem( hReplayItem );
}
示例4: OnShowMenu
virtual void OnShowMenu(Menu *menu)
{
menu->DeleteAllItems();
if ( !m_hContext.Get() )
return;
if ( m_bParents )
{
Panel *p = m_hContext->GetParent();
while ( p )
{
EditablePanel *ep = dynamic_cast < EditablePanel * >( p );
if ( ep && ep->GetBuildGroup() )
{
KeyValues *kv = new KeyValues( "Panel" );
kv->SetPtr( "ptr", p );
char const *text = ep->GetName() ? ep->GetName() : "unnamed";
menu->AddMenuItem( text, new KeyValues("SetText", "text", text), GetParent(), kv );
}
p = p->GetParent();
}
}
else
{
int i;
int c = m_hContext->GetChildCount();
for ( i = 0; i < c; ++i )
{
EditablePanel *ep = dynamic_cast < EditablePanel * >( m_hContext->GetChild( i ) );
if ( ep && ep->IsVisible() && ep->GetBuildGroup() )
{
KeyValues *kv = new KeyValues( "Panel" );
kv->SetPtr( "ptr", ep );
char const *text = ep->GetName() ? ep->GetName() : "unnamed";
menu->AddMenuItem( text, new KeyValues("SetText", "text", text), GetParent(), kv );
}
}
}
}