// MemberInfoDlg_Gui_LongHex.cpp : implementation file
//

#include "stdafx.h"
#include "AsCfgBuilder.h"
#include "MemberInfoDlg_Gui_LongHex.h"
#include "XmlMemberGui_Long.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMemberInfoDlg_Gui_LongHex dialog


CMemberInfoDlg_Gui_LongHex::CMemberInfoDlg_Gui_LongHex(CWnd* pParent /*=NULL*/)
	: CPropertyEditorDlg(CMemberInfoDlg_Gui_LongHex::IDD, pParent)
{
	//{{AFX_DATA_INIT(CMemberInfoDlg_Gui_LongHex)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CMemberInfoDlg_Gui_LongHex::DoDataExchange(CDataExchange* pDX)
{
	CPropertyEditorDlg::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMemberInfoDlg_Gui_LongHex)
	DDX_Control(pDX, IDC_TXT_HEX_BITCOUNT, txtBitCount_);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CMemberInfoDlg_Gui_LongHex, CPropertyEditorDlg)
	//{{AFX_MSG_MAP(CMemberInfoDlg_Gui_LongHex)
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMemberInfoDlg_Gui_LongHex message handlers
void CMemberInfoDlg_Gui_LongHex::SetData(CXmlBaseElement* element)
{
	displayInfo_ = dynamic_cast<CXmlMemberGui_Long*>(element);
	assert(displayInfo_);
	if (displayInfo_ == NULL)
		return;

	DisplayData();
}

void CMemberInfoDlg_Gui_LongHex::StoreData()
{
	CString tmp;

	txtBitCount_.GetWindowText(tmp);
	displayInfo_->SetHexBitCount(_wtoi((const TCHAR*)tmp));
}

void CMemberInfoDlg_Gui_LongHex::OnDataUpdate()
{}

void CMemberInfoDlg_Gui_LongHex::OnOK()
{

}

void CMemberInfoDlg_Gui_LongHex::OnCancel()
{

}

void CMemberInfoDlg_Gui_LongHex::DisplayData()
{
	if (displayInfo_) {
		CString tmp;

		tmp.Format(_T("%d"), displayInfo_->GetHexBitCount());
		txtBitCount_.SetWindowText(tmp);
	}
}