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

virtual void  SetGraph(SRGraph *pGraph)

Initializes the pointer to the owner graph

virtual int  GetMeasurement()

Returns m_nType data member

virtual void  SetMeasurement(int m)

Initializes m_nType data member

virtual void  SetRect(const CRect& r)

Initializes the rectangle from a CRect

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

 SRGraphRect(CRect& r)

Construction

 SRGraphRect(SRGraphRect& r)

Copy Constructor

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

Calculates logical rectangle from device independent coordinates

virtual CRect  GetLogRect()

Returns the logical rectangle determined by CalcCRect during draw process

virtual void  Serialize(CArchive& ar)

Stores or retrieves information via a CArchive

void operator=(const SRGraphRect& r)

Assignment of data from an existing SRGraphRect object

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

void  Grow(double x, double y)

Expands the rectangle

void  CRectToSRGRect(CRect& rect,CDC *pDC)

Calculates device independent measurements

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

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