-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rect.h
70 lines (58 loc) · 1.44 KB
/
Rect.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#include "Point.h"
#include "Size.h"
namespace Wex
{
class Rect : public RECT
{
public:
Rect();
Rect(
int left,
int top,
int right,
int bottom);
Rect(const RECT& rect);
Rect(const POINT& topLeft, const SIZE& size);
Rect(const POINT& topLeft, const POINT& bottomRight);
Rect(const Rect& rhs) = default;
~Rect() = default;
Rect& operator=(const Rect& rhs) = default;
static const Rect UseDefault;
static const Rect Empty;
void Set(
int left,
int top,
int right,
int bottom);
void SetEmpty();
void Copy(const RECT& value);
int GetWidth() const;
int GetHeight() const;
void SetWidth(int value);
void SetHeight(int value);
Point GetTopLeft() const;
Point GetBottomRight() const;
Point GetCenter() const;
Size GetSize() const;
Rect& Offset(const SIZE& size);
Rect& MoveTo(const POINT& point);
Rect& Inflate(const SIZE& size);
Rect& Adjust(
unsigned long windowStyle,
unsigned long windowExStyle = 0,
bool hasMenu = false);
bool Contains(const POINT& point) const;
bool IsEmpty() const;
Rect operator&(const RECT& value) const;
Rect& operator&=(const RECT& value);
Rect operator|(const RECT& value) const;
Rect& operator|=(const RECT& value);
Rect operator-(const RECT& value) const;
Rect& operator-=(const RECT& value);
bool operator==(const RECT& value) const;
bool operator!=(const RECT& value) const;
private:
friend class RectTest;
};
}