Design Pattern Examples
Overview of object-oriented design patterns
WindowRectangle Class Reference

Represents a rectangular region, with upper left and lower right coordinates. More...

#include <HandlerChain_MessageWindow_Class.h>

Collaboration diagram for WindowRectangle:
Collaboration graph

Public Member Functions

 WindowRectangle (int x, int y, int width, int height)
 Constructor.
 
bool PointInside (MessagePosition point)
 Determine if the given point is in the rectangle.
 
std::string ToString ()
 Convert this rectangle to a string.
 

Public Attributes

int Left
 
int Top
 
int Right
 
int Bottom
 

Private Attributes

const int MINIMUM_WIDTH = 4
 Minimum width of a window (to accommodate a close box).
 
const int MINIMUM_HEIGHT = 4
 Minimum height of a window (to accommodate a close box).
 

Detailed Description

Represents a rectangular region, with upper left and lower right coordinates.

For this example, the minimum width of a rectangle is 4 x 4.

Definition at line 30 of file HandlerChain_MessageWindow_Class.h.

Constructor & Destructor Documentation

◆ WindowRectangle()

WindowRectangle ( int  x,
int  y,
int  width,
int  height 
)
inline

Constructor.

Parameters
xX coordinate of upper left corner.
yY coordinate of upper left corner.
widthWidth of rectangle.
heightHeight of rectangle.

Definition at line 55 of file HandlerChain_MessageWindow_Class.h.

References WindowRectangle::Bottom, WindowRectangle::Left, WindowRectangle::MINIMUM_HEIGHT, WindowRectangle::MINIMUM_WIDTH, WindowRectangle::Right, and WindowRectangle::Top.

Member Function Documentation

◆ PointInside()

bool PointInside ( MessagePosition  point)
inline

Determine if the given point is in the rectangle.

Parameters
pointPoint to examine.
Returns
Return true if the point is in the rectangle.

Definition at line 76 of file HandlerChain_MessageWindow_Class.h.

References WindowRectangle::Bottom, WindowRectangle::Left, WindowRectangle::Right, WindowRectangle::Top, MessagePosition::X, and MessagePosition::Y.

Referenced by MessageWindow::_PointInCloseBox(), and MessageWindow::_PointInWindow().

◆ ToString()

std::string ToString ( )
inline

Convert this rectangle to a string.

Returns
Returns a representation of this rectangle.

Definition at line 93 of file HandlerChain_MessageWindow_Class.h.

References WindowRectangle::Bottom, Helpers::formatstring(), WindowRectangle::Left, WindowRectangle::Right, and WindowRectangle::Top.

Referenced by MessageWindow::ToString().

Member Data Documentation

◆ Bottom

◆ Left

◆ MINIMUM_HEIGHT

const int MINIMUM_HEIGHT = 4
private

Minimum height of a window (to accommodate a close box).

Definition at line 40 of file HandlerChain_MessageWindow_Class.h.

Referenced by WindowRectangle::WindowRectangle().

◆ MINIMUM_WIDTH

const int MINIMUM_WIDTH = 4
private

Minimum width of a window (to accommodate a close box).

Definition at line 36 of file HandlerChain_MessageWindow_Class.h.

Referenced by WindowRectangle::WindowRectangle().

◆ Right

◆ Top


The documentation for this class was generated from the following file: