// HFAttribDlg.cpp : implementation file
//

#include "stdafx.h"
#include "TCTb.h"
#include "HFAttribDlg.h"

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

extern CTCTbApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CHFAttribDlg dialog


CHFAttribDlg::CHFAttribDlg(CWnd* pParent /*=NULL*/)
: CDialog(CHFAttribDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CHFAttribDlg)
	//}}AFX_DATA_INIT
}


void CHFAttribDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CHFAttribDlg)
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CHFAttribDlg, CDialog)
//{{AFX_MSG_MAP(CHFAttribDlg)
ON_BN_CLICKED(IDC_LOADBASETEXTURE, OnLoadbasetexture)
ON_BN_CLICKED(IDC_LOADDETAILTEXTURE, OnLoaddetailtexture)
ON_BN_CLICKED(IDC_IMPORT, OnImport)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHFAttribDlg message handlers

void CHFAttribDlg::OnLoadbasetexture() 
{
	theApp.LoadBTexture();
	theApp.UpdateScreen();
}

void CHFAttribDlg::OnLoaddetailtexture() 
{
	theApp.LoadDTexture();
	theApp.UpdateScreen();
}

void CHFAttribDlg::OnImport() 
{
	CFileDialog fdlg(TRUE,NULL,NULL,NULL,"Bitmap Images (*.tif,*.gif,*.tga)|*.tif;*.gif;*.tga||",NULL);	
	if(fdlg.DoModal()==IDOK) 
	{
		theApp.ImportBitmap(fdlg.GetPathName());
		theApp.SetStates();
		theApp.UpdateScreen();
	}
	
}

BOOL CHFAttribDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	UpdateData(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}

void CHFAttribDlg::OnOK() 
{
	CDialog::OnOK();
}
