// editstr.cpp : implementation file
//

#include "stdafx.h"
#include "MUSHclient.h"
#include "editstr.h"

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

/////////////////////////////////////////////////////////////////////////////
// CEditString dialog


CEditString::CEditString(CWnd* pParent /*=NULL*/)
	: CDialog(CEditString::IDD, pParent)
{
	//{{AFX_DATA_INIT(CEditString)
	m_match_on = _T("");
	m_string_type = _T("");
	//}}AFX_DATA_INIT
}


void CEditString::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CEditString)
	DDX_Text(pDX, IDC_MATCH_ON, m_match_on);
	DDV_MaxChars(pDX, m_match_on, 30);
	DDX_Text(pDX, IDC_STRING_TYPE, m_string_type);
	//}}AFX_DATA_MAP


   if(pDX->m_bSaveAndValidate)
    {

    if(m_match_on.IsEmpty ())
        {
        ::AfxMessageBox("The string to match on cannot be blank.");
        DDX_Text(pDX, IDC_MATCH_ON, m_match_on);
        pDX->Fail();
        return;
        }     // end of string being blank
  
    } // end of saving and validating

}


BEGIN_MESSAGE_MAP(CEditString, CDialog)
	//{{AFX_MSG_MAP(CEditString)
	ON_BN_CLICKED(IDC_HELPBUTTON, OnHelpbutton)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CEditString message handlers

void CEditString::OnHelpbutton() 
{
//  OnCmdMsg(ID_HELP, CN_COMMAND, NULL, NULL);
	App.WinHelp(m_nIDHelp + HID_BASE_RESOURCE);
}
