📄 winrect.h
字号:
#ifndef __WINRECT_H
#define __WINRECT_H
class CWinRect
{
int m_x,m_y,m_x1,m_y1;
public:
CWinRect() : m_x(0),m_y(0),m_x1(200),m_y1(350) {};
CWinRect(int x,int y,int x1,int y1) : m_x(x),m_y(y),m_x1(x1),m_y1(y1) {};
CWinRect(const CWinRect &c) : m_x(c.m_x),m_y(c.m_y),m_x1(c.m_x1),m_y1(c.m_y1) {};
virtual ~CWinRect() {}
void operator =(const CWinRect &c) { m_x=c.m_x;m_y=c.m_y;m_x1=c.m_x1;m_y1=c.m_y1; };
bool IsEqual(const CWinRect &c) const;
bool operator ==(const CWinRect &c) const { return IsEqual(c); }
bool IsPtInside(int x,int y) const;
int X() const {return m_x; }
int Y() const {return m_y; }
int X1() const {return m_x1; }
int Y1() const {return m_y1; }
int Ht() const { return m_y1-m_y; }
int Wd() const { return m_x1-m_x; }
void SetWd(int i) { m_x1=m_x+i; }
void Move(int x,int y) { m_x+=x; m_y+=y; m_x1+=x; m_y1+=y; }
};
inline bool CWinRect::IsEqual(const CWinRect &c) const {
if( (m_x==c.m_x) && (m_y==c.m_y) && (m_x1==c.m_x1) && (m_y1==c.m_y1) )
return true;
else
return false;
}
inline bool CWinRect::IsPtInside(int x,int y) const {
if( (x>=m_x) && (x<=m_x1) && (y>=m_y) && (y<=m_y1) )
return true;
else
return false;
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -