// AvatarDialogBar.cpp : implementation file
//

#include "stdafx.h"
#include "avatar.h"
#include "AvatarDialogBar.h"

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

/////////////////////////////////////////////////////////////////////////////
// AvatarDialogBar dialog

IMPLEMENT_DYNAMIC(AvatarDialogBar, CInitDialogBar)

BEGIN_MESSAGE_MAP(AvatarDialogBar, CInitDialogBar)
	//{{AFX_MSG_MAP(AvatarDialogBar)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_UPDATE_COMMAND_UI(IDC_BUTTON1,OnUpdateButton1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

AvatarDialogBar::AvatarDialogBar()
{
	//Set initial conditions for controls
	//
	//{{AFX_DATA_INIT(AvatarDialogBar)
	//}}AFX_DATA_INIT
}

AvatarDialogBar::~AvatarDialogBar()
{

}

BOOL AvatarDialogBar::OnInitDialogBar()
{
	//Support for DDX Mechanism
	// If you do not want DDX then
    // do not call base class
    CInitDialogBar::OnInitDialogBar();

    // Update any controls NOT supported by DDX
    // CBitmapButton is one

    return TRUE;
}


void AvatarDialogBar::DoDataExchange(CDataExchange* pDX)
{
	ASSERT(pDX);

	CInitDialogBar::DoDataExchange(pDX);
	
	//DDX_??? functions to associate control with 
	//data or control object
	//Call UpdateData(TRUE) to get data at any time
	//Call UpdateData(FALSE) to set data at any time

	//{{AFX_DATA_MAP(AvatarDialogBar)
	DDX_Control(pDX, IDC_BUTTON1, m_button1);
	//}}AFX_DATA_MAP
}


/////////////////////////////////////////////////////////////////////////////
// AvatarDialogBar message handlers

void AvatarDialogBar::OnUpdateButton1(CCmdUI* pCmdUI)
{
	pCmdUI->Enable(TRUE);

	//using pCmdUI->SetText you can set the button text too
}

void AvatarDialogBar::OnButton1() 
{
	// TODO: Add your control notification handler code here
	MessageBox("it works");
}
