63 lines
1.5 KiB
C++
63 lines
1.5 KiB
C++
// TextStyleNew.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "TextStyleNew.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CTextStyleNew dialog
|
|
|
|
|
|
CTextStyleNew::CTextStyleNew(CWnd* pParent /*=NULL*/)
|
|
: CModelessDialog(CTextStyleNew::IDD, pParent)
|
|
{
|
|
//{{AFX_DATA_INIT(CTextStyleNew)
|
|
m_strNewStyleName = _T("");
|
|
//}}AFX_DATA_INIT
|
|
}
|
|
|
|
|
|
void CTextStyleNew::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CModelessDialog::DoDataExchange(pDX);
|
|
//{{AFX_DATA_MAP(CTextStyleNew)
|
|
DDX_Control(pDX, IDC_TEXTSTYLE_NAME, m_editName);
|
|
DDX_Text(pDX, IDC_TEXTSTYLE_NAME, m_strNewStyleName);
|
|
//}}AFX_DATA_MAP
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CTextStyleNew, CModelessDialog)
|
|
//{{AFX_MSG_MAP(CTextStyleNew)
|
|
ON_EN_CHANGE(IDC_TEXTSTYLE_NAME, OnChangeTextstyleName)
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CTextStyleNew message handlers
|
|
|
|
BOOL CTextStyleNew::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
if(m_bIsNew)
|
|
SetWindowText(_T("新建文字样式"));
|
|
else
|
|
SetWindowText(_T("重命名文字样式"));
|
|
GetDlgItem(IDOK)->EnableWindow(false);
|
|
UpdateData(false);
|
|
m_editName.SetFocus();
|
|
return FALSE; // return TRUE unless you set the focus to a control
|
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|
}
|
|
|
|
void CTextStyleNew::OnChangeTextstyleName()
|
|
{
|
|
GetDlgItem(IDOK)->EnableWindow(true);
|
|
}
|