// DlgTapCtrl.cpp : ±¸Çö ÆÄÀÏÀÔ´Ï´Ù.
|
//
|
|
#include "stdafx.h"
|
#include "ReviewSystem.h"
|
#include "DlgTapCtrl.h"
|
#include "afxdialogex.h"
|
|
|
// DlgTapCtrl ´ëÈ »óÀÚÀÔ´Ï´Ù.
|
|
IMPLEMENT_DYNAMIC(DlgTapCtrl, CDialogEx)
|
|
DlgTapCtrl::DlgTapCtrl(CWnd* pParent /*=NULL*/)
|
: CDialogEx(DlgTapCtrl::IDD, pParent)
|
{
|
|
}
|
|
DlgTapCtrl::~DlgTapCtrl()
|
{
|
m_vecWndPtr.clear();
|
m_vecString.clear();
|
}
|
|
void DlgTapCtrl::DoDataExchange(CDataExchange* pDX)
|
{
|
CDialogEx::DoDataExchange(pDX);
|
DDX_Control(pDX, IDC_TAB_CTRL, m_ctrlTabCtrl);
|
}
|
|
|
BEGIN_MESSAGE_MAP(DlgTapCtrl, CDialogEx)
|
ON_WM_SIZE()
|
ON_NOTIFY(TCN_SELCHANGE, IDC_TAB_CTRL, &DlgTapCtrl::OnTcnSelchangeTabControl)
|
ON_WM_ERASEBKGND()
|
ON_WM_CTLCOLOR()
|
END_MESSAGE_MAP()
|
|
|
// DlgTapCtrl ¸Þ½ÃÁö 󸮱âÀÔ´Ï´Ù.
|
void DlgTapCtrl::OnBnClickedOk()
|
{
|
// TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
//OnOK();
|
}
|
|
void DlgTapCtrl::OnBnClickedCancel()
|
{
|
// TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
//OnCancel();
|
}
|
|
void DlgTapCtrl::InitTabControl()
|
{
|
m_ctrlTabCtrl.DeleteAllItems();
|
|
|
int nIdx = 0;
|
for (VectorStringIt it=m_vecString.begin(); it!=m_vecString.end(); it++)
|
{
|
m_ctrlTabCtrl.InsertItem(nIdx++, *it);
|
}
|
|
m_ctrlTabCtrl.SetCurSel(0);
|
|
for (int i=0; i<(int)m_vecWndPtr.size(); i++)
|
{
|
if (m_vecWndPtr[i]==NULL) continue;
|
|
if (0==i)
|
{
|
m_vecWndPtr[i]->ShowWindow(SW_SHOW);
|
}
|
else
|
{
|
m_vecWndPtr[i]->ShowWindow(SW_HIDE);
|
}
|
}
|
}
|
|
void DlgTapCtrl::AddWndPtr(CWnd *pWnd, const CString& strName)
|
{
|
if (pWnd==NULL) return;
|
pWnd->SetParent(this);
|
m_vecWndPtr.push_back(pWnd);
|
m_vecString.push_back(strName);
|
pWnd->SetWindowPos(NULL, 2,2,0,0, SWP_NOSIZE|SWP_NOZORDER);
|
InitTabControl();
|
}
|
|
|
void DlgTapCtrl::OnSize(UINT nType, int cx, int cy)
|
{
|
CDialog::OnSize(nType, cx, cy);
|
|
// TODO: ¿©±â¿¡ ¸Þ½ÃÁö 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
if (m_ctrlTabCtrl.GetSafeHwnd())
|
{
|
m_ctrlTabCtrl.SetWindowPos(NULL, 0, 0, cx, cy, SWP_NOZORDER);
|
}
|
}
|
|
void DlgTapCtrl::OnTcnSelchangeTabControl(NMHDR *pNMHDR, LRESULT *pResult)
|
{
|
// TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
int nTabIdx = m_ctrlTabCtrl.GetCurSel();
|
|
SetActiveDialog(nTabIdx);
|
|
*pResult = 0;
|
}
|
|
void DlgTapCtrl::SetActiveDialog(int nTabIdx)
|
{
|
if (nTabIdx<0 || nTabIdx>=(int)m_vecWndPtr.size()) return;
|
|
for (int i=0; i<(int)m_vecWndPtr.size(); i++)
|
{
|
if (m_vecWndPtr[i]==NULL) continue;
|
|
if (nTabIdx==i)
|
{
|
m_vecWndPtr[i]->ShowWindow(SW_SHOW);
|
}
|
else
|
{
|
m_vecWndPtr[i]->ShowWindow(SW_HIDE);
|
}
|
}
|
|
m_ctrlTabCtrl.SetCurSel(nTabIdx);
|
}
|
|
BOOL DlgTapCtrl::OnInitDialog()
|
{
|
CDialog::OnInitDialog();
|
|
// TODO: ¿©±â¿¡ Ãß°¡ ÃʱâÈ ÀÛ¾÷À» Ãß°¡ÇÕ´Ï´Ù.
|
InitTabControl();
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
// ¿¹¿Ü: OCX ¼Ó¼º ÆäÀÌÁö´Â FALSE¸¦ ¹ÝÈ¯ÇØ¾ß ÇÕ´Ï´Ù.
|
}
|
|
void DlgTapCtrl::UpdateProcessStatus( int nLineType, int nMachineType, int nProcessStatus, const CGlassResult* pGlassResult )
|
{
|
|
switch(nProcessStatus)
|
{
|
case ProcessLoading:
|
SetActiveDialog(0);
|
break;
|
case ProcessAlignStart:
|
SetActiveDialog(2);
|
break;
|
|
default:
|
SetActiveDialog(0);
|
break;
|
}
|
}
|
|
|
BOOL DlgTapCtrl::OnEraseBkgnd(CDC* pDC)
|
{
|
// TODO: ¿©±â¿¡ ¸Þ½ÃÁö 󸮱â Äڵ带 Ãß°¡ ¹×/¶Ç´Â ±âº»°ªÀ» È£ÃâÇÕ´Ï´Ù.
|
CRect rect;
|
GetClientRect(&rect);
|
__super::OnEraseBkgnd(pDC);
|
pDC->FillSolidRect(rect, RGB(38,38,38) );
|
|
|
return TRUE;
|
|
}
|
|
|
HBRUSH DlgTapCtrl::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
|
{
|
HBRUSH hbr = __super::OnCtlColor(pDC, pWnd, nCtlColor);
|
|
CRect rect;
|
CString strClass = _T("");
|
UINT nID = pWnd->GetDlgCtrlID();
|
|
if(nCtlColor == CTLCOLOR_STATIC)
|
{
|
pDC->SetTextColor(RGB(255,255,255));
|
pDC->SetBkColor(RGB(38,38,38));
|
hbr = (HBRUSH)GetStockObject(NULL_BRUSH);
|
}
|
|
|
// TODO: ±âº»°ªÀÌ Àû´çÇÏÁö ¾ÊÀ¸¸é ´Ù¸¥ ºê·¯½Ã¸¦ ¹ÝȯÇÕ´Ï´Ù.
|
return hbr;
|
|
}
|