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

Method removeItem

forms/listbox.cpp:319–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317}
318
319sp<Control> ListBox::removeItem(sp<Control> Item)
320{
321 this->setDirty();
322 if (Item == this->selected)
323 {
324 this->selected = nullptr;
325 }
326 if (Item == this->hovered)
327 {
328 this->hovered = nullptr;
329 }
330 for (auto i = Controls.begin(); i != Controls.end(); i++)
331 {
332 if (*i == Item)
333 {
334 Controls.erase(i);
335 resolveLocation();
336 Item->setParent(nullptr);
337 return Item;
338 }
339 }
340 return nullptr;
341}
342
343sp<Control> ListBox::removeItem(int Index)
344{

Callers 1

RecruitScreenMethod · 0.45

Calls 4

setDirtyMethod · 0.80
endMethod · 0.80
setParentMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected