| 116 | } |
| 117 | |
| 118 | void PanelControllers::notifySelectItem(MyGUI::ListBox* _sender, size_t _index) |
| 119 | { |
| 120 | destroyPropertyFields(); |
| 121 | |
| 122 | mIndexSelected = mList->getIndexSelected(); |
| 123 | if (MyGUI::ITEM_NONE == mIndexSelected) |
| 124 | return; |
| 125 | |
| 126 | const MyGUI::UString& key = mList->getItemNameAt(mIndexSelected); |
| 127 | mControllerName->setOnlyText(key); |
| 128 | auto property = mControllersProperties.find(key.asUTF8()); |
| 129 | |
| 130 | if (property != mControllersProperties.end()) |
| 131 | { |
| 132 | ControllerInfo* controllerInfo = *mList->getItemDataAt<ControllerInfo*>(mIndexSelected); |
| 133 | |
| 134 | for (const auto& [pKey, pValue] : property->second) |
| 135 | { |
| 136 | std::string_view value; |
| 137 | if (controllerInfo->mProperty.find(pKey) != controllerInfo->mProperty.end()) |
| 138 | value = controllerInfo->mProperty[pKey]; |
| 139 | |
| 140 | IPropertyField* field = PropertyFieldManager::getInstance().createPropertyField(mWidgetClient, pValue); |
| 141 | field->setTarget(mCurrentWidget); |
| 142 | field->setName(pKey); |
| 143 | field->setValue(value); |
| 144 | field->eventAction = MyGUI::newDelegate(this, &PanelControllers::notifyAction); |
| 145 | mFields.push_back(field); |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | updateSize(); |
| 150 | } |
| 151 | |
| 152 | void PanelControllers::updateSize() |
| 153 | { |
nothing calls this directly
no test coverage detected