// PanelDlg.h : ヘッダー ファイル
//

#pragma once
#include "afxwin.h"

#include "CAO.h"

// CPanelDlg ダイアログ
class CPanelDlg : public CDialog
{
// コンストラクション
public:
	CPanelDlg(CWnd* pParent = NULL);	// 標準コンストラクタ

// ダイアログ データ
	enum { IDD = IDD_PANEL_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV サポート


// 実装
protected:
	HICON m_hIcon;

	// 生成された、メッセージ割り当て関数
	virtual BOOL OnInitDialog();
	afx_msg void OnDestroy();
	afx_msg void OnPaint();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnBnClickedButtonConnect();
	afx_msg void OnBnClickedButtonDisconnect();
	afx_msg void OnBnClickedButtonRefresh();
	afx_msg void OnBnClickedButtonWriteVar1();
	afx_msg void OnBnClickedButtonWriteVar2();
	afx_msg void OnBnClickedButtonWriteVar3();
	DECLARE_MESSAGE_MAP()

private:
	void ChangeColor(CStatic& lblShow);
	void ShowErrorMessage(HRESULT hr);

private:
	ICaoEngine		*m_eng;
	ICaoWorkspaces	*m_wss;
	ICaoWorkspace	*m_ws;

	ICaoController	*m_ctrl;
	ICaoVariable	*m_var1;
	ICaoVariable	*m_var2;
	ICaoVariable	*m_var3;
	ICaoVariable	*m_var4;
	ICaoVariable	*m_var5;
	ICaoVariable	*m_var6;

	CBrush brDefault, brRed, brGreen, brYellow;
	CBrush *pbrVar4, *pbrVar5, *pbrVar6;

	CButton btnConnect;
	CButton btnDisconnect;
	CButton btnRefresh;
	CButton btnWriteVar1;
	CButton btnWriteVar2;
	CButton btnWriteVar3;
	CEdit txtVar1;
	CEdit txtVar2;
	CEdit txtVar3;
	CStatic lblShowVar4;
	CStatic lblShowVar5;
	CStatic lblShowVar6;
};
