24 Center = HCenter | VCenter,
28 HStretch = Left | Right,
32 VStretch = Top | Bottom,
34 Stretch = HStretch | VStretch,
38 Align(Enum _value = Default) :
43 bool isHCenter()
const
45 return HCenter == (mValue & HStretch);
48 bool isVCenter()
const
50 return VCenter == (mValue & VStretch);
55 return Center == (mValue & Stretch);
60 return Left == (mValue & HStretch);
65 return Right == (mValue & HStretch);
68 bool isHStretch()
const
70 return HStretch == (mValue & HStretch);
75 return Top == (mValue & VStretch);
80 return Bottom == (mValue & VStretch);
83 bool isVStretch()
const
85 return VStretch == (mValue & VStretch);
88 bool isStretch()
const
90 return Stretch == (mValue & Stretch);
93 bool isDefault()
const
95 return Default == (mValue & Stretch);
98 Align& operator|=(Align
const& _other)
100 mValue = (mValue | _other.mValue).mValue;
104 friend Align operator|(Enum
const& a, Enum
const& b)
106 return {Enum((
unsigned int)a | (
unsigned int)b)};
109 friend Align operator|(Align
const& a, Align
const& b)
111 return a.mValue | b.mValue;
114 friend bool operator==(Align
const& a, Align
const& b)
116 return a.mValue == b.mValue;
119 friend bool operator!=(Align
const& a, Align
const& b)
121 return a.mValue != b.mValue;
124 using MapAlign = std::map<std::string, Align>;
126 static Align parse(std::string_view _value);
128 std::string print()
const;
130 friend std::ostream& operator<<(std::ostream& _stream,
const Align& _value)
132 _stream << _value.print();
136 friend std::istream& operator>>(std::istream& _stream, Align& _value)
138 _value.mValue = Enum(0);
142 const MapAlign& map_names = Align::getValueNames();
143 auto iter = map_names.find(value);
144 if (iter != map_names.end())
145 _value |= iter->second;
151 iter = map_names.find(value2);
152 if (iter != map_names.end())
153 _value |= iter->second;
165 static const MapAlign& getValueNames();
constexpr unsigned int MYGUI_FLAG(uint8_t num)
constexpr unsigned int MYGUI_FLAG_NONE