| 2549 | //----------------------------------------------------------------------------- |
| 2550 | |
| 2551 | bool 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 | |