DlgNewFile.cpp
资源名称:OSDemo [点击查看]
上传用户:tianjwyx
上传日期:2007-01-13
资源大小:813k
文件大小:2k
源码类别:
操作系统开发
开发平台:
Visual C++
- // DlgNewFile.cpp : implementation file
- //
- #include "stdafx.h"
- #include "OSDemo.h"
- #include "DlgNewFile.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CDlgNewFile dialog
- CDlgNewFile::CDlgNewFile(CWnd* pParent /*=NULL*/)
- : CDialog(CDlgNewFile::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CDlgNewFile)
- m_FileName = _T("");
- m_Share = FALSE;
- m_Read = FALSE;
- m_Execute = FALSE;
- m_Content = _T("");
- //}}AFX_DATA_INIT
- }
- void CDlgNewFile::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CDlgNewFile)
- DDX_Text(pDX, IDC_EDIT_FILENAME, m_FileName);
- DDX_Check(pDX, IDC_CHECK_SHARE, m_Share);
- DDX_Check(pDX, IDC_CHECK_READ, m_Read);
- DDX_Check(pDX, IDC_CHECK_EXECUTE, m_Execute);
- DDX_Text(pDX, IDC_EDIT_CONTENT, m_Content);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CDlgNewFile, CDialog)
- //{{AFX_MSG_MAP(CDlgNewFile)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CDlgNewFile message handlers
- BOOL CDlgNewFile::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- CString Title;
- UpdateData(false);
- if(flag)
- {
- Title="新建文件";
- SetWindowText(Title);
- Title+="(&A)";
- ((CStatic*)GetDlgItem(IDOK))->SetWindowText(Title);
- ((CStatic*)GetDlgItem(IDC_EDIT_FILENAME))->SetFocus();
- }
- else
- {
- Title="修改文件";
- SetWindowText(Title);
- Title+="(&M)";
- //((CStatic*)GetDlgItem(IDC_EDIT_FILENAME))->EnableWindow(false);
- ((CStatic*)GetDlgItem(IDOK))->SetWindowText(Title);
- ((CStatic*)GetDlgItem(IDC_EDIT_CONTENT))->SetFocus();
- }
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CDlgNewFile::OnOK()
- {
- UpdateData(true);
- CDialog::OnOK();
- }