23 #ifndef __MYGUI_I_CROPPED_RECTANGLE_H__
24 #define __MYGUI_I_CROPPED_RECTANGLE_H__
39 mAlign(
Align::Default)
63 virtual void setVisible(
bool _value) { mVisible = _value; }
70 IntRect getAbsoluteRect()
const {
return IntRect(mAbsolutePosition.left, mAbsolutePosition.top, mAbsolutePosition.left+mCoord.width, mAbsolutePosition.top+mCoord.height); }
85 int getLeft()
const {
return mCoord.left; }
87 int getRight()
const {
return mCoord.right(); }
89 int getTop()
const {
return mCoord.top; }
107 int _getViewWidth()
const {
return mCoord.width - mMargin.left - mMargin.right; }
108 int _getViewHeight()
const {
return mCoord.height - mMargin.top - mMargin.bottom; }
124 #ifndef MYGUI_DONT_USE_OBSOLETE
126 MYGUI_OBSOLETE(
"use : void ICroppedRectangle::setVisible(bool _visible)")
127 void show() { setVisible(
true); }
128 MYGUI_OBSOLETE(
"use : void ICroppedRectangle::setVisible(bool _visible)")
129 void hide() { setVisible(
false); }
131 bool isShow() {
return isVisible(); }
133 #endif // MYGUI_DONT_USE_OBSOLETE
136 bool _checkPoint(
int _left,
int _top)
138 return ! ((_getViewLeft() > _left) || (_getViewTop() > _top) || (_getViewRight() < _left) || (_getViewBottom() < _top));
145 if (getLeft() < mCroppedParent->mMargin.left)
147 mMargin.left = mCroppedParent->mMargin.left - getLeft();
156 if (getRight() > mCroppedParent->getWidth() - mCroppedParent->mMargin.right)
158 mMargin.right = getRight() - (mCroppedParent->getWidth() - mCroppedParent->mMargin.right);
167 if (getTop() < mCroppedParent->mMargin.top)
169 mMargin.top = mCroppedParent->mMargin.top - getTop();
178 if (getBottom() > mCroppedParent->getHeight() - mCroppedParent->mMargin.bottom)
180 mMargin.bottom = getBottom() - (mCroppedParent->getHeight() - mCroppedParent->mMargin.bottom);
193 return ( (getRight() < mCroppedParent->mMargin.left ) ||
194 (getLeft() > mCroppedParent->getWidth() - mCroppedParent->mMargin.right ) ||
195 (getBottom() < mCroppedParent->mMargin.top ) ||
196 (getTop() > mCroppedParent->getHeight() - mCroppedParent->mMargin.bottom ) );
213 #endif // __MYGUI_I_CROPPED_RECTANGLE_H__