📄 parameter.cpp
字号:
// Parameter.cpp : implementation file
//
#include "stdafx.h"
#include "FilmDesign.h"
#include "Parameter.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CParameter dialog
CParameter::CParameter(CWnd* pParent /*=NULL*/)
: CDialog(CParameter::IDD, pParent)
{
//{{AFX_DATA_INIT(CParameter)
m_Angle = 0.0;
m_WaveLength = 450.0;
m_Show = _T("参考波长(nm)");
m_VibrateKind=1;
m_InN = 0.0;
//}}AFX_DATA_INIT
m_Selected=0;
}
void CParameter::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CParameter)
DDX_Control(pDX, IDC_LIST_NAME, m_ListPictureSelect);
DDX_Text(pDX, IDC_EDIT_IN_ANGLE, m_Angle);
DDV_MinMaxDouble(pDX, m_Angle, 0., 90.);
DDX_Text(pDX, IDC_EDIT_WAVELENGTH, m_WaveLength);
DDX_Text(pDX, IDC_STATE_WAVELENGTH, m_Show);
DDX_Text(pDX, IDC_EDIT_IN_N, m_InN);
DDV_MinMaxDouble(pDX, m_InN, 0., 10.);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CParameter, CDialog)
//{{AFX_MSG_MAP(CParameter)
ON_BN_CLICKED(IDC_RADIO_S, OnRadioS)
ON_BN_CLICKED(IDC_RADIO_P, OnRadioP)
ON_BN_CLICKED(IDC_RADIO_AVERAGE, OnRadioAverage)
ON_LBN_SELCHANGE(IDC_LIST_NAME, OnSelchangeListName)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CParameter message handlers
BOOL CParameter::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
//CFilmDesignApp * app=(CFilmDesignApp*)AfxGetApp();
this->m_ListPictureSelect.AddString("Reflectance(%)");
this->m_ListPictureSelect.AddString("Transistance(%)");
this->m_ListPictureSelect.AddString("Absorption(%)");
this->m_ListPictureSelect.SetCurSel(1);
//this->m_ListPictureSelect.SelectString(0,"Reflectance(%)");
//this->m_Combo_Name.AddString("Transistance(%)");
//this->m_Combo_Name.AddString("Absorption(%)");
//this->m_Combo_Name.SetCurSel(1);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CParameter::OnRadioS()
{
// TODO: Add your control notification handler code here
this->m_VibrateKind=1;
}
void CParameter::OnRadioP()
{
// TODO: Add your control notification handler code here
this->m_VibrateKind=2;
}
void CParameter::OnRadioAverage()
{
// TODO: Add your control notification handler code here
this->m_VibrateKind=3;
}
void CParameter::OnOK()
{
// TODO: Add extra validation here
UpdateData(true);
CDialog::OnOK();
}
void CParameter::OnDropdownComboName()
{
// TODO: Add your control notification handler code here
}
void CParameter::OnSelchangeListName()
{
// TODO: Add your control notification handler code here
m_Selected=this->m_ListPictureSelect.GetCurSel();
CString str;
m_ListPictureSelect.GetText(m_Selected,str);
if(str=="Reflectance(%)") m_Selected=1;
if(str=="Transistance(%)") m_Selected=2;
if(str=="Absorption(%)") m_Selected=3;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -