7 #ifndef __MyGUI_TCOORD_H__
8 #define __MyGUI_TCOORD_H__
35 TCoord(T
const& _left, T
const& _top, T
const& _width, T
const& _height) :
84 return TCoord(left - _obj.
left, top - _obj.
top, width, height);
99 return TCoord(left + _obj.
left, top + _obj.
top, width, height);
116 template<
typename U >
142 return ((left == _obj.
left) && (top == _obj.
top) && (width == _obj.
width) && (height == _obj.
height));
147 return !((left == _obj.
left) && (top == _obj.
top) && (width == _obj.
width) && (height == _obj.
height));
162 left = top = width = height = 0;
165 void set(T
const& _left, T
const& _top, T
const& _width, T
const& _height)
182 return ((left == 0) && (top == 0) && (width == 0) && (height == 0));
202 std::ostringstream stream;
210 std::istringstream stream(_value);
218 int item = stream.get();
221 if (item !=
' ' && item !=
'\t')
229 friend std::ostream& operator << (std::ostream& _stream, const TCoord<T>& _value)
231 _stream << _value.
left <<
" " << _value.top <<
" " << _value.width <<
" " << _value.height;
248 #endif // __MyGUI_TCOORD_H__
std::string print() const
bool operator==(TCoord const &_obj) const
void swap(TCoord &_value)
TCoord operator+(TCoord const &_obj) const
bool operator!=(TCoord const &_obj) const
void set(T const &_left, T const &_top, T const &_width, T const &_height)
bool inside(const TPoint< T > &_value) const
TCoord(TPoint< T > const &_point, TSize< T > const &_size)
TCoord(TCoord const &_obj)
TCoord & operator=(TCoord const &_obj)
TCoord operator-(TCoord const &_obj) const
TCoord & operator-=(TCoord const &_obj)
TCoord(T const &_left, T const &_top, T const &_width, T const &_height)
static TCoord< T > parse(const std::string &_value)
friend std::istream & operator>>(std::istream &_stream, TCoord< T > &_value)
TPoint< T > point() const
TCoord & operator+=(TCoord const &_obj)