-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDisplay.cpp
76 lines (62 loc) · 1.13 KB
/
Display.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "StdAfx.h"
#include "Display.h"
#include "MainFrm.h"
#include "SketcherView.h"
#include "SketcherDoc.h"
Display* Display::m_pInstance=NULL;
bool Display::m_bSingletonFlag=false;
Display::Display(void)
: m_pView(NULL)
, m_pDoc(NULL)
, m_pMainFrm(NULL)
{
m_outfile.open("debug.txt");
}
Display::~Display(void)
{
m_outfile.close();
}
Display& Display::Instance()
{
if(m_bSingletonFlag==false)
{
m_pInstance=new Display();
m_bSingletonFlag=true;
}
return *m_pInstance;
}
std::ofstream& Display::operator << (const char* pMessage)
{
m_outfile << pMessage;
return m_outfile;
}
void Display::SetMainFrame(CMainFrame* pMainFrm)
{
m_pMainFrm=pMainFrm;
}
void Display::SetStatusText(LPCTSTR pMessage)
{
ASSERT(m_pMainFrm);
m_pMainFrm->SetStatusText(pMessage);
}
void Display::SetView(CSketcherView* pView)
{
m_pView=pView;
}
void Display::SetDoc(CSketcherDoc* pDoc)
{
m_pDoc=pDoc;
}
void Display::InvalidateView(BOOL bErased)
{
m_pView->Invalidate(bErased);
m_pView->UpdateWindow();
}
void Display::SetViewText(LPCTSTR pText)
{
m_pView->SetViewText(pText);
}
void Display::ClearViewText(void)
{
m_pView->ClearViewText();
}