// ConnectProxyDlg.cpp : 구현 파일입니다.
//

#include "stdafx.h"
#include "ConsoleApp.h"
#include "ConnectProxyDlg.h"


// CConnectProxyDlg 대화 상자입니다.

IMPLEMENT_DYNAMIC(CConnectProxyDlg, CDialog)
CConnectProxyDlg::CConnectProxyDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CConnectProxyDlg::IDD, pParent)
{
}

CConnectProxyDlg::~CConnectProxyDlg()
{
}

void CConnectProxyDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CConnectProxyDlg, CDialog)
END_MESSAGE_MAP()


// CConnectProxyDlg 메시지 처리기입니다.

BOOL CConnectProxyDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	m_dlg.Create(IDD_CONFIG_PROXY, this);

	m_dlg.m_sHost       = COptions::GetOption(OPTION_PROXYHOST);
	m_dlg.m_sPort       = COptions::GetOption(OPTION_PROXYPORT);
	m_dlg.m_bUseIEProxy = COptions::GetOptionVal(OPTION_USEIEPROXY);
	m_dlg.UpdateData(FALSE);

	m_dlg.OnInitDialog();
	m_dlg.MoveWindow(0, 0, 250, 130);
	m_dlg.ShowWindow(SW_SHOW);
	m_dlg.RedrawWindow();
	m_dlg.SetFocus();

	return TRUE;  // return TRUE unless you set the focus to a control
	// 예외: OCX 속성 페이지는 FALSE를 반환해야 합니다.
}

void CConnectProxyDlg::OnOK()
{
	m_dlg.UpdateData(TRUE);
	COptions::SetOption(OPTION_PROXYHOST,  m_dlg.m_sHost);
	COptions::SetOption(OPTION_PROXYPORT,  m_dlg.m_sPort);
	COptions::SetOption(OPTION_USEIEPROXY, m_dlg.m_bUseIEProxy);

	CDialog::OnOK();
}
