// WorldConfiguration.cpp : implementation file
//

#include "stdafx.h"
#include "mushclient.h"
#include "doc.h"

#include "WorldConfiguration.h"

#include "PrefsPropertySheet.h"
#include "prefspropertypages.h"

#include "genprint.h"

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

/////////////////////////////////////////////////////////////////////////////
// CWorldConfiguration dialog


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


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


BEGIN_MESSAGE_MAP(CWorldConfiguration, CDialog)
	//{{AFX_MSG_MAP(CWorldConfiguration)
	ON_BN_CLICKED(IDC_CONFIG_NAME, OnConfigName)
	ON_BN_CLICKED(IDC_CONFIG_APPEARANCE, OnConfigAppearance)
	ON_BN_CLICKED(IDC_CONFIG_INPUT, OnConfigInput)
	ON_BN_CLICKED(IDC_CONFIG_TRIGGERS, OnConfigTriggers)
	ON_BN_CLICKED(IDC_CONFIG_PASTE, OnConfigPaste)
	ON_BN_CLICKED(IDC_CONFIG_SCRIPTING, OnConfigScripting)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CWorldConfiguration message handlers

void CWorldConfiguration::OnConfigName() 
{
  m_doc->ConfigureName ();
}

void CWorldConfiguration::OnConfigAppearance() 
{
  m_doc->ConfigureAppearance ();
}

void CWorldConfiguration::OnConfigInput() 
{
  m_doc->ConfigureInput ();
}

void CWorldConfiguration::OnConfigTriggers() 
{
  m_doc->ConfigureTriggers ();
}

void CWorldConfiguration::OnConfigPaste() 
{
  m_doc->ConfigurePaste ();
}

void CWorldConfiguration::OnConfigScripting() 
{
  m_doc->ConfigureScripting ();
}

BOOL CWorldConfiguration::OnInitDialog() 
{
	CDialog::OnInitDialog();

CString str;

  str = "World Configuration";

  if (!m_doc->m_mush_name.IsEmpty ())
    {
    str += " - ";
    str += m_doc->m_mush_name;
    }
  
  SetWindowText (str);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
