Example #1
0
inline VmbErrorType EnumEntry::GetTooltip( std::string &rStrTooltip ) const
{
    VmbErrorType res;
    VmbUint32_t nLength;

    res = GetTooltip( NULL, nLength );
    if ( VmbErrorSuccess == res )
    {
        if ( 0 < nLength )
        {
            rStrTooltip.resize( nLength );
            res = GetTooltip( &rStrTooltip[0], nLength );
            if ( VmbErrorSuccess == res )
            {
                size_t nPos = rStrTooltip.find( '\0' );
                if ( nLength-1 > nPos )
                {
                    rStrTooltip.resize( nPos );
                }
            }
        }
        else
        {
            rStrTooltip.clear();
        }
    }

    return res;
}
Example #2
0
// virtual 
BOOL FW_Cmd::OnExecute()
{
	// Terminate the previous active command
	FW_Cmds* pCmds = FW_WinApp::GetWinApp()->GetCmdManager()->GetCmds();
	ASSERT(pCmds);
	FW_Cmd* pCmd = pCmds->GetActiveCmd();
	if(pCmd)
		pCmd->OnTerminate();

	// Set this command as active command
	SetActive(true);

	// Get previous status
	m_strStatusPrev = FW_MDIFrameWnd::GetMDIFrameWnd()->GetStatus(0);

	// Set status
	FW_MDIFrameWnd::GetMDIFrameWnd()->SetStatus(0, GetTooltip());

	// Get active view
	m_pView = FW_MDIFrameWnd::GetActiveView();

	// Get active document
	m_pDoc	= FW_MDIFrameWnd::GetActiveDoc();

	return TRUE;
}
INT_PTR CXTPReportGroupRow::OnToolHitTest(CPoint /*point*/, TOOLINFO* pTI)
{
	INT_PTR nHit = (INT_PTR)this;
	CString strTip = GetTooltip();

	if (strTip.IsEmpty())
		return -1;

//Clean markup
	CString s(strTip), u, v;
	int j = s.Find(_T("<"));
	int k = s.Find(_T(">"));
	while (j > -1 && k > -1)
	{
		u = s.Left(j);
		v = s.Mid(k + 1);
		s = u + v;
		strTip = s;
		j = s.Find(_T("<"));
		k = s.Find(_T(">"));
	}

	CXTPToolTipContext::FillInToolInfo(pTI, m_pControl->m_hWnd, m_rcRow, nHit, strTip);

	return nHit;
}
Status *StatusManager::GetCustomStatus(const QString& aAccount, const QString& nStatusName)
{
    Status *savedStatus = new Status();
    QString lowererStatusId = nStatusName.toLower();
    quint32 statusNum = Status::FromString(lowererStatusId);
    savedStatus->Set(statusNum,(statusNum == STATUS_USER_DEFINED) ? lowererStatusId : "");
    savedStatus->SetTitle(GetTooltip(lowererStatusId));
    savedStatus->SetDescription("");
    return savedStatus;
}
QString StatusManager::GetTooltip( const QString& nStatusName )
{
    QStringList splitted(nStatusName.split('_'));
    if (splitted.count() < 2) return "?";
    QString lowerId = splitted[1].toLower();

    if (lowerId == "offline")
        return tr("Offline");
    else if (lowerId == "dnd")
        return tr("Do Not Disturb");
    else if (lowerId == "chat")
        return tr("Free For Chat");
    else if (lowerId == "online")
        lowerId = "1";
    else if (lowerId == "away")
        lowerId = "2";
    else if (lowerId == "invisible")
        lowerId = "3";

    return GetTooltip(lowerId.toUInt());
}
Example #6
0
// When the object is initialized, this method is called.
int32 UIWidget::OnInitialize(void)
{
	GTGameObject::OnInitialize();

	// Set AnchorPoint
	SetAnchorPoint(m_AnchorPoint);

	// If the tooltip and text are not available,
	// the font is not going to be initialized.
	if(GetTooltip().Length() || GetText().Length())
	{
		// Initialize the font
		InitializeFont();
		// Set the text
		if(m_pUILabelBMFont)
		{
			m_pUILabelBMFont->SetText(GetText().ToCharString());
			// Setup anchor point for the the lable object
			m_pUILabelBMFont->SetAnchorPoint(m_AnchorPoint);
		}
	}
		
	// Initialize sprite size
	if(m_Sprite.HasSprite())
	{
		UISkinPiece* pSkinPiece = GetSkinPiece();
		GTSize size = GetSize();
		if(pSkinPiece)
		{
			m_Sprite.SetScale(
				size.width/pSkinPiece->GetRect().size.width,
				size.height/pSkinPiece->GetRect().size.height
				);			
			// Setup anchor point for the sprite
			m_Sprite.SetAnchorPoint(m_AnchorPoint);
		}
	}
	
	return 1;
}
FString UK2Node_ForEachElementInEnum::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
	return GetTooltip();
}
TSharedRef<SToolTip> FEditorClassUtils::GetTooltip(const UClass* Class)
{
    return (Class ? GetTooltip(Class, Class->GetToolTipText()) : SNew(SToolTip));
}
Example #9
0
void GUITooltip::Update(IGUIObject* Nearest, CPos MousePos, CGUI* GUI)
{
	// Called once per frame, so efficiency isn't vital


	double now = timer_Time();

	CStr style;

	int nextstate = -1;

	switch (m_State)
	{
	case ST_IN_MOTION:
		if (MousePos == m_PreviousMousePos)
		{
			if (GetTooltip(Nearest, style))
				nextstate = ST_STATIONARY_TOOLTIP;
			else
				nextstate = ST_STATIONARY_NO_TOOLTIP;
		}
		else
		{
			// Check for movement onto a zero-delayed tooltip
			if (GetTooltip(Nearest, style) && GetTooltipDelay(style, GUI)==0)
			{
				// Reset any previous tooltips completely
				//m_Time = now + (double)GetTooltipDelay(style, GUI) / 1000.;
				HideTooltip(m_PreviousTooltipName, GUI);

				nextstate = ST_SHOWING;
			}
		}
		break;

	case ST_STATIONARY_NO_TOOLTIP:
		if (MousePos != m_PreviousMousePos)
			nextstate = ST_IN_MOTION;
		break;

	case ST_STATIONARY_TOOLTIP:
		if (MousePos != m_PreviousMousePos)
			nextstate = ST_IN_MOTION;
		else if (now >= m_Time)
		{
			// Make sure the tooltip still exists
			if (GetTooltip(Nearest, style))
				nextstate = ST_SHOWING;
			else
			{
				// Failed to retrieve style - the object has probably been
				// altered, so just restart the process
				nextstate = ST_IN_MOTION;
			}
		}
		break;

	case ST_SHOWING:
		// Handle special case of icon tooltips
		if (Nearest == m_PreviousObject && (!m_IsIconTooltip || Nearest->MouseOverIcon()))
		{
			// Still showing the same object's tooltip, but the text might have changed
			if (GetTooltip(Nearest, style))
				ShowTooltip(Nearest, MousePos, style, GUI);
		}
		else
		{
			// Mouse moved onto a new object

			if (GetTooltip(Nearest, style))
			{	
				CStr style_old;

				// If we're displaying a tooltip with no delay, then we want to 
				//  reset so that other object that should have delay can't
				//  "ride this tail", it have to wait.
				// Notice that this doesn't apply to when you go from one delay=0
				//  to another delay=0
				if (GetTooltip(m_PreviousObject, style_old) && GetTooltipDelay(style_old, GUI)==0 &&
					GetTooltipDelay(style, GUI)!=0)
				{
					HideTooltip(m_PreviousTooltipName, GUI);
					nextstate = ST_IN_MOTION;
				}
				else
				{
					// Hide old scrollbar
					HideTooltip(m_PreviousTooltipName, GUI);
					nextstate = ST_SHOWING;
				}
			}
			else
			{	
				nextstate = ST_COOLING;
			}
		}
		break;

	case ST_COOLING:
		if (GetTooltip(Nearest, style))
			nextstate = ST_SHOWING;
		else if (now >= m_Time)
			nextstate = ST_IN_MOTION;
		break;
	}

	// Handle state-entry code:

	if (nextstate != -1)
	{
		switch (nextstate)
		{
		case ST_STATIONARY_TOOLTIP:
			m_Time = now + (double)GetTooltipDelay(style, GUI) / 1000.;
			break;

		case ST_SHOWING:
			ShowTooltip(Nearest, MousePos, style, GUI);
			m_PreviousTooltipName = style;
			break;

		case ST_COOLING:
			HideTooltip(m_PreviousTooltipName, GUI);
			m_Time = now + CooldownTime;
			break;
		}

		m_State = nextstate;
	}

	m_PreviousMousePos = MousePos;
	m_PreviousObject = Nearest;
}
FString UK2Node_CastByteToEnum::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
	return GetTooltip();
}