-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPractice6View.cpp
More file actions
155 lines (117 loc) · 3.69 KB
/
Copy pathPractice6View.cpp
File metadata and controls
155 lines (117 loc) · 3.69 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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// Practice6View.cpp: CPractice6View 클래스의 구현
//
#include "pch.h"
#include "framework.h"
// SHARED_HANDLERS는 미리 보기, 축소판 그림 및 검색 필터 처리기를 구현하는 ATL 프로젝트에서 정의할 수 있으며
// 해당 프로젝트와 문서 코드를 공유하도록 해 줍니다.
#ifndef SHARED_HANDLERS
#include "Practice6.h"
#endif
#include "Practice6Doc.h"
#include "Practice6View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CPractice6View
IMPLEMENT_DYNCREATE(CPractice6View, CView)
BEGIN_MESSAGE_MAP(CPractice6View, CView)
// 표준 인쇄 명령입니다.
ON_COMMAND(ID_FILE_PRINT, &CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, &CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, &CPractice6View::OnFilePrintPreview)
ON_WM_CONTEXTMENU()
ON_WM_RBUTTONUP()
END_MESSAGE_MAP()
// CPractice6View 생성/소멸
CPractice6View::CPractice6View() noexcept
{
// TODO: 여기에 생성 코드를 추가합니다.
}
CPractice6View::~CPractice6View()
{
}
BOOL CPractice6View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: CREATESTRUCT cs를 수정하여 여기에서
// Window 클래스 또는 스타일을 수정합니다.
return CView::PreCreateWindow(cs);
}
// CPractice6View 그리기
void CPractice6View::OnDraw(CDC* pDC)
{
CPractice6Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
// TODO: 여기에 원시 데이터에 대한 그리기 코드를 추가합니다.
// 20221871_인석진
// 1. 출력 시작 위치 설정 (20, 20)
int nY = 20;
int nX = 20;
// 2. CString 변수들을 사용하여 출력할 문자열을 준비합니다.
CString strOutput;
// A. [검색 대상] 출력 (예: "검색 대상: 파일")
strOutput.Format(_T("검색 대상: %s"), m_strTarget);
pDC->TextOut(20, nY, strOutput);
nY += 30; // 다음 항목을 위해 y 좌표 30 증가
// B. [검색 위치] 출력 (예: "검색 위치: 하드 드라이브 D:")
strOutput.Format(_T("검색 위치: %s"), m_strDrive);
pDC->TextOut(20, nY, strOutput);
nY += 30;
// C. [전체 또는 일부 이름] 출력 (예: "검색할 이름: Practice")
strOutput.Format(_T("검색할 이름: %s"), m_strName);
pDC->TextOut(20, nY, strOutput);
nY += 30;
// D. [검색 파일 종류] 출력 (예: "검색 파일 종류: MFC 프로젝트 파일, 문서 파일")
strOutput.Format(_T("검색 파일 종류: %s"), m_strFileType);
pDC->TextOut(20, nY, strOutput);
}
// CPractice6View 인쇄
void CPractice6View::OnFilePrintPreview()
{
#ifndef SHARED_HANDLERS
AFXPrintPreview(this);
#endif
}
BOOL CPractice6View::OnPreparePrinting(CPrintInfo* pInfo)
{
// 기본적인 준비
return DoPreparePrinting(pInfo);
}
void CPractice6View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: 인쇄하기 전에 추가 초기화 작업을 추가합니다.
}
void CPractice6View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: 인쇄 후 정리 작업을 추가합니다.
}
void CPractice6View::OnRButtonUp(UINT /* nFlags */, CPoint point)
{
ClientToScreen(&point);
OnContextMenu(this, point);
}
void CPractice6View::OnContextMenu(CWnd* /* pWnd */, CPoint point)
{
#ifndef SHARED_HANDLERS
theApp.GetContextMenuManager()->ShowPopupMenu(IDR_POPUP_EDIT, point.x, point.y, this, TRUE);
#endif
}
// CPractice6View 진단
#ifdef _DEBUG
void CPractice6View::AssertValid() const
{
CView::AssertValid();
}
void CPractice6View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CPractice6Doc* CPractice6View::GetDocument() const // 디버그되지 않은 버전은 인라인으로 지정됩니다.
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPractice6Doc)));
return (CPractice6Doc*)m_pDocument;
}
#endif //_DEBUG
// CPractice6View 메시지 처리기