//----------------------------------------------------------------------------- // 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(); }
//----------------------------------------------------------------------------- // 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 ); }