7 #ifndef __MYGUI_FLOW_DIRECTION_H__
8 #define __MYGUI_FLOW_DIRECTION_H__
38 const char* name = type.getValueName(value);
39 if (strcmp(name,
"") == 0 || name == _value)
break;
42 type.mValue = (
Enum)value;
46 bool isHorizontal()
const
48 return mValue == LeftToRight || mValue == RightToLeft;
51 bool isVertical()
const
53 return !isHorizontal();
58 return a.mValue == b.mValue;
63 return a.mValue != b.mValue;
66 friend std::ostream& operator << ( std::ostream& _stream,
const FlowDirection& _value )
68 _stream << _value.getValueName(_value.mValue);
72 friend std::istream& operator >> ( std::istream& _stream,
FlowDirection& _value )
76 _value = parse(value);
80 std::string print()
const
82 return getValueName(mValue);
91 const char* getValueName(
int _index)
const
93 static const char* values[MAX + 1] = {
"LeftToRight",
"RightToLeft",
"TopToBottom",
"BottomToTop",
"" };
94 return values[(_index < MAX && _index >= 0) ? _index : MAX];
103 #endif // __MYGUI_FLOW_DIRECTION_H__