My Project
rectangle.cpp
Go to the documentation of this file.
1 #include "stdafx.h"
2 #include "../stdafx.h"
3 #include "rectangle.h"
4 
6 {}
7 
8 URectangle::URectangle(int X1, int Y1, int X2, int Y2, COLORREF color) : URectangle()
9 {
10  this->X1 = X1;
11  this->Y1 = Y1;
12  this->X2 = X2;
13  this->Y2 = Y2;
14  this->COLOR = color;
15  this->display(X1, Y1, X2, Y2, nullptr);
16 }
17 
18 bool URectangle::display(int X1, int Y1, int X2, int Y2, WCHAR* TEXT)
19 {
20  this->X1 = X1;
21  this->Y1 = Y1;
22  this->X2 = X2;
23  this->Y2 = Y2;
24 
25  SelectObject(this->hdc, CreatePen(PS_SOLID, this->bWidth, this->bCOLOR));
26  SelectObject(this->hdc, CreateSolidBrush(this->COLOR));
27 
28  return Rectangle(this->hdc, this->X1, this->Y1, this->X2, this->Y2);
29 }
30 
32 {
33  return this->display(this->X1, this->Y1, this->X2, this->Y2, nullptr);
34 }
35 
37 {
38  this->COLOR = color;
39  return this;
40 }
41 
43 {
44  this->bCOLOR = color;
45  return this;
46 }
47 
49 {
50  this->bWidth = w;
51  return this;
52 }
URectangle * SetColor(COLORREF color)
Definition: rectangle.cpp:36
Rectangle interface class Provide interface for creating/removing custom rectangle.
Definition: rectangle.h:24
Rectangle interface class.
bool redraw() override
Definition: rectangle.cpp:31
URectangle * SetBorderWidth(int w)
Definition: rectangle.cpp:48
URectangle * SetBorderColor(COLORREF color)
Definition: rectangle.cpp:42
bool display(int X1, int Y1, int X2, int Y2, WCHAR *TEXT) override
Definition: rectangle.cpp:18