* Control containing two MultilistBox for assignment state. * @controlLength - length of the control */
| 618 | * @controlLength - length of the control |
| 619 | */ |
| 620 | sp<Control> ControlGenerator::createDoubleListControl(const int controlLength) |
| 621 | { |
| 622 | auto rubberItem = mksp<Control>(); |
| 623 | rubberItem->Size = Vec2<int>{controlLength, 1}; |
| 624 | rubberItem->setFuncPreRender( |
| 625 | [](sp<Control> control) |
| 626 | { |
| 627 | int sizeY = 1; |
| 628 | for (auto &c : control->Controls) |
| 629 | { |
| 630 | if (!c->isVisible()) |
| 631 | continue; |
| 632 | sizeY = std::max(sizeY, c->Location.y + c->Size.y); |
| 633 | } |
| 634 | control->Size.y = sizeY; |
| 635 | }); |
| 636 | |
| 637 | auto leftList = rubberItem->createChild<MultilistBox>(); |
| 638 | leftList->Name = LEFT_LIST_NAME; |
| 639 | |
| 640 | auto rightList = rubberItem->createChild<MultilistBox>(); |
| 641 | rightList->Location = Vec2<int>{controlLength / 2, 0}; |
| 642 | rightList->Name = RIGHT_LIST_NAME; |
| 643 | |
| 644 | return rubberItem; |
| 645 | } |
| 646 | |
| 647 | OrganisationInfo ControlGenerator::createOrganisationInfo(GameState &state, sp<Organisation> org) |
| 648 | { |
nothing calls this directly
no test coverage detected