📄 newtextdlg.cpp
字号:
// NewTextDlg.cpp : implementation file
//
#include "stdafx.h"
#include "TipReader.h"
#include "NewTextDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNewTextDlg dialog
CNewTextDlg::CNewTextDlg(CWnd* pParent /*=NULL*/)
: CDialog(CNewTextDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CNewTextDlg)
m_title = _T("");
m_dirstr = _T("");
m_text = _T("");
//}}AFX_DATA_INIT
}
void CNewTextDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CNewTextDlg)
DDX_Control(pDX, IDC_EDIT2, m_textedit);
DDX_Control(pDX, IDC_COMBO1, m_dirlist);
DDX_Control(pDX, IDC_EDIT1, m_titleedit);
DDX_Text(pDX, IDC_EDIT1, m_title);
DDX_CBString(pDX, IDC_COMBO1, m_dirstr);
DDX_Text(pDX, IDC_EDIT2, m_text);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CNewTextDlg, CDialog)
//{{AFX_MSG_MAP(CNewTextDlg)
ON_EN_SETFOCUS(IDC_EDIT1, OnSetfocusEdit1)
ON_EN_SETFOCUS(IDC_EDIT2, OnSetfocusEdit2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNewTextDlg message handlers
void CNewTextDlg::OnSetfocusEdit1()
{
// TODO: Add your control notification handler code here
CString str;
m_titleedit.GetWindowText(str);
if(str=="点击这里输入文本标题")
{
this->m_titleedit.SetSel(0,this->m_title.GetLength(),TRUE);
this->m_titleedit.Clear();
}
}
BOOL CNewTextDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
int length,i;
CStringList * m_pSl=&(((CTipReaderApp *)::AfxGetApp())->m_config.m_pathlist);
length=m_pSl->GetCount();
for(i=0;i<length;i++)
{
this->m_dirlist.AddString(m_pSl->GetAt(m_pSl->FindIndex(i)));
}
this->m_dirlist.SetCurSel(this->m_dirlist.FindString(-1,((CTipReaderApp *)::AfxGetApp())->m_config.m_path));
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CNewTextDlg::OnSetfocusEdit2()
{
// TODO: Add your control notification handler code here
CString str;
m_textedit.GetWindowText(str);
if(str=="点击这里输入文本正文")
{
this->m_textedit.SetSel(0,str.GetLength(),TRUE);
this->m_textedit.Clear();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -