SRGTickMarks Class

class SRGTickMarks: public SRGraphComponent

This class manages the major and minor tick marks that may optionally be displayed on the axis of a chart. The positions of the major ticks are defined by a list of CPoint coordinates. Normally this list of CPoint objects is generated by an SRGraphLabelBlock-based class and then passed by pointer to the SRGTickMarks object.
Minor tick marks are interspersed between major tick marks at a preset ratio (N:1).
Major and minor color, length, and thickness styles are individually adjustable.

Defined in: SRGTickMarks.h

Class Members

virtual void  GetStandoff(CPoint *ptStart, CPoint *ptEnd)

Modifies a start and end position so that the label block won't overwrite the tick marks

virtual CPoint  OffsetPoint(CPoint ptPos, int nSize,double dAngle)

Offsets a single CPoint by the angle and size of the major tick

virtual void  Draw(CDC *pDC,CWnd *pCWnd)

Draws this component

virtual void  Serialize(CArchive &ampar)

Serializes this component

virtual void  DrawTick(CPoint ptPos, int nSize, double dAngle,int nStrength=1,COLORREF Color=CXCLR_BLACK)

Draws a single tick mark with a given style and position

virtual void  SetMinorTickRatio(int n)

Initializes the ratio of minor ticks to major ticks

virtual int  GetMinorTickRatio()

Returns the ratio of minor ticks to major ticks

 SRGTickMarks()

Constructor

virtual  ~SRGTickMarks()

Destructor

virtual void  SetMinorTickColor(COLORREF c)

Sets the color of the minor ticks

virtual COLORREF  GetMinorTickColor()

Gets the color of the minor ticks

virtual void  SetMajorTickColor(COLORREF c)

Sets the color of the major ticks

virtual COLORREF  GetMajorTickColor()

Gets the color of the major ticks

virtual void  SetMajorTickWidth(int n)

Sets the width in pixels of the major ticks

virtual void  SetMinorTickWidth(int n)

Sets the width in pixels of the minor ticks

virtual int  GetMinorTickWidth()

Gets the width in pixels of the major ticks

virtual int  GetMajorTickWidth()

Gets the width in pixels of the major tick

virtual void  SetptrTickPositionList(CPtrList *pList)

Sets the tick position pointer

virtual CPtrList *  GetptrTickPositionList()

Returns the tick position list address

virtual void  SetTickSide(BOOL bSide)

Sets the side upon which ticks are displayed

virtual BOOL  GetTickSide()

Returns the side upon which ticks are displayed

virtual void  SetMajorTickSize(int nTickSize)

Sets the size (length) of the major ticks

virtual int  GetMajorTickSize()

Returns the size (length) of the major ticks

virtual void  SetMinorTickSize(double d)

Sets the size of the minor tick as a ratio of the length of the major tick

virtual double  GetMinorTickSize()

Returns the size of the minor tick expressed as a ratio to the length of the major tick

virtual void  SetDisplayRect(CRect rect)

Sets the display rect, which has the starting and the end points of the X and the Y axes.

virtual CRect  GetDisplayRect()

Returns the display rect

virtual void  DrawShadow()

Overridden to do nothing

virtual void  DrawBorder()

Overridden to do nothing

virtual void  DrawFill()

Overridden to do nothing

int  m_nMinorTickWidth

Width in pixels of the minor ticks

int  m_nMajorTickWidth

Width in pixels of the major ticks

COLORREF  m_MinorTickColor

RGB color of the minor ticks

COLORREF  m_MajorTickColor

RGB color of the major ticks

BOOL  m_bTickSide

Side (left=0 right=1) upon which the ticks are drawn

int  m_nTickSize

Size (length) of the major ticks

double  m_dMinorTickSize

Ratio of the size of the minor ticks to the major ticks

CPtrList *  m_pTickPositionList

Pointer to the CPtrList object that controls the tick list

CRect m_DisplayRect

The final display rect

virtual void  DrawForeground()

Draws the ticks

int  m_nMinorTickRatio

Number of minor ticks for each major tick (0 or positive integers only)