| 32 | } |
| 33 | |
| 34 | void PanelMainProperties::update(MyGUI::Widget* _currentWidget) |
| 35 | { |
| 36 | hidePropertyFields(); |
| 37 | |
| 38 | mCurrentWidget = _currentWidget; |
| 39 | if (mCurrentWidget == nullptr) |
| 40 | return; |
| 41 | |
| 42 | WidgetStyle* widgetType = WidgetTypes::getInstance().findWidgetStyle(mCurrentWidget->getTypeName()); |
| 43 | WidgetContainer* widgetContainer = EditorWidgets::getInstance().find(mCurrentWidget); |
| 44 | bool existTargetType = widgetContainer->existUserData(mUserDataTargetType); |
| 45 | |
| 46 | IPropertyField* field = getPropertyField(mWidgetClient, "Name", "Name"); |
| 47 | field->setTarget(_currentWidget); |
| 48 | field->setValue(widgetContainer->getName()); |
| 49 | |
| 50 | if (widgetType->resizeable) |
| 51 | { |
| 52 | field = getPropertyField(mWidgetClient, "Position", "Position"); |
| 53 | field->setTarget(_currentWidget); |
| 54 | field->setValue(widgetContainer->position()); |
| 55 | } |
| 56 | |
| 57 | field = getPropertyField(mWidgetClient, "Type", "Type"); |
| 58 | field->setTarget(_currentWidget); |
| 59 | if (existTargetType) |
| 60 | { |
| 61 | std::string_view targetType = widgetContainer->getUserData(mUserDataTargetType); |
| 62 | field->setValue(targetType); |
| 63 | } |
| 64 | else |
| 65 | { |
| 66 | field->setValue(widgetContainer->getType()); |
| 67 | } |
| 68 | |
| 69 | field = getPropertyField(mWidgetClient, "Align", "Align"); |
| 70 | field->setTarget(_currentWidget); |
| 71 | field->setValue(widgetContainer->getAlign()); |
| 72 | |
| 73 | if (mCurrentWidget->isRootWidget()) |
| 74 | { |
| 75 | field = getPropertyField(mWidgetClient, "Layer", "Layer"); |
| 76 | field->setTarget(_currentWidget); |
| 77 | field->setValue(widgetContainer->getLayerName()); |
| 78 | |
| 79 | field = getPropertyField(mWidgetClient, "Template", "Bool"); |
| 80 | field->setTarget(_currentWidget); |
| 81 | field->setValue(existTargetType ? "true" : "false"); |
| 82 | } |
| 83 | |
| 84 | field = getPropertyField(mWidgetClient, "Skin", "Skin"); |
| 85 | field->setTarget(_currentWidget); |
| 86 | field->setValue(widgetContainer->getSkin()); |
| 87 | |
| 88 | updateSize(); |
| 89 | } |
| 90 | |
| 91 | void PanelMainProperties::updateSize() |
nothing calls this directly
no test coverage detected