107 lines
2.5 KiB
C++
107 lines
2.5 KiB
C++
|
|
|||
|
// InputDlg.cpp : <20><><EFBFBD>@<40><>
|
|||
|
//
|
|||
|
|
|||
|
|
|||
|
#include "stdafx.h"
|
|||
|
#include "TestSimulator.h"
|
|||
|
#include "InputDlg.h"
|
|||
|
#include "afxdialogex.h"
|
|||
|
|
|||
|
|
|||
|
#ifdef _DEBUG
|
|||
|
#define new DEBUG_NEW
|
|||
|
#endif
|
|||
|
|
|||
|
#define NO_INPUT_FLAG -12 //<2F><><EFBFBD>s<EFBFBD>b<EFBFBD><62><EFBFBD>J<EFBFBD>i<EFBFBD><69>
|
|||
|
|
|||
|
#define ZERO 0 //FALSE flag
|
|||
|
#define ONE 1 //TRUE flag
|
|||
|
#define SIN 2 //Sin flag
|
|||
|
#define COS 3 //Cos flag
|
|||
|
|
|||
|
|
|||
|
CInputDlg::CInputDlg (CWnd* pParent)
|
|||
|
: CDialogEx (CInputDlg::IDD, pParent)
|
|||
|
{
|
|||
|
m_hIcon = AfxGetApp ()->LoadIcon (IDR_MAINFRAME);
|
|||
|
m_iInputFlag = NO_INPUT_FLAG; //<2F><><EFBFBD>l<EFBFBD>ƿ<EFBFBD><C6BF>J<EFBFBD>i<EFBFBD><69>flag
|
|||
|
}
|
|||
|
|
|||
|
CInputDlg::~CInputDlg ()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
BEGIN_MESSAGE_MAP (CInputDlg, CDialogEx)
|
|||
|
ON_BN_CLICKED(IDC_BUTTON_TRUE, &CInputDlg::OnBnClickedButtonTrue)
|
|||
|
ON_BN_CLICKED(IDC_BUTTON_FALSE, &CInputDlg::OnBnClickedButtonFalse)
|
|||
|
ON_BN_CLICKED(IDC_BUTTON_SIN, &CInputDlg::OnBnClickedButtonSin)
|
|||
|
ON_BN_CLICKED(IDC_BUTTON_COS, &CInputDlg::OnBnClickedButtonCos)
|
|||
|
END_MESSAGE_MAP ()
|
|||
|
|
|||
|
void CInputDlg::DoDataExchange (CDataExchange* pDX)
|
|||
|
{
|
|||
|
CDialogEx::DoDataExchange (pDX);
|
|||
|
}
|
|||
|
|
|||
|
BOOL CInputDlg::OnInitDialog ()
|
|||
|
{
|
|||
|
CDialogEx::OnInitDialog ();
|
|||
|
|
|||
|
( (CEdit*) GetDlgItem (IDC_EDIT_INPUT_VALUE))->SetReadOnly ();
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>l<EFBFBD>Ʈ<EFBFBD>Ū<EFBFBD><C5AA><EFBFBD><EFBFBD><EFBFBD>J<EFBFBD>i<EFBFBD><69>flag<61>A<EFBFBD>ñN<C3B1><4E><EFBFBD><EFBFBD><EFBFBD>ܩ<EFBFBD>Edit<69><74>
|
|||
|
switch (m_iInputFlag)
|
|||
|
{
|
|||
|
case ZERO:
|
|||
|
( (CEdit*) GetDlgItem (IDC_EDIT_INPUT_VALUE))->SetWindowTextA (_T ("False"));
|
|||
|
break;
|
|||
|
case ONE:
|
|||
|
( (CEdit*) GetDlgItem (IDC_EDIT_INPUT_VALUE))->SetWindowTextA (_T ("True"));
|
|||
|
break;
|
|||
|
case SIN:
|
|||
|
( (CEdit*) GetDlgItem (IDC_EDIT_INPUT_VALUE))->SetWindowTextA (_T ("Sin (t)"));
|
|||
|
break;
|
|||
|
case COS:
|
|||
|
( (CEdit*) GetDlgItem (IDC_EDIT_INPUT_VALUE))->SetWindowTextA (_T ("Cos (t)"));
|
|||
|
break;
|
|||
|
default:
|
|||
|
( (CEdit*) GetDlgItem (IDC_EDIT_INPUT_VALUE))->SetWindowTextA (_T ("Please select input"));
|
|||
|
}
|
|||
|
|
|||
|
return TRUE;
|
|||
|
}
|
|||
|
|
|||
|
int CInputDlg::GetInputFlag () const
|
|||
|
{
|
|||
|
return m_iInputFlag;
|
|||
|
}
|
|||
|
|
|||
|
void CInputDlg::SetInputFlag (int iInputFlag)
|
|||
|
{
|
|||
|
m_iInputFlag = iInputFlag;
|
|||
|
}
|
|||
|
|
|||
|
void CInputDlg::OnBnClickedButtonTrue ()
|
|||
|
{
|
|||
|
m_iInputFlag = ONE; //<2F><><EFBFBD>UTrue<75><65><EFBFBD>]<5D>w<EFBFBD><77><EFBFBD>J<EFBFBD>i<EFBFBD><69>flag<61><67>ONE
|
|||
|
( (CEdit*) GetDlgItem (IDC_EDIT_INPUT_VALUE))->SetWindowTextA (_T ("True"));
|
|||
|
}
|
|||
|
|
|||
|
void CInputDlg::OnBnClickedButtonFalse ()
|
|||
|
{
|
|||
|
m_iInputFlag = ZERO; //<2F><><EFBFBD>UFalse<73><65><EFBFBD>]<5D>w<EFBFBD><77><EFBFBD>J<EFBFBD>i<EFBFBD><69>flag<61><67>ZERO
|
|||
|
( (CEdit*) GetDlgItem (IDC_EDIT_INPUT_VALUE))->SetWindowTextA (_T ("False"));
|
|||
|
}
|
|||
|
|
|||
|
void CInputDlg::OnBnClickedButtonSin ()
|
|||
|
{
|
|||
|
m_iInputFlag = SIN; //<2F><><EFBFBD>USin<69><6E><EFBFBD>]<5D>w<EFBFBD><77><EFBFBD>J<EFBFBD>i<EFBFBD><69>flag<61><67>SIN
|
|||
|
( (CEdit*) GetDlgItem (IDC_EDIT_INPUT_VALUE))->SetWindowTextA (_T ("Sin (t)"));
|
|||
|
}
|
|||
|
|
|||
|
void CInputDlg::OnBnClickedButtonCos ()
|
|||
|
{
|
|||
|
m_iInputFlag = COS; //<2F><><EFBFBD>UCos<6F><73><EFBFBD>]<5D>w<EFBFBD><77><EFBFBD>J<EFBFBD>i<EFBFBD><69>flag<61><67>COS
|
|||
|
( (CEdit*) GetDlgItem (IDC_EDIT_INPUT_VALUE))->SetWindowTextA (_T ("Cos (t)"));
|
|||
|
}
|