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

#include "stdafx.h"
#include "CombineSubjectDrawTest.h"
#include "MenuStatusSetting_Dlg.h"
#include "afxdialogex.h"


// CMenuStatusSetting_Dlg 对话框

IMPLEMENT_DYNAMIC(CMenuStatusSetting_Dlg, CDialogEx)

CMenuStatusSetting_Dlg::CMenuStatusSetting_Dlg(CWnd* pParent /*=NULL*/)
	: CDialogEx(IDD_DIALOG_STATUS, pParent)
{

}

CMenuStatusSetting_Dlg::~CMenuStatusSetting_Dlg()
{
}

void CMenuStatusSetting_Dlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CMenuStatusSetting_Dlg, CDialogEx)
	ON_BN_CLICKED(IDOK, &CMenuStatusSetting_Dlg::OnBnClickedOk)
	ON_BN_CLICKED(IDC_CHECK1, &CMenuStatusSetting_Dlg::OnBnClickedCheck1)
	ON_BN_CLICKED(IDC_CHECK2, &CMenuStatusSetting_Dlg::OnBnClickedCheck2)
END_MESSAGE_MAP()


// CMenuStatusSetting_Dlg 消息处理程序


void CMenuStatusSetting_Dlg::OnBnClickedOk()
{
	// TODO: 在此添加控件通知处理程序代码
	CDialogEx::OnOK();
}


void CMenuStatusSetting_Dlg::OnBnClickedCheck1()
{
	// TODO: 在此添加控件通知处理程序代码
	CButton* pBtn = (CButton*)GetDlgItem(IDC_CHECK1);
	
	BOOL bShow = pBtn->GetCheck();
	m_pControl->ShowControl(bShow);
}


void CMenuStatusSetting_Dlg::OnBnClickedCheck2()
{
	CButton* pBtn = (CButton*)GetDlgItem(IDC_CHECK2);

	BOOL bEnable = pBtn->GetCheck();
	m_pControl->EnableControl(bEnable);
}


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

	 
	if (m_pControl != NULL)
	{
	 
		CButton* pBtn = (CButton*)GetDlgItem(IDC_CHECK1);
		pBtn->SetCheck(m_pControl->IsControlVisible());

		pBtn = (CButton*)GetDlgItem(IDC_CHECK2);
		pBtn->SetCheck(m_pControl->IsControlEnable());

	}

	return TRUE;  // return TRUE unless you set the focus to a control
				  // 异常: OCX 属性页应返回 FALSE
}
