MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / handleTypeChange

Method handleTypeChange

plugins/dm.objectives/ComponentsDialog.cpp:531–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529}
530
531void 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
559void ComponentsDialog::_onTypeChanged(wxCommandEvent& ev)

Callers

nothing calls this directly

Calls 3

SendItemChangedMethod · 0.80
setTypeMethod · 0.45
getStringMethod · 0.45

Tested by

no test coverage detected