// Panel.cpp : implementation file
//

#include "stdafx.h"
#include "binarytool.h"
#include "Panel.h"

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

/////////////////////////////////////////////////////////////////////////////
// CPanel dialog


CPanel::CPanel(UINT nIDTemplate, CWnd* pParent /*=NULL*/)
	: CDialog(nIDTemplate, pParent)
{
	//{{AFX_DATA_INIT(CPanel)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CPanel::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPanel)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPanel, CDialog)
	//{{AFX_MSG_MAP(CPanel)
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CPanel user methods
// Here are the default behaviour for every panels
// Override these function for custom behaviour

// This function MUST be overridden.
BOOL CPanel::Create( CWnd* pParentWnd )
{
	return FALSE;
}

// Called at end of program, to allow a panel to store infos in registry
void CPanel::m_fn_vUpdateRegistry()
{
}

// By default, a panel does nothing when enter is hit.
// Moreover, it should NOT call EndDialog()
void CPanel::OnOk()
{
}


// called when user wants to leave the panel to go to another one.
BOOL CPanel::m_fn_bCanChangePanel()
{
	return TRUE;
}

// Called just before the panel is displayed (when user click on it's title)
void CPanel::m_fn_vOnDisplayPanel()
{
}


// To enable/disable all controls of a panel.
void CPanel::m_fn_vEnableAllControls( BOOL bEnable )
{
	CWnd *p_Win = GetTopWindow();

	while( p_Win )
	{
		p_Win -> EnableWindow( bEnable );
		p_Win = p_Win -> GetNextWindow( GW_HWNDNEXT );
	}
}

// Called after game.dsc has been read for list of map.
void CPanel::m_fn_vLevelListHasChanged( BOOL _bErrorWhileReadingGameDsc )
{
	_bErrorWhileReadingGameDsc = _bErrorWhileReadingGameDsc;
}