MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / setSelected

Method setSelected

forms/listbox.cpp:472–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470}
471
472void ListBox::setSelected(sp<Control> c)
473{
474 // A sanity check to make sure the selected control actually belongs to this list
475 bool found = false;
476 for (auto child : this->Controls)
477 {
478 if (child == c)
479 {
480 found = true;
481 break;
482 }
483 }
484 if (c && !found)
485 {
486 LogError(
487 "Trying set ListBox selected control to something that isn't a member of the list");
488 }
489 this->selected = c;
490 this->setDirty();
491}
492
493sp<Control> ListBox::getSelectedItem() { return selected; }
494

Callers 5

ResearchScreenMethod · 0.45
populateUILabListMethod · 0.45
beginMethod · 0.45
populateResearchListMethod · 0.45
beginMethod · 0.45

Calls 1

setDirtyMethod · 0.80

Tested by

no test coverage detected