Files
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

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);
}