当前位置: 首页>>代码示例>>C++>>正文


C++ Panel::GetParent方法代码示例

本文整理汇总了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) );
			}
		}
	}
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:35,代码来源:commedittool.cpp

示例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 );
	}
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:41,代码来源:commedittool.cpp

示例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 );
}
开发者ID:1n73rf4c3,项目名称:source-sdk-2013,代码行数:50,代码来源:replaybrowserlistitempanel.cpp

示例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 );
				}
			}
		}
	}
开发者ID:hzqst,项目名称:CaptionMod,代码行数:39,代码来源:BuildModeDialog.cpp


注:本文中的Panel::GetParent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。