// FileLogView.cpp : ±¸Çö ÆÄÀÏÀÔ´Ï´Ù. // #include "stdafx.h" #include "ServiceManagerEx.h" #include "FileLogView.h" #include "LogList.h" // CFileLogView IMPLEMENT_DYNCREATE(CFileLogView, CScrollView) CFileLogView::CFileLogView() : m_pList(NULL) { } CFileLogView::~CFileLogView() { delete m_pList; } BEGIN_MESSAGE_MAP(CFileLogView, CScrollView) ON_WM_SIZE() END_MESSAGE_MAP() // CFileLogView ±×¸®±âÀÔ´Ï´Ù. void CFileLogView::OnInitialUpdate() { CScrollView::OnInitialUpdate(); CSize sizeTotal; // TODO: ÀÌ ºäÀÇ Àüü Å©±â¸¦ °è»êÇÕ´Ï´Ù. sizeTotal.cx = sizeTotal.cy = 100; SetScrollSizes(MM_TEXT, sizeTotal); RECT rect; GetClientRect(&rect); m_pList = new CLogList(MENU_FILE_LOG); m_pList->Create(WS_CHILD | WS_VISIBLE | WS_BORDER | LVS_REPORT, CRect(0, 0, rect.right, rect.bottom), this, IDC_LIST_FILELOG); m_pList->SetExtendedStyle(LVS_EX_FULLROWSELECT); const ViewConfig* pViewConfig = ((CServiceManagerExApp*)::AfxGetApp())->GetConfigEx().GetViewConfig(L"Log"); if (pViewConfig) m_pList->SetBkColor(pViewConfig->GetBgColor()); else m_pList->SetBkColor(RGB(0, 0, 0)); #if defined (USE_FONT_BOLD) CFont* pFont = m_pList->GetFont(); LOGFONT lf; pFont->GetLogFont(&lf); lf.lfWeight = FW_BOLD; m_pList->SetFont(pFont); #endif //#if defined (USE_FONT_BOLD) m_pList->InsertColumn(0, L"Date", LVCFMT_LEFT, 200); m_pList->InsertColumn(1, L"Type", LVCFMT_LEFT, 150); m_pList->InsertColumn(2, L"Log", LVCFMT_LEFT, rect.right - 200 - 150 - 20); } void CFileLogView::OnDraw(CDC* pDC) { CDocument* pDoc = GetDocument(); // TODO: ¿©±â¿¡ ±×¸®±â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. UNUSED_ALWAYS(pDoc); } // CFileLogView Áø´ÜÀÔ´Ï´Ù. #ifdef _DEBUG void CFileLogView::AssertValid() const { CScrollView::AssertValid(); } #ifndef _WIN32_WCE void CFileLogView::Dump(CDumpContext& dc) const { CScrollView::Dump(dc); } #endif #endif //_DEBUG // CFileLogView ¸Þ½ÃÁö 󸮱âÀÔ´Ï´Ù. void CFileLogView::OnSize(UINT nType, int cx, int cy) { CScrollView::OnSize(nType, cx, cy); // TODO: ¿©±â¿¡ ¸Þ½ÃÁö 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. if (m_pList) m_pList->SetWindowPos(NULL, 0, 0, cx, cy, SWP_NOMOVE); } bool CFileLogView::OpenFile() { return (m_pList) ? m_pList->OpenFile() : false; } void CFileLogView::InsertLog(LogInfo& log) { if (m_pList) m_pList->InsertLog(log); }