MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / getDisplayText

Method getDisplayText

engine/source/gui/guiTreeViewCtrl.cc:224–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224void GuiTreeViewCtrl::Item::getDisplayText(U32 bufLen, char *buf)
225{
226 FrameAllocatorMarker txtAlloc;
227
228 if(mState.test(Item::InspectorData))
229 {
230 // Inspector data!
231 SimObject *pObject = getObject();
232 if(pObject)
233 {
234 const char* pObjName = pObject->getName();
235 const char* pInternalName = pObject->getInternalName();
236 if( pObjName != NULL )
237 dSprintf(buf, bufLen, "%d: %s - %s", pObject->getId(), pObject->getClassName(), pObjName );
238 else if ( pInternalName != NULL )
239 dSprintf(buf, bufLen, "%d: %s [%s]", pObject->getId(), pObject->getClassName(), pInternalName);
240 else
241 dSprintf(buf, bufLen, "%d: %s", pObject->getId(), pObject->getClassName());
242
243 }
244 }
245 else
246 {
247 // Script data! (copy it in)
248 dStrncpy(buf, getText(), bufLen);
249 }
250}
251
252const S32 GuiTreeViewCtrl::Item::getDisplayTextWidth(GFont *font)
253{

Callers 2

hitTestMethod · 0.80
onRenderCellMethod · 0.80

Calls 7

getInternalNameMethod · 0.80
getClassNameMethod · 0.80
dSprintfFunction · 0.50
dStrncpyFunction · 0.50
testMethod · 0.45
getNameMethod · 0.45
getIdMethod · 0.45

Tested by

no test coverage detected