| 529 | } |
| 530 | |
| 531 | void ComponentsDialog::handleTypeChange() |
| 532 | { |
| 533 | // Get the current selection |
| 534 | int typeId = wxutil::ChoiceHelper::GetSelectionId(_typeCombo); |
| 535 | |
| 536 | // Update the Objective object. The selected index must be valid, since the |
| 537 | // edit panel is only sensitive if a component is selected |
| 538 | int idx = getSelectedIndex(); |
| 539 | assert(idx >= 0); |
| 540 | |
| 541 | Component& comp = _components[idx]; |
| 542 | |
| 543 | // Store the newly-selected type in the Component |
| 544 | comp.setType(ComponentType::getComponentType(typeId)); |
| 545 | |
| 546 | // Change the ComponentEditor |
| 547 | changeComponentEditor(comp); |
| 548 | |
| 549 | // Update the components list with the new display string |
| 550 | wxutil::TreeModel::Row row(_componentView->GetSelection(), *_componentList); |
| 551 | |
| 552 | row[_columns.description] = comp.getString(); |
| 553 | row.SendItemChanged(); |
| 554 | |
| 555 | _updateNeeded = true; |
| 556 | } |
| 557 | |
| 558 | // Type combo changed |
| 559 | void ComponentsDialog::_onTypeChanged(wxCommandEvent& ev) |
nothing calls this directly
no test coverage detected