Something went wrong. Try again.
OpenMW is an open implementation of the Morrowind engine
Something went wrong. Try again.
1.8 kB · 72 lines
C++
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273#ifndef OPENMW_LUAUI_FLEX#define OPENMW_LUAUI_FLEX
#include <vector>
#include "alignment.hpp"#include "widget.hpp"
namespace LuaUi{ class LuaFlex : public MyGUI::Widget, public WidgetExtension { MYGUI_RTTI_DERIVED(LuaFlex)
protected: MyGUI::IntSize calculateSize() const override; void updateProperties() override; void updateChildren() override; MyGUI::IntSize childScalingSize() const override;
void updateCoord() override;
const std::vector<std::string_view>& allUsedProperties() const override;
private: bool mHorizontal; bool mAutoSized; MyGUI::IntSize mChildrenSize; Alignment mAlign; Alignment mArrange; int mGap; bool mWrap;
template <typename T> T& primary(MyGUI::types::TPoint<T>& point) const { return mHorizontal ? point.left : point.top; }
template <typename T> T& secondary(MyGUI::types::TPoint<T>& point) const { return mHorizontal ? point.top : point.left; }
template <typename T> T& primary(MyGUI::types::TSize<T>& size) const { return mHorizontal ? size.width : size.height; }
template <typename T> T& secondary(MyGUI::types::TSize<T>& size) const { return mHorizontal ? size.height : size.width; }
template <typename T> T primary(const MyGUI::types::TSize<T>& size) const { return mHorizontal ? size.width : size.height; }
template <typename T> T secondary(const MyGUI::types::TSize<T>& size) const { return mHorizontal ? size.height : size.width; } };}
#endif // OPENMW_LUAUI_FLEX