// DlgLog.cpp : 구현 파일입니다.
|
//
|
|
#include "stdafx.h"
|
#include "ReviewSystem.h"
|
#include "DlgLog.h"
|
|
|
// CDlgLog 대화 상자입니다.
|
|
IMPLEMENT_DYNAMIC(CDlgLog, CDialog)
|
|
CDlgLog::CDlgLog(CWnd* pParent /*=NULL*/)
|
: CDialog(CDlgLog::IDD, pParent)
|
{
|
|
}
|
|
CDlgLog::~CDlgLog()
|
{
|
}
|
|
void CDlgLog::DoDataExchange(CDataExchange* pDX)
|
{
|
CDialog::DoDataExchange(pDX);
|
DDX_Control(pDX, IDC_LIST_LOG, m_ctrlLogListBox);
|
}
|
|
|
BEGIN_MESSAGE_MAP(CDlgLog, CDialog)
|
ON_BN_CLICKED(IDOK, &CDlgLog::OnBnClickedOk)
|
ON_BN_CLICKED(IDCANCEL, &CDlgLog::OnBnClickedCancel)
|
ON_WM_SIZE()
|
END_MESSAGE_MAP()
|
|
|
// CDlgLog 메시지 처리기입니다.
|
|
void CDlgLog::OnBnClickedOk()
|
{
|
// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
|
//OnOK();
|
}
|
|
void CDlgLog::OnBnClickedCancel()
|
{
|
// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
|
//OnCancel();
|
}
|
|
void CDlgLog::OnSize(UINT nType, int cx, int cy)
|
{
|
CDialog::OnSize(nType, cx, cy);
|
|
if (m_ctrlLogListBox.GetSafeHwnd())
|
{
|
m_ctrlLogListBox.SetWindowPos(NULL, 0, 0, cx, cy, SWP_NOZORDER);
|
}
|
|
// TODO: 여기에 메시지 처리기 코드를 추가합니다.
|
}
|
|
void CDlgLog::DisplayMessage(const CString& strMessage)
|
{
|
int nCount;
|
CTime time;
|
CString strStamp, strLog;
|
|
nCount = m_ctrlLogListBox.GetCount();
|
|
if (nCount % MAX_PRINT_COUNT == 0)
|
{
|
m_ctrlLogListBox.ResetContent();
|
}
|
|
SYSTEMTIME currentTime;
|
::GetLocalTime(¤tTime);
|
time = CTime::GetCurrentTime();
|
strStamp.Format(_T("[%02d:%02d:%02d]"), time.GetHour(), time.GetMinute(), time.GetSecond());
|
strLog.Format(_T("%s %s"), strStamp, strMessage);
|
m_ctrlLogListBox.AddString(strLog);
|
m_ctrlLogListBox.SetCurSel(m_ctrlLogListBox.GetCount()-1);
|
}
|