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

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

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

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

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

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

Draws this component

CHART_API virtual void Serialize(CArchive &ar)

Serializes this component

CHART_API 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

CHART_API virtual void SetMinorTickRatio(int n)

Initializes the ratio of minor ticks to major ticks

CHART_API virtual int GetMinorTickRatio()

Returns the ratio of minor ticks to major ticks

CHART_API SRGTickMarks()

Constructor

CHART_API virtual ~SRGTickMarks()

Destructor

CHART_API virtual void SetMinorTickColor(COLORREF c)

Sets the color of the minor ticks

CHART_API virtual COLORREF GetMinorTickColor()

Gets the color of the minor ticks

CHART_API virtual void SetMajorTickColor(COLORREF c)

Sets the color of the major ticks

CHART_API virtual COLORREF GetMajorTickColor()

Gets the color of the major ticks

CHART_API virtual void SetMajorTickWidth(int n)

Sets the width in pixels of the major ticks

CHART_API virtual void SetMinorTickWidth(int n)

Sets the width in pixels of the minor ticks

CHART_API virtual int GetMinorTickWidth()

Gets the width in pixels of the major ticks

CHART_API virtual int GetMajorTickWidth()

Gets the width in pixels of the major tick

CHART_API virtual void SetptrTickPositionList(CPtrList *pList)

Sets the tick position pointer

CHART_API virtual CPtrList * GetptrTickPositionList()

Returns the tick position list address

CHART_API virtual void SetTickSide(BOOL bSide)

Sets the side upon which ticks are displayed

CHART_API virtual BOOL GetTickSide()

Returns the side upon which ticks are displayed

CHART_API virtual void SetMajorTickSize(int nTickSize)

Sets the size (length) of the major ticks

CHART_API virtual int GetMajorTickSize()

Returns the size (length) of the major ticks

CHART_API virtual void SetMinorTickSize(double d)

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

CHART_API virtual double GetMinorTickSize()

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

CHART_API virtual void SetDisplayRect(CRect rect)

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

CHART_API virtual CRect GetDisplayRect()

Returns the display rect

CHART_API virtual void DrawShadow()

Overridden to do nothing

CHART_API virtual void DrawBorder()

Overridden to do nothing

CHART_API 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

CHART_API virtual void DrawForeground()

Draws the ticks

int m_nMinorTickRatio

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