// TexturePanel.cpp : implementation file
//

#include "stdafx.h"
#include "pixelwhippro.h"
#include "TexturePanel2.h"
#include "TextureBrowser.h"

extern CPixelWhipProApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CTexturePanel2 dialog


CTexturePanel2::CTexturePanel2(CWnd* pParent /*=NULL*/)
	: CDynaPanel(CTexturePanel2::IDD, pParent)
{
	//{{AFX_DATA_INIT(CTexturePanel2)
	m_TextureName = _T("");
	//}}AFX_DATA_INIT
}


void CTexturePanel2::DoDataExchange(CDataExchange* pDX)
{
	CDynaPanel::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CTexturePanel2)
	DDX_Text(pDX, IDC_TEXTURENAME, m_TextureName);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CTexturePanel2, CDynaPanel)
	//{{AFX_MSG_MAP(CTexturePanel2)
	ON_BN_CLICKED(IDC_TEXTUREBROWSE, OnTexturebrowse)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTexturePanel2 message handlers

void CTexturePanel2::Set(void *dat)
{
	Str=(Stuff::MString *)dat;

	m_TextureName=(char *)*Str;

}

void CTexturePanel2::OnTexturebrowse() 
{
CTextureBrowser dlg;

if(dlg.DoModal()==IDOK)
{
m_TextureName=dlg.m_TextureName;
theApp.Modified=true;
*Str=(char *)(LPCSTR)m_TextureName;

UpdateData(FALSE);
}
	
}