-
Notifications
You must be signed in to change notification settings - Fork 5
/
DataTag.h
82 lines (65 loc) · 2.51 KB
/
DataTag.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// DataTag.h: interface for the CDataTag class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DATATAG_H__ACCD7D0B_B2FB_4379_8D28_B1C7C0CFEE3C__INCLUDED_)
#define AFX_DATATAG_H__ACCD7D0B_B2FB_4379_8D28_B1C7C0CFEE3C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "DrawObj.h"
class CDataTag;
typedef CArray< CDataTag, CDataTag> CTagArray; // array of DataTags
class CDataTag : public CDrawObj
{
DECLARE_SERIAL(CDataTag)
// --------------- private variables
private:
int m_iDataset; // which dataset to apply the tag to
float m_fXValue; // frequency or time coordinate
CString m_strText; // text to put there
CSubChart *m_pParent; // the chart parent
// -------- drawing stuff
bool m_bDrawLine; // draw the line?
int m_iLineWeight; // weight
int m_iLineStyle; // style
bool m_bDrawBox; // draw the box outline?
bool m_bFillBox; // fill the box
COLORREF m_rgbBoxColor; // the fill color for the box
CFxFont m_cfFont; // the font to use
CPoint m_cpTextOffset; // where to put the text box
//
// --------------- Virtual Methods
public:
virtual void DoDraw( CDC *pDC, LPCRECT lpRcDraw = (LPRECT )NULL); // draw the dataline object
virtual NAMETYPES GetType(void) const { return ntDataTag; }
virtual BOOL HitTest( CPoint cPt, UINT *pnFlags);
virtual int EditProperties(CWnd *pWnd); // bring up properties dbox
// --------------- Attribute set/get
public:
CSubChart *GetParent( void) const { return m_pParent; }
void SetParent( CSubChart *pParent); // set the parent
int GetDataset( void) const { return m_iDataset; }
void SetDataset( int iNew);
void GetText( CString &strText) const { strText = m_strText; }
void SetText( LPCTSTR strText);
float GetValue( void) const { return m_fXValue; }
void SetValue( float fNew);
void SetTextOffset( const CPoint &cPoint); // set the text offset
void GetTextOffset( CPoint &cPoint) { cPoint = m_cpTextOffset; }
CDataSet *GetDataPointer( void);
private:
void ParseString( CString &strOut, LPCTSTR strIn); // parse the input string
// --------------- construction
public:
CDataTag();
CDataTag( CDataTag &cTag);
virtual ~CDataTag();
virtual void Serialize(CArchive& ar); // overridden for Named i/o
CDataTag &operator=(const CDataTag &cIn);
// --------------- debug
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
};
#endif // !defined(AFX_DATATAG_H__ACCD7D0B_B2FB_4379_8D28_B1C7C0CFEE3C__INCLUDED_)