// DialogECGSet.cpp : 实现文件
//

#include "stdafx.h"
#include "Verbpo.h"
#include "DialogECGSet.h"
#include "afxdialogex.h"


// CDialogECGSet 对话框

IMPLEMENT_DYNAMIC(CDialogECGSet, CDialogEx)

CDialogECGSet::CDialogECGSet(CWnd* pParent /*=NULL*/)
	: CDialogEx(CDialogECGSet::IDD, pParent)
{

}

CDialogECGSet::~CDialogECGSet()
{
}

void CDialogECGSet::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_TAB1, m_Tab);
}



BOOL CDialogECGSet::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	// TODO:  在此添加额外的初始化
	//	m_TabCtrl.InsertItem(0,"坐标步数"); 
	m_Tab.InsertItem(0, _T("心电参数"));
	m_Tab.InsertItem(1, _T("ST参数"));
	m_Tab.InsertItem(2, _T("ARRA"));
	
	m_CDialogECGSetNormal.Create(IDD_DIALOG_ECG_SET_NORMAL, &m_Tab);
	m_CDialogECGSetST.Create(IDD_DIALOG_ECG_SET_ST, &m_Tab);
	m_CDialogECGSetARRA.Create(IDD_DIALOG_ECG_SET_ARRA, &m_Tab);
	
	CRect r;
	m_Tab.GetClientRect(&r);
	m_CDialogECGSetNormal.SetWindowPos(NULL, 10, 30, r.right - 20, r.bottom - 40, SWP_SHOWWINDOW);
	m_CDialogECGSetST.SetWindowPos(NULL, 10, 30, r.right - 20, r.bottom - 40, SWP_HIDEWINDOW);
	m_CDialogECGSetARRA.SetWindowPos(NULL, 10, 30, r.right - 20, r.bottom - 40, SWP_HIDEWINDOW);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}

BEGIN_MESSAGE_MAP(CDialogECGSet, CDialogEx)
	ON_NOTIFY(TCN_SELCHANGE, IDC_TAB1, &CDialogECGSet::OnTcnSelchangeTab1)
END_MESSAGE_MAP()


// CDialogECGSet 消息处理程序


void CDialogECGSet::OnTcnSelchangeTab1(NMHDR *pNMHDR, LRESULT *pResult)
{
	// TODO:  在此添加控件通知处理程序代码

		CRect r;
		m_Tab.GetClientRect(&r);
		int id = m_Tab.GetCurSel();

		switch (id)
		{
		case 0:
			m_CDialogECGSetNormal.SetWindowPos(NULL, 10, 30, r.right - 20, r.bottom - 40, SWP_SHOWWINDOW);
			m_CDialogECGSetST.SetWindowPos(NULL, 10, 30, r.right - 20, r.bottom - 40, SWP_HIDEWINDOW);
			m_CDialogECGSetARRA.SetWindowPos(NULL, 10, 30, r.right - 20, r.bottom - 40, SWP_HIDEWINDOW);
			break;

		case 1:
			m_CDialogECGSetNormal.SetWindowPos(NULL, 10, 30, r.right - 20, r.bottom - 40, SWP_HIDEWINDOW);
			m_CDialogECGSetST.SetWindowPos(NULL, 10, 30, r.right - 20, r.bottom - 40, SWP_SHOWWINDOW);
			m_CDialogECGSetARRA.SetWindowPos(NULL, 10, 30, r.right - 20, r.bottom - 40, SWP_HIDEWINDOW);
			break;

		case 2:
			m_CDialogECGSetNormal.SetWindowPos(NULL, 10, 30, r.right - 20, r.bottom - 40, SWP_HIDEWINDOW);
			m_CDialogECGSetST.SetWindowPos(NULL, 10, 30, r.right - 20, r.bottom - 40, SWP_HIDEWINDOW);
			m_CDialogECGSetARRA.SetWindowPos(NULL, 10, 30, r.right - 20, r.bottom - 40, SWP_SHOWWINDOW);
			break;

		}

	*pResult = 0;
}
