SRGraphRect Class

class SRGraphRect: public CObject

Device independent rectangle class

Defined in: SRGraphRect.h

Class Members

public data members

double left

Device independent coordinate for the left of the rectangle

double top

Device independent coordinate for the top of the rectangle

double right

Device independent coordinate for the right of the rectangle

double bottom

Device independent coordinate for the bottom of the rectangle

protected data members

SRGraph * m_pGraph

Pointer to the parent graph

int m_nType

Type of measurement used: 0=pixels, 1=millimeters, 2=inches, 3=percentage

CRect m_LogRect

CRect object for internal conversions and calculations

public member functions

CHART_API virtual void SetGraph(SRGraph *pGraph)

Initializes the pointer to the owner graph

CHART_API virtual int GetMeasurement()

Returns m_nType data member

CHART_API virtual void SetMeasurement(int m)

Initializes m_nType data member

CHART_API virtual void SetRect(const CRect& r)

Initializes the rectangle from a CRect

CHART_API virtual void SetRect(double l,double t,double r, double b)

Initializes the rectangle with device independent coordinates

inline SRGraphRect()

Construction

inline SRGraphRect(double l,double t,double r,double b)

Construction

CHART_API SRGraphRect(CRect& r)

Construction

CHART_API SRGraphRect(SRGraphRect& r)

Copy Constructor

CHART_API virtual CRect CalcCRect(CDC *pDC,CWnd *pCWnd=NULL)

Calculates logical rectangle from device independent coordinates

CHART_API virtual CRect GetLogRect()

Returns the logical rectangle determined by CalcCRect during draw process

CHART_API virtual void Serialize(CArchive& ar)

Stores or retrieves information via a CArchive

CHART_API void operator=(const SRGraphRect& r)

Assignment of data from an existing SRGraphRect object

CHART_API void operator=(const CRect& r)

Assignment of data from a CRect object

BOOL operator==(const SRGraphRect& r)

Test for equality of one SRGRect to another.

inline double Width()

Returns the width of the rectangle

inline double Height()

Returns the height of the rectangle

inline void Move(double x, double y)

Displaces the rectangle

CHART_API void Grow(double x, double y)

Expands the rectangle

CHART_API void CRectToSRGRect(CRect& rect,CDC *pDC)

Calculates device independent measurements

CHART_API virtual void CRectToSRGRect(CRect& rect,CDC *pDC,CWnd *pCWnd)

Calculates device independent measurements (special overload for percentage measuring system)