forked from hiyohiyo/CrystalDiskInfo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButtonEx.cpp
More file actions
43 lines (36 loc) · 959 Bytes
/
Copy pathButtonEx.cpp
File metadata and controls
43 lines (36 loc) · 959 Bytes
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
/*---------------------------------------------------------------------------*/
// Author : hiyohiyo
// Mail : hiyohiyo@crystalmark.info
// Web : http://crystalmark.info/
// License : Simplified BSD license
/*---------------------------------------------------------------------------*/
#include "stdafx.h"
#include "ButtonEx.h"
IMPLEMENT_DYNAMIC(CButtonEx, CButton)
CButtonEx::CButtonEx()
{
}
CButtonEx::~CButtonEx()
{
m_Font.DeleteObject();
}
BEGIN_MESSAGE_MAP(CButtonEx, CButton)
END_MESSAGE_MAP()
void CButtonEx::SetFontEx(CString face, double zoomRatio)
{
LOGFONT logFont = {0};
logFont.lfCharSet = DEFAULT_CHARSET;
logFont.lfHeight = (LONG)(-12 * zoomRatio);
logFont.lfQuality = 6;
if(face.GetLength() < 32)
{
wsprintf(logFont.lfFaceName, _T("%s"), face.GetString());
}
else
{
wsprintf(logFont.lfFaceName, _T(""));
}
m_Font.DeleteObject();
m_Font.CreateFontIndirect(&logFont);
SetFont(&m_Font);
}