136class DLL_TOOLSFUNCTION
CXRect :
public RECT
145 bool CopyRect(RECT
rc) {
return xCopyRect(
this, &
rc); }
146 bool DeflateRect(
int x,
int y) {
return xInflateRect(
this, -x, -y); }
147 bool DeflateRect(SIZE size) {
return xInflateRect(
this, -size.cx, -size.cy); }
148 bool DeflateRect(RECT
rc) {
return xInflateRect(
this,
rc.left -
rc.right,
rc.top -
rc.bottom); }
149 bool DeflateRect(
int l,
int t,
int r,
int b) {
return xInflateRect(
this,
l - r, t - b); }
150 bool EqualRect(RECT
rc)
const {
return xEqualRect(&
rc,
this); }
151 bool InflateRect(
int dx,
int dy) {
return xInflateRect(
this,
dx,
dy); }
152 bool InflateRect(SIZE
sz) {
return xInflateRect(
this,
sz.cx,
sz.cy); }
153 bool InflateRect(RECT
rc) {
return xInflateRect(
this,
rc.right -
rc.left,
rc.bottom -
rc.top); }
154 bool InflateRect(
int l,
int t,
int r,
int b) {
return xInflateRect(
this, r -
l, b - t); }
155 bool IntersectRect(RECT
rc1, RECT
rc2) {
return xIntersectRect(
this, &
rc1, &
rc2); }
156 bool IsRectEmpty()
const {
return xIsRectEmpty(
this); }
157 bool IsRectNull()
const {
return (left == 0 && right == 0 &&
top == 0 &&
bottom == 0); }
162 void NormalizeRect() {
163 int nTemp;
if (left > right) {
nTemp = left; left = right; right =
nTemp; }
166 bool OffsetRect(
int dx,
int dy) {
return xOffsetRect(
this,
dx,
dy); }
167 bool OffsetRect(POINT
pt) {
return xOffsetRect(
this,
pt.x,
pt.y); }
168 bool OffsetRect(SIZE size) {
return xOffsetRect(
this, size.cx, size.cy); }
169 bool PtInRect(POINT
pt)
const {
return xPtInRect(
this,
pt); }
170 bool SetRect(
int l,
int t,
int r,
int b) {
return xSetRect(
this,
l, t, r, b); }
171 bool SetRect(POINT TopLeft, POINT
BtmRight) {
return xSetRect(
this, TopLeft.x, TopLeft.y,
BtmRight.x,
BtmRight.y); }
172 bool SetRectEmpty() {
return xSetRectEmpty(
this); }
173 bool SubtractRect(RECT
rc1, RECT
rc2) {
return xSubtractRect(
this, &
rc1, &
rc2); }
174 bool UnionRect(RECT
rc1, RECT
rc2) {
return xUnionRect(
this, &
rc1, &
rc2); }
177 void MoveToX(
int x) { right = Width() + x; left = x; }
178 void MoveToY(
int y) {
bottom = Height() + y;
top = y; }
179 void MoveToXY(
int x,
int y) { MoveToX(x); MoveToY(y); }
180 void MoveToXY(POINT
pt) { MoveToX(
pt.x); MoveToY(
pt.y); }
183 int Height()
const {
return bottom -
top; }
184 int Width()
const {
return right - left; }
185 CXSize Size()
const {
return CXSize(Width(), Height()); }
191 operator LPRECT() {
return this; }
192 operator LPCRECT()
const {
return this; }
196 void operator += (SIZE size) { xOffsetRect(
this, size.cx, size.cy); }