本文整理汇总了C++中vgui::DHANDLE::SetParent方法的典型用法代码示例。如果您正苦于以下问题:C++ DHANDLE::SetParent方法的具体用法?C++ DHANDLE::SetParent怎么用?C++ DHANDLE::SetParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vgui::DHANDLE
的用法示例。
在下文中一共展示了DHANDLE::SetParent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowTooltip
//-----------------------------------------------------------------------------
// Purpose: Display the tooltip
//-----------------------------------------------------------------------------
void Tooltip::ShowTooltip(Panel *currentPanel)
{
if ( s_TooltipWindow.Get() )
{
s_TooltipWindow->SetText(m_Text.Base());
s_TooltipWindow->SetParent(currentPanel);
}
_makeVisible = true;
PerformLayout();
}
示例2: ShowTooltip
//-----------------------------------------------------------------------------
// Purpose: Display the tooltip
//-----------------------------------------------------------------------------
void Tooltip::ShowTooltip(Panel *currentPanel)
{
if ( s_TooltipWindow.Get() )
{
int nLen = s_TooltipWindow->GetTextLength();
char *pBuf = (char*)_alloca( nLen+1 );
s_TooltipWindow->GetText( pBuf, nLen+1 );
Panel *pCurrentParent = s_TooltipWindow->GetParent();
_isDirty = _isDirty || ( pCurrentParent != currentPanel );
s_TooltipWindow->SetText( m_Text.Base() );
s_TooltipWindow->SetParent(currentPanel);
}
_makeVisible = true;
PerformLayout();
}
示例3: SetMainPanel
//-----------------------------------------------------------------------------
// Sets a panel to be the main panel
//-----------------------------------------------------------------------------
void CVsVGuiWindow::SetMainPanel( vgui::EditablePanel * pPanel )
{
Assert( m_hMainPanel.Get() == NULL );
Assert( m_hVGuiContext == vgui::DEFAULT_VGUI_CONTEXT );
m_hMainPanel = pPanel;
m_hMainPanel->SetParent( vgui::surface()->GetEmbeddedPanel() );
m_hMainPanel->SetVisible( true );
m_hMainPanel->SetCursor( vgui::dc_arrow );
m_hVGuiContext = vgui::ivgui()->CreateContext();
vgui::ivgui()->AssociatePanelWithContext( m_hVGuiContext, m_hMainPanel->GetVPanel() );
pPanel->InvalidateLayout();
EnableWindow( m_hWnd, true );
SetFocus( m_hWnd );
}
示例4: ShowTooltip
//-----------------------------------------------------------------------------
// Purpose: Display the tooltip
//-----------------------------------------------------------------------------
void TextTooltip::ShowTooltip(Panel *currentPanel)
{
if ( s_TooltipWindow.Get() )
{
int nLen = s_TooltipWindow->GetTextLength();
if ( nLen <= 0 )
{
// Empty tool tip, no need to show it
_makeVisible = false;
return;
}
char *pBuf = (char*)_alloca( nLen+1 );
s_TooltipWindow->GetText( pBuf, nLen+1 );
Panel *pCurrentParent = s_TooltipWindow->GetParent();
_isDirty = _isDirty || ( pCurrentParent != currentPanel );
s_TooltipWindow->SetText( m_Text.Base() );
s_TooltipWindow->SetParent(currentPanel);
}
BaseTooltip::ShowTooltip( currentPanel );
}