📄 newfile.cpp
字号:
// NewFile.cpp : implementation file
//
#include "stdafx.h"
#include "cge.h"
#include "cgeDoc.h"
#include "NewFile.h"
#include "SoftKeyDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
CNewFile::CNewFile(CWnd* pParent /*=NULL*/)
: CDialog(CNewFile::IDD, pParent)
{
//{{AFX_DATA_INIT(CNewFile)
m_pa5 = _T("");
m_pa0 = _T("");
m_pa1 = _T("");
m_pa6 = _T("");
m_pa4 = _T("");
m_pa3 = _T("");
m_pa2 = _T("");
m_pa7 = _T("");
//}}AFX_DATA_INIT
}
void CNewFile::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CNewFile)
DDX_Text(pDX, IDC_LINE, m_pa5);
DDX_Text(pDX, IDC_FILE, m_pa0);
DDX_Text(pDX, IDC_CHECK_SPACE, m_pa1);
DDX_Text(pDX, IDC_EDIT1, m_pa6);
DDX_Text(pDX, IDC_OFFSET, m_pa4);
DDX_Text(pDX, IDC_PO, m_pa3);
DDX_Text(pDX, IDC_SOURCE, m_pa2);
DDX_Text(pDX, IDC_EDIT2, m_pa7);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CNewFile, CDialog)
//{{AFX_MSG_MAP(CNewFile)
ON_WM_CREATE()
ON_CBN_DROPDOWN(IDC_PATH, OnDropdownPath)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNewFile message handlers
int CNewFile::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
return 0;
}
void CNewFile::OnDropdownPath()
{
/*CFileDialog fdlg(true,"dat",NULL,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,"CGE File(*.dat) |*.dat|CGE File(*.*) |*.*||" );
int IDOKCANCEL;
IDOKCANCEL = fdlg.DoModal();
if(IDOKCANCEL == IDOK)
{
//m_CMyLineList.RemoveAll();
// UpdateAllViews(NULL);
m_path = fdlg.GetPathName();
// this->SetPathName(PathName,true);
}*/
}
BOOL CNewFile::OnInitDialog()
{
NewFileKey = false;
/*
if(m_butoon1Key) //m510
{
GetDlgItem(IDC_BUTTON1)->EnableWindow(false);
}else
{
GetDlgItem(IDC_BUTTON1)->EnableWindow(true);
}
*/
CDialog::OnInitDialog();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CNewFile::OnButton1()
{
CTime tNow;
tNow = CTime::GetCurrentTime();
m_pa6 = tNow.Format("%Y/%m/%d");
m_pa7 = tNow.Format("%H:%M");
UpdateData(false);
//m_pa8 = m_pa0;//旧、新文件名一致
NewFileKey = true;
GetDlgItem(IDC_FILE)->SetFocus();
}
void CNewFile::OnOK()
{
if(NewFileKey)
{
UpdateData(true);
m_pa8 = m_pa0;//旧、新文件名一致,保存时保存m_pa8
NewFileKey = false;
}
CDialog::OnOK();
}
void CNewFile::OnCancel()
{
NewFileKey = false;
CDialog::OnCancel();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -