傻大方


首页 > 学习 >

河北|河北工业大学离散数学综合实验一( 二 )

傻大方摘要:【河北|河北工业大学离散数学综合实验一( 二 )|工业大学|离散数学|综合|实验】CRect rect; GetClientRect( int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; / Draw the icondc.DrawIcon(x, y, m_hIcon); elseCDialog:OnPaint(); / The system calls this...



按关键词阅读: 工业大学 河北 实验 综合 离散数学


CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
/ Draw the icondc.DrawIcon(x, y, m_hIcon);
elseCDialog:OnPaint();
/ The system calls this to obtain the cursor to display while the user drags/。

15、the minimized window.HCURSOR CCaaDlg:OnQueryDragIcon()return (HCURSOR) m_hIcon;
HBRUSH CCaaDlg:OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) /HBRUSH hbr = CDialog:OnCtlColor(pDC, pWnd, nCtlColor);
/ TODO: Change any attributes of the DC here/ TODO: Return a different brush if the default is not des 。

16、iredreturn m_brush;
/*/*输入模块*/void CCaaDlg:OnOperandInput(int a) /处理0-9 数字的输入函数 if (m_errorState != ErrNone) /判断当前运算是否有误 , 若有则返回return;
if (!m_bOperandAvail) /判断是否输入新的数字 , 1-是0-否m_operand = 0;
if(!m_bCoff) /判断是否是小数输入 , 1-是0-否m_operand=m_operand*10+(a);
else m_operand=m_operand+(a)*m_coff;
m_coff*=0.1f;
m_b 。

17、OperandAvail=TRUE;
UpdateDisplay();
/更新显示 /*计算处理模块*/void CCaaDlg:Calculate() /处理计算函数 if (m_errorState != ErrNone) return;
if (m_bOperandAvail) /如果没有计算符就将m_operand值赋予m_accum if (m_operator = OpNone) m_accum = m_operand;
else if (m_operator = OpMultiply) /否则按计算符进行计算m_accum *= m_operand;
else if (m_ope 。

18、rator = OpDivide) if (m_operand = 0) m_errorState = ErrDivideByZero;
else m_accum /= m_operand;
else if (m_operator = OpAdd) m_accum += m_operand;
else if (m_operator = OpSubtract) m_accum -= m_operand;
m_bOperandAvail = FALSE;
m_bCoff=0;
m_coff=0.1f;
UpdateDisplay();
/*显示模块*/void CCaaDlg:UpdateDisp 。

19、lay() /处理显示函数 if (GetSafeHwnd() = NULL) return;
if (m_errorState != ErrNone) m_result=除数不能为零;
else /如果当前计算无错误那么进行显示 /如果是输入计算数 , 那么显示输入情况 , 如果按下计算符 , 则显示结果float lVal = (m_bOperandAvail) ? m_operand : m_accum;
m_result.Format(_T(%f), lVal);
/将float型转化为CString型int i=m_result.GetLength();
while(m_result.GetAt( 。

20、i-1)=0) m_result.Delete(i-1,1);
i-=1;
/用编辑控件变量m_result改变编辑控件的值 , 更新显示UpdateData(FALSE);
/*/ The system calls this to obtain the cursor to display while the user drags/ the minimized window.void CCaaDlg:Ondengyu() / TODO: Add your control notification handler code hereCalculate();
m_operator = OpNone;
vo 。

21、id CCaaDlg:On0() / TODO: Add your control notification handler code hereOnOperandInput(0);
void CCaaDlg:On1() / TODO: Add your control notification handler code hereOnOperandInput(1);
void CCaaDlg:On2() / TODO: Add your control notification handler code hereOnOperandInput(2);
void CCaaDlg:On3() / TOD 。

22、O: Add your control notification handler code hereOnOperandInput(3);
void CCaaDlg:On4() / TODO: Add your control notification handler code hereOnOperandInput(4);
void CCaaDlg:On5() / TODO: Add your control notification handler code hereOnOperandInput(5);
void CCaaDlg:On6() / TODO: Add your control noti 。

23、fication handler code hereOnOperandInput(6);
void CCaaDlg:On7() / TODO: Add your control notification handler code hereOnOperandInput(7);
void CCaaDlg:On8() / TODO: Add your control notification handler code hereOnOperandInput(8);
void CCaaDlg:On9() / TODO: Add your control notification handler code he 。

24、reOnOperandInput(9);
void CCaaDlg:Oncheng() / TODO: Add your control notification handler code hereCalculate();
m_operator = OpMultiply;
void CCaaDlg:Onchu() / TODO: Add your control notification handler code herCalculate();
m_operator = OpDivide;
void CCaaDlg:Onjia() / TODO: Add your control notificati 。

25、on handler code hereCalculate();
m_operator = OpAdd;
void CCaaDlg:Onjian() / TODO: Add your control notification handler code hereCalculate();
m_operator = OpSubtract;
void CCaaDlg:Ondian() / TODO: Add your control notification handler code herem_bCoff=1;
UpdateDisplay();
void CCaaDlg:Onclear() / TODO 。

26、: Add your control notification handler code here m_coff=0.1f;
/为变量进行还原m_bCoff=0;
/为变量进行还原m_errorState = ErrNone;
/为变量进行还原m_bOperandAvail=FALSE;
/为变量进行还原m_operator=OpNone;
m_accum=0;
m_operand=0;
Calculate();
m_operator = OpNone;
UpdateData(FALSE);
void CCaaDlg:Onhongse() / TODO: Add your control notifi 。

27、cation handler code here m_brush.DeleteObject();
Invalidate();
m = 220;
n = 20;
k = 60;
m_brush.CreateSolidBrush(RGB(m, n, k);
UpdateWindow();


稿源:(未知)

【傻大方】网址:/a/2021/0621/0022536789.html

标题:河北|河北工业大学离散数学综合实验一( 二 )


上一篇:外汇|外汇管理工作总结

下一篇:公路|公路梁桥体外预应力加固设计方法