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

Method editItem

Engine/source/gui/controls/guiTreeViewCtrl.cpp:2551–2572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2549//-----------------------------------------------------------------------------
2550
2551bool GuiTreeViewCtrl::editItem( S32 itemId, const char* newText, const char* newValue )
2552{
2553 Item* item = getItem( itemId );
2554 if ( !item )
2555 {
2556 Con::errorf(ConsoleLogEntry::General, "GuiTreeViewCtrl::editItem: invalid item id: %d!", itemId);
2557 return false;
2558 }
2559
2560 if ( item->mState.test(Item::InspectorData) )
2561 {
2562 Con::errorf(ConsoleLogEntry::General, "GuiTreeViewCtrl::editItem: item %d is inspector data and may not be modified!", itemId);
2563 return false;
2564 }
2565
2566 item->setText( StringTable->insert( newText, true ) );
2567 item->setValue( StringTable->insert( newValue, true ) );
2568
2569 // Update the widths and such:
2570 mFlags.set(RebuildVisible);
2571 return true;
2572}
2573
2574//-----------------------------------------------------------------------------
2575

Callers 1

Calls 6

errorfFunction · 0.50
testMethod · 0.45
setTextMethod · 0.45
insertMethod · 0.45
setValueMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected