MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getTooltipText

Method getTooltipText

Engine/source/gui/controls/guiTreeViewCtrl.cpp:624–652  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

622//-----------------------------------------------------------------------------
623
624void GuiTreeViewCtrl::Item::getTooltipText(U32 bufLen, char *buf)
625{
626 getDisplayText(bufLen, buf);
627
628 if(mState.test(Item::InspectorData))
629 {
630 SimObject *pObject = getObject();
631 if(pObject)
632 {
633 const char* pClassName = pObject->getClassName();
634
635 // Retrieve custom tooltip string
636 String method("GetTooltip");
637 method += pClassName;
638 if(mParentControl->isMethod(method.c_str()))
639 {
640 ConsoleValue cValue = Con::executef( mParentControl, method.c_str(), pObject->getIdString() );
641 const char* tooltip = cValue.getString();
642
643 dsize_t len = dStrlen(buf);
644 S32 newBufLen = bufLen-len;
645 if(dStrlen(tooltip) > 0 && newBufLen > 0)
646 {
647 dSprintf(buf+len, newBufLen, "\n%s", tooltip);
648 }
649 }
650 }
651 }
652}
653
654//-----------------------------------------------------------------------------
655

Callers 1

renderTooltipMethod · 0.80

Calls 9

executefFunction · 0.85
dSprintfFunction · 0.85
getIdStringMethod · 0.80
dStrlenFunction · 0.50
testMethod · 0.45
getClassNameMethod · 0.45
isMethodMethod · 0.45
c_strMethod · 0.45
getStringMethod · 0.45

Tested by

no test coverage detected