📄 ezmrpage.cpp
字号:
////////////////////////////////////////////////////////////////////////////////
// EzMrPage.cpp : implementation file
// $Header: /USB/Util/EzMr/EzMrPage.cpp 6 3/07/02 4:51p Tpm $
// Copyright (c) 2000 Cypress Semiconductor. May not be reproduced without permission.
// See the EzUsb Developer's Kit license agreement for more details.
////////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "resource.h"
#include "EzMrPage.h"
#include "EzMr.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CMyPropertyPage1, CPropertyPage)
IMPLEMENT_DYNCREATE(CMyPropertyPage2, CPropertyPage)
/////////////////////////////////////////////////////////////////////////////
// CMyPropertyPage1 property page
CMyPropertyPage1::CMyPropertyPage1() : CPropertyPage(CMyPropertyPage1::IDD)
{
//{{AFX_DATA_INIT(CMyPropertyPage1)
m_nVerbose = FALSE;
m_nPopUpOps = FALSE;
m_nAutoHoldRun = FALSE;
m_bThreaded = FALSE;
m_nMaxOpsPending = 0;
// m_nTarg = 0;
//}}AFX_DATA_INIT
}
CMyPropertyPage1::~CMyPropertyPage1()
{
}
void CMyPropertyPage1::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyPropertyPage1)
DDX_Check(pDX, IDC_VERBOSE, m_nVerbose);
DDX_Check(pDX, IDC_SHOW_ALL_COMMANDS, m_nPopUpOps);
DDX_Check(pDX, IDC_AUTO_HOLD_RUN, m_nAutoHoldRun);
DDX_Check(pDX, IDC_THREADED, m_bThreaded);
DDX_Text(pDX, IDC_MAX_OPS_PENDING, m_nMaxOpsPending);
DDV_MinMaxInt(pDX, m_nMaxOpsPending, 1, MAX_OPS_PENDING);
// DDX_Check(pDX, IDC_FX2, m_nTarg);
//}}AFX_DATA_MAP
}
void CMyPropertyPage1::OnOK()
{
CPropertyPage::OnOK();
}
BEGIN_MESSAGE_MAP(CMyPropertyPage1, CPropertyPage)
//{{AFX_MSG_MAP(CMyPropertyPage1)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyPropertyPage2 property page
CMyPropertyPage2::CMyPropertyPage2() : CPropertyPage(CMyPropertyPage2::IDD)
{
//{{AFX_DATA_INIT(CMyPropertyPage2)
m_strMonFileName = _T("");
m_strHexEdFileName = _T("");
//}}AFX_DATA_INIT
}
CMyPropertyPage2::~CMyPropertyPage2()
{
}
void CMyPropertyPage2::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyPropertyPage2)
DDX_Text(pDX, IDC_MON_FILE_NAME, m_strMonFileName);
DDX_Text(pDX, IDC_HEX_ED_FILE_NAME, m_strHexEdFileName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMyPropertyPage2, CPropertyPage)
//{{AFX_MSG_MAP(CMyPropertyPage2)
ON_BN_CLICKED(IDC_MON_BROWSE, OnMonBrowse)
ON_BN_CLICKED(IDC_HEX_BROWSE, OnHexBrowse)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CMyPropertyPage2::OnMonBrowse()
{
CFileDialog dlgLoad(
TRUE, 0, 0,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
"AllFiles (*.*)|*.*||");
dlgLoad.m_ofn.lpstrTitle = "Download Monitor File";
dlgLoad.m_ofn.lpstrInitialDir = m_strMonFileName;
if(dlgLoad.DoModal() != IDOK)
return;
m_strMonFileName = dlgLoad.m_ofn.lpstrFile;
UpdateData(FALSE);
}
BOOL CMyPropertyPage2::OnInitDialog()
{
CPropertyPage::OnInitDialog();
m_strMonFileName = theApp.m_strMonFileName;
m_strHexEdFileName = theApp.m_strHexEdFileName;
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CMyPropertyPage2::OnHexBrowse()
{
CFileDialog dlgLoad(
TRUE, 0, 0,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
"Exe Files (*.exe)|*.exe||");
dlgLoad.m_ofn.lpstrTitle = "Hex Editor Selection";
dlgLoad.m_ofn.lpstrInitialDir = m_strHexEdFileName;
if(dlgLoad.DoModal() != IDOK)
return;
m_strHexEdFileName = dlgLoad.m_ofn.lpstrFile;
theApp.m_strHexEdFileName = m_strHexEdFileName;
UpdateData(FALSE);
}
void CMyPropertyPage2::OnOK()
{
// set global vars to local vals and write to registry ONLY if values have changed
if(theApp.m_strMonFileName != m_strMonFileName)
{
theApp.m_strMonFileName = m_strMonFileName;
theApp.WriteProfileString("Settings", "m_strMonFileName", theApp.m_strMonFileName);
}
theApp.m_strHexEdFileName = m_strHexEdFileName;
CPropertyPage::OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -