| 39 | } |
| 40 | |
| 41 | void PropertyPanelControl::InitialiseProperty(PropertyPtr _property, int& _height) |
| 42 | { |
| 43 | const std::string& type = _property->getType()->getType(); |
| 44 | PropertyControl* control = nullptr; |
| 45 | |
| 46 | for (auto& child : mPropertyControls) |
| 47 | { |
| 48 | if (child.first == type && !child.second->getRoot()->getVisible()) |
| 49 | { |
| 50 | control = child.second; |
| 51 | control->getRoot()->setVisible(true); |
| 52 | break; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | if (control == nullptr) |
| 57 | { |
| 58 | control = |
| 59 | components::FactoryManager::GetInstance().CreateItem<PropertyControl>(_property->getType()->getType()); |
| 60 | if (control != nullptr) |
| 61 | { |
| 62 | control->Initialise(this, mScrollView, std::string_view{}); |
| 63 | |
| 64 | mPropertyControls.emplace_back(_property->getType()->getType(), control); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | if (control != nullptr) |
| 69 | { |
| 70 | control->setProperty(_property); |
| 71 | control->getRoot()->setPosition(0, _height); |
| 72 | |
| 73 | _height += control->getRoot()->getHeight() + mDistance; |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | void PropertyPanelControl::setCurrentData(DataPtr _data) |
| 78 | { |
nothing calls this directly
no test coverage detected