| 622 | //----------------------------------------------------------------------------- |
| 623 | |
| 624 | void 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 |
no test coverage detected