SRGDecimalScale Class

class SRGDecimalScale

Derived from SRGraphLabelBlock, this class manages a decimal numeric scale placed between two screen point positions. The scale will automatically calculate the best possible sequence of numbers depending upon the length of the line and the size of the font.
This class will, by default, draw all the labels perpendicular to the imaginary line joining the two end points. After the labels are created, they may be manipulated using the standard SRGraphLabelBlock methods.

Defined in: DScale.h

Class Members

Protected data members

CHART_API virtual CPoint GetRelOffset()

Get the relative offset of the labels from the DC origin

CHART_API virtual CPoint GetOffset()

Get the offset of the labels from the tick list

BOOL m_bAscending

TRUE when the list of numerals generated is to go from low values toward high values

CPoint m_ptStart

Start position of the line of numerals

CPoint m_ptEnd

End position of the line of numerals

double m_dMinValue

Minimum value in the range of generated numbers

double m_dMaxValue

Maximum value in the range of generated numbers

double m_dResolution

Preferred or initial resolution of steps in the number list

CString m_strFormatString

Format string used to generate the numeral strings (see sprintf)

BOOL m_bLabelSide

Side of the imaginary line between m_ptStart and m_ptEnd on which labels are displayed -- FALSE=left/below, TRUE=right/above

public member functions

CHART_API virtual void Serialize(CArchive &ar)

Writes or restores the scale to an archive for reuse

CHART_API SRGDecimalScale()

Constructor

CHART_API SRGDecimalScale(CPoint ptStart, CPoint ptEnd, double dMinValue, double dMaxValue, double dResolution,CString & strFormatString)

Constructor with initialization parameters

CHART_API virtual ~SRGDecimalScale()

Destructor

CHART_API virtual void SetStartPos(CPoint ptStart)

Specifies the start position of the scale line

CHART_API virtual void SetEndPos(CPoint ptEnd)

Specifies the end position of the scale line

CHART_API virtual void SetResolution(double dRes)

Specifies the label step resolution (defaults to 0.1)

CHART_API virtual void SetMaxValue(double dMaxValue)

Sets the maximum value for this scale

CHART_API virtual void SetMinValue(double dMinValue)

Sets the minimum value for this scale

CHART_API virtual void SetFormatString(LPCTSTR strFormatString)

Initializes a printf-style format string for the labels

CHART_API virtual void SetLabelSide(BOOL bRight)

Sets the m_bLabelSide semaphore

CHART_API virtual void SetAscending()

Specifies ascending label order

CHART_API virtual void SetDescending()

Specifies descending label order

CHART_API virtual CPoint GetStartPos()

Interrogates the m_ptStart member

CHART_API virtual CPoint GetEndPos()

Interrogates the m_ptEnd member

CHART_API virtual double GetResolution()

Interrogates the m_dResolution member

CHART_API virtual double GetMaxValue()

Interrogates the m_dMaxValue member

CHART_API virtual double GetMinValue()

Interrogates the m_dMinValue member

CHART_API virtual CString & GetFormatString()

Interrogates the m_strFormatString member

CHART_API virtual BOOL GetLabelSide()

Interrogates the m_bLabelSide member

CHART_API virtual void CreateLabels()

Creates the label list from available information

CHART_API virtual void SetRTAngles()

Sets all labels perpendicular to the line between the start and end points