-
Notifications
You must be signed in to change notification settings - Fork 2
/
StaticText.cpp
62 lines (48 loc) · 1.66 KB
/
StaticText.cpp
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
// StaticText.cpp : implementation file
//
#include "stdafx.h"
// #include "MsrItems.h"
#include "StaticText.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CStaticText
CStaticText::CStaticText(){}
CStaticText::~CStaticText(){}
BEGIN_MESSAGE_MAP(CStaticText, CStatic)
//{{AFX_MSG_MAP(CStaticText)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CStaticText message handlers
const CStaticText& CStaticText::SetFontFace(const LPCTSTR& FontFace)
{
CFont *pFont = new CFont;
pFont->CreateFont(16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, FF_MODERN, FontFace);
//SetFont(&aFont);
CStatic::SetFont(pFont);
pFont->DeleteObject();
return *this;
}
const CStaticText& CStaticText::SetFont(const CFont* pFont)
{ SetFont(pFont); return *this; }
const CFont* CStaticText::GetFont() const
{ return CWnd::GetFont(); }
const CStaticText& CStaticText::SetTextColor(const CWnd* pWnd, CDC* pDC, const COLORREF& clr)
{
if (pWnd->GetDlgCtrlID() == GetDlgCtrlID())
pDC->SetTextColor(clr);
return *this;
}
const CStaticText& CStaticText::SetBkColor(const CWnd* pWnd, CDC* pDC, const COLORREF& clr)
{
if (pWnd->GetDlgCtrlID() == GetDlgCtrlID())
pDC->SetBkColor(clr);
return *this;
}
const COLORREF CStaticText::GetTextColor(const CDC* pDC) const { return pDC->GetTextColor(); }
const COLORREF CStaticText::GetBkColor (const CDC* pDC) const { return pDC->GetBkColor(); }