📄 propertydlg.cpp
字号:
// PropertyDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Simulate.h"
#include "PropertyDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPropertyDlg dialog
CPropertyDlg::CPropertyDlg(CWnd* pParent /*=NULL*/)
: CDialog(CPropertyDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CPropertyDlg)
m_strBadPhoton = _T("");
m_strBadRate = _T("");
m_strDeadPhoton = _T("");
m_strDeadRate = _T("");
m_strGoodPhoton = _T("");
m_strGoodRate = _T("");
m_strLAxis = _T("");
m_strNum = _T("");
m_strSAxis = _T("");
//}}AFX_DATA_INIT
m_hpptIcon = AfxGetApp()->LoadIcon(IDI_PROPERTY);
bIsCreated=false;
}
void CPropertyDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPropertyDlg)
DDX_Control(pDX, IDC_EDIT_SAXIS, m_edtSAxis);
DDX_Control(pDX, IDC_EDIT_NUM, m_edtNum);
DDX_Control(pDX, IDC_EDIT_LAXIS, m_edtLAxis);
DDX_Control(pDX, IDC_EDIT_GOODRATE, m_edtGoodRate);
DDX_Control(pDX, IDC_EDIT_GOODPHOTON, m_edtGoodPhoton);
DDX_Control(pDX, IDC_EDIT_DEADRATE1, m_edtDeadRate);
DDX_Control(pDX, IDC_EDIT_DEADPHOTON1, m_edtDeadPhoton);
DDX_Control(pDX, IDC_EDIT_BADRATE, m_edtBadRate);
DDX_Control(pDX, IDC_EDIT_BADPHOTON, m_edtBadPhoton);
DDX_Text(pDX, IDC_EDIT_BADPHOTON, m_strBadPhoton);
DDX_Text(pDX, IDC_EDIT_BADRATE, m_strBadRate);
DDX_Text(pDX, IDC_EDIT_DEADPHOTON1, m_strDeadPhoton);
DDX_Text(pDX, IDC_EDIT_DEADRATE1, m_strDeadRate);
DDX_Text(pDX, IDC_EDIT_GOODPHOTON, m_strGoodPhoton);
DDX_Text(pDX, IDC_EDIT_GOODRATE, m_strGoodRate);
DDX_Text(pDX, IDC_EDIT_LAXIS, m_strLAxis);
DDX_Text(pDX, IDC_EDIT_NUM, m_strNum);
DDX_Text(pDX, IDC_EDIT_SAXIS, m_strSAxis);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPropertyDlg, CDialog)
//{{AFX_MSG_MAP(CPropertyDlg)
ON_WM_CTLCOLOR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPropertyDlg message handlers
BOOL CPropertyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hpptIcon, true);
if(!bIsCreated)
{
brush.CreateSolidBrush(GetSysColor(COLOR_MENU));
bIsCreated=true;
}
return TRUE;
}
void CPropertyDlg::DispData(CString strNum,CString strLAxis,CString strSAxis,CString strGoodPhoton,CString strGoodRate,CString strBadPhoton,CString strBadRate,CString strDeadPhoton,CString strDeadRate)
{
m_strNum=strNum;
m_strLAxis=strLAxis;
m_strSAxis=strSAxis;
m_strGoodPhoton=strGoodPhoton;
m_strGoodRate=strGoodRate;
m_strBadPhoton=strBadPhoton;
m_strBadRate=strBadRate;
m_strDeadPhoton=strDeadPhoton;
m_strDeadRate=strDeadRate;
}
HBRUSH CPropertyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
//序号
if(pWnd->m_hWnd==m_edtNum.m_hWnd)
{
pDC->SetTextColor(RGB(0,0,255));
pDC->SetBkColor(GetSysColor(COLOR_MENU));
return (HBRUSH)brush;
}
//长半轴
if(pWnd->m_hWnd==m_edtLAxis.m_hWnd)
{
pDC->SetTextColor(RGB(0,0,255));
pDC->SetBkColor(GetSysColor(COLOR_MENU));
return (HBRUSH)brush;
}
//短半轴
if(pWnd->m_hWnd==m_edtSAxis.m_hWnd)
{
pDC->SetTextColor(RGB(0,0,255));
pDC->SetBkColor(GetSysColor(COLOR_MENU));
return (HBRUSH)brush;
}
//好光子数
if(pWnd->m_hWnd==m_edtGoodPhoton.m_hWnd)
{
pDC->SetTextColor(RGB(0,0,255));
pDC->SetBkColor(GetSysColor(COLOR_MENU));
return (HBRUSH)brush;
}
//坏光子数
if(pWnd->m_hWnd==m_edtBadPhoton.m_hWnd)
{
pDC->SetTextColor(RGB(0,0,255));
pDC->SetBkColor(GetSysColor(COLOR_MENU));
return (HBRUSH)brush;
}
//死光子数
if(pWnd->m_hWnd==m_edtDeadPhoton.m_hWnd)
{
pDC->SetTextColor(RGB(0,0,255));
pDC->SetBkColor(GetSysColor(COLOR_MENU));
return (HBRUSH)brush;
}
//好光子率
if(pWnd->m_hWnd==m_edtGoodRate.m_hWnd)
{
pDC->SetTextColor(RGB(0,0,255));
pDC->SetBkColor(GetSysColor(COLOR_MENU));
return (HBRUSH)brush;
}
//坏光子率
if(pWnd->m_hWnd==m_edtBadRate.m_hWnd)
{
pDC->SetTextColor(RGB(0,0,255));
pDC->SetBkColor(GetSysColor(COLOR_MENU));
return (HBRUSH)brush;
}
//死光子率
if(pWnd->m_hWnd==m_edtDeadRate.m_hWnd)
{
pDC->SetTextColor(RGB(0,0,255));
pDC->SetBkColor(GetSysColor(COLOR_MENU));
return (HBRUSH)brush;
}
if(pWnd->m_hWnd==GetDlgItem(IDC_STATIC_TIP)->m_hWnd)
{
pDC->SetTextColor(RGB(0,0,255));
return (HBRUSH)brush;
}
// TODO: Return a different brush if the default is not desired
return hbr;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -