-
Notifications
You must be signed in to change notification settings - Fork 1
/
BenchmarkResultItem.h
96 lines (52 loc) · 2.19 KB
/
BenchmarkResultItem.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// BenchmarkResultItem.h: interface for the CBenchmarkResultItem class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_BENCHMARKRESULTITEM_H__B8AC860F_88E1_4EFF_80D7_DA3B604BA40F__INCLUDED_)
#define AFX_BENCHMARKRESULTITEM_H__B8AC860F_88E1_4EFF_80D7_DA3B604BA40F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "FlexGUIItem.h"
class CBenchmarkResultItem : public CFlexGUIItem
{
public:
CBenchmarkResultItem();
void SetCurrentResult(int currResult){
m_currentResult.Format("%d CPUMarks",currResult);
}
void SetBestResult(int bestResult){
m_bestResult.Format("%d",bestResult);
}
void DrawContent(CDC* dc){
CFont fLbl;
CFont fText;
CFont fResult;
CSize size;
fLbl.CreateFont(-11,0,0,0,FW_NORMAL,FALSE,FALSE,0,ANSI_CHARSET,OUT_TT_PRECIS,
CLIP_TT_ALWAYS,ANTIALIASED_QUALITY,DEFAULT_PITCH | FF_SWISS, "TAHOMA");
fText.CreateFont(-11,0,0,0,FW_NORMAL,FALSE,FALSE,0,ANSI_CHARSET,OUT_TT_PRECIS,
CLIP_TT_ALWAYS,ANTIALIASED_QUALITY,DEFAULT_PITCH | FF_SWISS, "TAHOMA");
fResult.CreateFont(-18,0,0,0,FW_BOLD,TRUE,FALSE,0,ANSI_CHARSET,OUT_TT_PRECIS,
CLIP_TT_ALWAYS,ANTIALIASED_QUALITY,DEFAULT_PITCH | FF_SWISS, "TAHOMA");
CGdiObject *pOldObj=dc->SelectObject(&fLbl);
dc->SetTextColor(0);
dc->TextOut(itemRect.left+26,itemRect.top+12,"Current result: ");
dc->SelectObject(&fText);
dc->SetTextColor(0);
dc->TextOut(itemRect.left+100,itemRect.top+12,m_currentResult);
dc->TextOut(itemRect.left+26,itemRect.top+34,"Your best result: ");
dc->SelectObject(&fResult);
GetTextExtentPoint32(*dc,m_bestResult,m_bestResult.GetLength(),&size);
dc->SetTextColor(0);
dc->TextOut(itemRect.left+110,itemRect.top+27,m_bestResult);
if(m_bestResult != "none"){
dc->SelectObject(&fText);
dc->SetTextColor(0);
dc->TextOut(itemRect.left+110+size.cx+5,itemRect.top+34,"CPUMarks ");
}
dc->SelectObject(pOldObj);
}
virtual ~CBenchmarkResultItem();
CString m_currentResult,m_bestResult;
};
#endif // !defined(AFX_BENCHMARKRESULTITEM_H__B8AC860F_88E1_4EFF_80D7_DA3B604BA40F__INCLUDED_)