-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathValuesLabel.cpp
More file actions
70 lines (60 loc) · 2.44 KB
/
ValuesLabel.cpp
File metadata and controls
70 lines (60 loc) · 2.44 KB
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
#include "stdafx.h"
#include "ValuesLabel.h"
ValuesLabel::ValuesLabel(): m_cWidth(88), m_cHight(158),
m_DisplayArea(m_cWidth, m_cHight), m_clrNG(192, 0, 0)
{}
void ValuesLabel::BindCircle(const int _r, const CPoint _p)
{
//Msred
CPoint pointShow(-10 - _r, -20 - _r);
m_pointShow = _p + pointShow;
//Msring
//原則上是右手操作,顯示在左邊,無法的時候就顯示在右邊
CPoint pointMsring(0, -20 - _r);
pointMsring.x = ( _p.x < (LONG)(_p.x + 125 + m_cWidth) ) ? 40-_r : -125-_r;
m_pointMsring = _p + pointMsring;
}
void ValuesLabel::SetData(const Bullet& _B)
{
m_bltData = _B;
}
void ValuesLabel::Draw(CPaintDC& dc)
{
//需要點定位,需要顏色,需要資料
//正在量的數據
// pCD->DrawText(m_pCA210->OutData(), rect2, DT_LEFT | DT_VCENTER);
for(int lineIndex = 0; lineIndex < 10; ++lineIndex)
printx(dc, lineIndex);
}
void ValuesLabel::printx(CPaintDC& dc, int lineIndex)
{
CPoint pointOrig(m_pointMsring);
const int wordHight(16);
CString str;
switch (lineIndex)
{
case 0: str.Format("Lv: %s", m_bltData.oStr((ValueKind)lineIndex)); break;
case 1: str.Format(" x: %s", m_bltData.oStr((ValueKind)lineIndex)); break;
case 2: str.Format(" y: %s", m_bltData.oStr((ValueKind)lineIndex)); break;
case 3: str.Format(" T: %s", m_bltData.oStr((ValueKind)lineIndex)); break;
case 4: str.Format("uv: %s", m_bltData.oStr((ValueKind)lineIndex)); break;
case 5: str.Format("u': %s", m_bltData.oStr((ValueKind)lineIndex)); break;
case 6: str.Format("v': %s", m_bltData.oStr((ValueKind)lineIndex)); break;
case 7: str.Format(" X: %s", m_bltData.oStr((ValueKind)lineIndex)); break;
case 8: str.Format(" Y: %s", m_bltData.oStr((ValueKind)lineIndex)); break;
case 9: str.Format(" Z: %s", m_bltData.oStr((ValueKind)lineIndex)); break;
}
// if (m_bltData.oFlt( (ValueKind)lineIndex ) > m_specMax.oFlt( (ValueKind)lineIndex ) ||
// m_bltData.oFlt( (ValueKind)lineIndex ) < m_specMin.oFlt( (ValueKind)lineIndex ))
// {
// ColorRef tempClr;
// tempClr = dc.GetTextColor();
//
// dc.SetTextColor(m_clrNG.oRGB());
// TextOut(dc, pointOrig.x, pointOrig.y + wordHight*lineIndex, str, str.GetLength());
//
// dc.SetTextColor(tempClr.oRGB());
// }
// else
TextOut(dc, pointOrig.x, pointOrig.y + wordHight*lineIndex, str, str.GetLength());
}