5 #ifndef _INC_GraphRuler_H
6 #define _INC_GraphRuler_H
11 #include "../CGraphCfg.h"
16 class CGraphRuler :
public CWnd
41 void CalculateFormatStrings();
42 virtual bool IsSynced()
const = 0;
46 void SetNewPrecision(
int newPrecision)
48 m_Precision = newPrecision;
49 CalculateFormatStrings();
50 InvalidateRect(
nullptr );
52 int GetPrecision()
const
53 {
return m_Precision;};
55 void SetNewTitle(
const cString & title)
58 CalculateFormatStrings();
59 InvalidateRect(
nullptr );
65 const cString& GetUnitsOfMeasure()
const
67 void SetUnitsOfMeasure(
const cString& newUOM );
69 void GetFormattedOutput(
double value,
int formatLevel,
cString& str)
const;
72 return GetTitle() +
", " + GetUnitsOfMeasure();
75 int GetLabelsFitMax(
bool fRulerVert,
const TCHAR* pszText );
77 bool IsVerticalFont()
const
79 return( m_Font.m_FontCfg.lfEscapement == 900 );
82 void SetFont(
const CGraphFont * pfont,
bool fVert );
83 int GetTickHeight()
const;
86 virtual void OnLButtonDown(
bool fHoriz, UINT nFlags,
CPoint point );
87 virtual INT_PTR OnToolHitTest(
CPoint point, TOOLINFO* pTI );
96 virtual ~CGraphRuler();
98 virtual void AssertValid()
const;
99 virtual void Dump(CDumpContext& dc)
const;
105 afx_msg
int OnCreate(LPCREATESTRUCT lpCreateStruct);
106 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
108 DECLARE_MESSAGE_MAP()
115 class CGraphIntervals;
117 class CGraphRulerScale :
public CGraphRuler
129 CGraphIntervals* GetRulerFormatUnits(
cString &sFormat,
cString &sUnitName );
132 void SetShowExp(
bool fExpShow )
134 m_bShowExp = fExpShow;
139 int GetLabelsFitMax();
140 void GetToolHitText(
int iVal,
cString& strTextTip )
const;
141 bool IsSynced()
const;
142 void GetRulerFormatUnits(
cString &sFormat,
cString &sUnitName,
int iMaxExp );
151 virtual ~CGraphRulerScale();
156 afx_msg
void OnPaint();
157 afx_msg
void OnContextMenu(
CWnd* pWnd,
CPoint point);
158 afx_msg
void OnLButtonDown(UINT nFlags,
CPoint point);
160 DECLARE_MESSAGE_MAP()
166 class CGraphRulerTime :
public CGraphRuler
178 void PaintTimeTick( CDC* pDC );
179 void UpdateTimeTick( CDC* pDC,
bool fPaint );
180 CGraphIntervals * GetRulerFormatUnits(
CString &sFormat,
CString &sUnitName );
184 int GetLabelsFitMax();
185 void UpdateTimeTick(
bool fPaint );
186 void GetToolHitText(
int iVal,
CString & strTextTip )
const;
187 bool IsSynced()
const;
196 virtual ~CGraphRulerTime();
201 afx_msg
void OnPaint();
202 afx_msg
void OnContextMenu(
CWnd* pWnd,
CPoint point);
203 afx_msg
void OnLButtonDown(UINT nFlags,
CPoint point);
205 DECLARE_MESSAGE_MAP()
UINT32 COLORREF
ABGR (high to low bits)
Definition: cVariantData.h:21
Definition: GrayGraph.cpp:29
double GraphVal_t
this is the value type we are plotting. Must also be able to hold GraphTime_t.
Definition: cGraphCfg.h:66
cRectI CRect
Compatible with MFC 2d CRect.
Definition: cRectI.h:243
cWndHandle CWnd
Definition: cWndHandle.h:669
interface const RECTQ_t & rect
Definition: cQuadtree.h:44
cPoint2i CPoint
Compatible with MFC 2d CPoint,CRect.
Definition: cPoint2.h:65
cString CString
Definition: cString.h:639
cStringT< GChar_t > cString
Definition: cString.h:636