本文整理汇总了C++中CtrlGeneric::getTooltipText方法的典型用法代码示例。如果您正苦于以下问题:C++ CtrlGeneric::getTooltipText方法的具体用法?C++ CtrlGeneric::getTooltipText怎么用?C++ CtrlGeneric::getTooltipText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CtrlGeneric
的用法示例。
在下文中一共展示了CtrlGeneric::getTooltipText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onTooltipChange
void TopWindow::onTooltipChange( const CtrlGeneric &rCtrl )
{
// Check that the control is the active one
if( m_pLastHitControl && m_pLastHitControl == &rCtrl )
{
// Set the tooltip text variable
VarManager *pVarManager = VarManager::instance( getIntf() );
pVarManager->getTooltipText().set( rCtrl.getTooltipText() );
}
}
示例2: onTooltipChange
void TopWindow::onTooltipChange( const CtrlGeneric &rCtrl )
{
// Check that the control is the active one
if( m_pLastHitControl && m_pLastHitControl == &rCtrl )
{
if( rCtrl.getTooltipText().size() )
{
// Set the tooltip text variable
VarManager *pVarManager = VarManager::instance( getIntf() );
pVarManager->getTooltipText().set( rCtrl.getTooltipText() );
m_rWindowManager.showTooltip();
}
else
{
// Nothing to display, so hide the tooltip
m_rWindowManager.hideTooltip();
}
}
}
示例3: evt
CtrlGeneric *TopWindow::findHitControl( int xPos, int yPos )
{
if( m_pActiveLayout == NULL )
{
return NULL;
}
// Get the controls in the active layout
const list<LayeredControl> &ctrlList = m_pActiveLayout->getControlList();
list<LayeredControl>::const_reverse_iterator iter;
// New control hit by the mouse
CtrlGeneric *pNewHitControl = NULL;
// Loop on the control list to find the uppest hit control
for( iter = ctrlList.rbegin(); iter != ctrlList.rend(); iter++ )
{
// Get the position of the control in the layout
const Position *pos = (*iter).m_pControl->getPosition();
if( pos != NULL )
{
// Compute the coordinates of the mouse relative to the control
int xRel = xPos - pos->getLeft();
int yRel = yPos - pos->getTop();
CtrlGeneric *pCtrl = (*iter).m_pControl;
// Control hit ?
if( pCtrl->isVisible() && pCtrl->mouseOver( xRel, yRel ) )
{
pNewHitControl = (*iter).m_pControl;
break;
}
}
else
{
msg_Dbg( getIntf(), "Control at NULL position" );
}
}
// If the hit control has just been entered, send it an enter event
if( pNewHitControl && (pNewHitControl != m_pLastHitControl) )
{
// Don't send the event if another control captured the mouse
if( !m_pCapturingControl || (m_pCapturingControl == pNewHitControl ) )
{
EvtEnter evt( getIntf() );
pNewHitControl->handleEvent( evt );
if( !m_pCapturingControl )
{
// Show the tooltip
m_rWindowManager.hideTooltip();
UString tipText = pNewHitControl->getTooltipText();
if( tipText.length() > 0 )
{
// Set the tooltip text variable
VarManager *pVarManager = VarManager::instance( getIntf() );
pVarManager->getTooltipText().set( tipText );
m_rWindowManager.showTooltip();
}
}
}
}
return pNewHitControl;
}