C++20
uramer 3 years ago
parent 01d65a14f1
commit 7f796d148e

@ -36,7 +36,6 @@ namespace LuaUi
{ "LuaTextEdit", "TextEdit" },
{ "LuaWindow", "Window" },
{ "LuaImage", "Image" },
{ "LuaContainer", "Container" },
};
return types;
}

@ -65,7 +65,7 @@ namespace LuaUi
mWidget->eventKeySetFocus.clear();
mWidget->eventKeyLostFocus.clear();
mOnSizeChange.reset();
mOnCoordChange.reset();
for (WidgetExtension* w : mChildren)
w->deinitialize();
@ -212,11 +212,7 @@ namespace LuaUi
if (oldCoord != newCoord)
mWidget->setCoord(newCoord);
if (oldCoord.size() != newCoord.size())
{
updateChildrenCoord();
if (mOnSizeChange.has_value())
mOnSizeChange.value()(newCoord.size());
}
if (oldCoord != newCoord && mOnCoordChange.has_value())
mOnCoordChange.value()(this, newCoord);
}

@ -62,11 +62,6 @@ namespace LuaUi
mOnCoordChange = callback;
}
void onSizeChange(const std::optional<std::function<void(MyGUI::IntSize)>>& callback)
{
mOnSizeChange = callback;
}
protected:
virtual void initialize();
sol::table makeTable() const;
@ -137,7 +132,6 @@ namespace LuaUi
void focusLoss(MyGUI::Widget*, MyGUI::Widget*);
std::optional<std::function<void(WidgetExtension*, MyGUI::IntCoord)>> mOnCoordChange;
std::optional<std::function<void(MyGUI::IntSize)>> mOnSizeChange;
};
class LuaWidget : public MyGUI::Widget, public WidgetExtension

Loading…
Cancel
Save