// AddPictureDlg.cpp : implementation file
//

#include "stdafx.h"
#include "ex30a.h"
#include "AddPictureDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAddPictureDlg dialog


CAddPictureDlg::CAddPictureDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CAddPictureDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CAddPictureDlg)
	m_uBook = 0;
	m_nPage = 0;
	m_strPath = _T("");
	m_strName = _T("");
	m_nAsSmallPicture = 0;
	//}}AFX_DATA_INIT
}


void CAddPictureDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAddPictureDlg)
	DDX_Text(pDX, IDC_BOOK, m_uBook);
	DDX_Text(pDX, IDC_PAGE, m_nPage);
	DDX_Text(pDX, IDC_PATH, m_strPath);
	DDX_Text(pDX, IDC_NAME, m_strName);
	DDX_Radio(pDX, IDC_SMALL, m_nAsSmallPicture);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CAddPictureDlg, CDialog)
	//{{AFX_MSG_MAP(CAddPictureDlg)
	ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAddPictureDlg message handlers

void CAddPictureDlg::OnBrowse() 
{
	static const char szFilter[] = "Bitmap (*.bmp)|*.bmp||";
	
	CFileDialog dlg(TRUE, "bmp", NULL, 
		OFN_HIDEREADONLY | OFN_FILEMUSTEXIST, szFilter);

	if (dlg.DoModal() == IDOK)
		GetDlgItem(IDC_PATH)->SetWindowText(dlg.GetPathName());
}


