// imp_configwindow.cpp : implementation file
//

#include "stdafx.h"
#include "bhttpgiwp.h"
#include "imp_configwindow.h"
#include "imp_block.h"


// CImpBlockConfigWindow dialog

IMPLEMENT_DYNAMIC(CImpBlockConfigWindow, CDialog)

CImpBlockConfigWindow::CImpBlockConfigWindow(CWnd* pParent /*=NULL*/, IUnknown* pUnkOuter)
	: CDialog(CImpBlockConfigWindow::IDD, pParent)
{
	m_pImpBlock = (CImpBlock*)pUnkOuter;
}

CImpBlockConfigWindow::~CImpBlockConfigWindow()
{
}

void CImpBlockConfigWindow::DoDataExchange(CDataExchange* pDX)
{
	EnterCriticalSection(&m_pImpBlock->m_cs);
	DDX_Text(pDX, IDC_EDITSERVER, m_pImpBlock->m_strServer);
	DDX_Text(pDX, IDC_EDITPATH, m_pImpBlock->m_strPath);
	DDX_Text(pDX, IDC_EDITIMAGENAME, m_pImpBlock->m_strImageName);
	LeaveCriticalSection(&m_pImpBlock->m_cs);

	if ( pDX->m_bSaveAndValidate )
		m_pImpBlock->SetModifiedFlag(TRUE);
}


BEGIN_MESSAGE_MAP(CImpBlockConfigWindow, CDialog)
	ON_BN_CLICKED(IDC_APPLY, &CImpBlockConfigWindow::OnBnClickedApply)
END_MESSAGE_MAP()


// CImpBlockConfigWindow message handlers

void CImpBlockConfigWindow::OnCancel()
{
	CDialog::OnCancel();
	DestroyWindow();
}

void CImpBlockConfigWindow::OnOK()
{
	CDialog::OnOK();
	DestroyWindow();
}

BOOL CImpBlockConfigWindow::OnInitDialog()
{

	// TODO:  Add extra initialization here

	CDialog::OnInitDialog();

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}

void CImpBlockConfigWindow::OnBnClickedApply()
{
	CDataExchange dx(this, TRUE);
	DoDataExchange(&dx);
}