基于MFC的面向?qū)ο蠖喙δ苡?jì)算器設(shè)計(jì)_第1頁(yè)
基于MFC的面向?qū)ο蠖喙δ苡?jì)算器設(shè)計(jì)_第2頁(yè)
基于MFC的面向?qū)ο蠖喙δ苡?jì)算器設(shè)計(jì)_第3頁(yè)
基于MFC的面向?qū)ο蠖喙δ苡?jì)算器設(shè)計(jì)_第4頁(yè)
基于MFC的面向?qū)ο蠖喙δ苡?jì)算器設(shè)計(jì)_第5頁(yè)
已閱讀5頁(yè),還剩31頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、基于MFC的面向?qū)ο蠖喙δ苡?jì)算器設(shè)計(jì)一、需求分析1、設(shè)計(jì)背景計(jì)算器是日常生活中十分便捷有效的工具,計(jì)算器大大的降低了數(shù)字計(jì)算的難度及提高了計(jì)算的準(zhǔn)確度和精確度。但是目前很多計(jì)算器的功能過于簡(jiǎn)單化,精確度也不高。本次設(shè)計(jì)的基于MFC的VC+面向?qū)ο蠖喙δ苡?jì)算器,實(shí)現(xiàn)了功能的多樣化,使用非常簡(jiǎn)單和方便,增加了使用者的選擇性,應(yīng)用范圍大為提高,更加符合現(xiàn)在社會(huì)使用者的要求。2、計(jì)算器功能系統(tǒng)具有良好的界面;必要的交互信息;簡(jiǎn)約美觀的效果。使用人員能快捷簡(jiǎn)單地進(jìn)行操作。即可單機(jī)按鈕進(jìn)行操作,也可直接通過鍵盤直接輸入。即時(shí)準(zhǔn)確地獲得需要的計(jì)算的結(jié)果,充分降低了數(shù)字計(jì)算的難度和節(jié)約了時(shí)間.該計(jì)算器不但功能

2、上比一般的計(jì)算器多很多,而且精度上也提高了不少。根據(jù)目前的背景分析所知道的社會(huì)需求以及本人平時(shí)在課堂上蔣老師所講的知識(shí),參考相關(guān)資料,本次設(shè)計(jì)所實(shí)現(xiàn)的功能:1) 一般計(jì)算機(jī)所具有的加、減、乘、除、開方、清零功能2) 進(jìn)行二進(jìn)制、八進(jìn)制、十進(jìn)制、十六進(jìn)制之間的轉(zhuǎn)換3) 有退格功能4) 進(jìn)行度數(shù)和弧度的Sin 、arcSin 、Cos、 arcCos 、Cot 、arcCot 、Tan 、arcTan運(yùn)算5) 進(jìn)行xy x2 x3運(yùn)算6) 進(jìn)行l(wèi)n log運(yùn)算7) 輸出結(jié)果的精確度為小數(shù)點(diǎn)后六位8) 程序可以能自動(dòng)判斷輸入數(shù)據(jù)的正確性和操作數(shù)據(jù)的正確性,若有錯(cuò)去會(huì)提醒。二、概要設(shè)計(jì)1. 設(shè)計(jì)基礎(chǔ)M

3、icrosoft Visual C+提供了利用MFC編寫程序的方法,這大大提高了軟件的開發(fā),提高編程的效率。MFC提供了大量預(yù)定義的類和支持代碼,可以處理許多標(biāo)準(zhǔn)Windows編程任務(wù),如生成窗口和處理消息,加入各種復(fù)雜的特性,如工具欄、OLE支持、Active控件非常的方便和高效。本次軟件即是基于MFC進(jìn)行設(shè)計(jì),基于MFC庫(kù)類進(jìn)行對(duì)對(duì)話框界面的設(shè)計(jì),通過創(chuàng)建類成員函數(shù)成員變量,編輯控件創(chuàng)建消息映射,調(diào)用消息函數(shù)完成數(shù)據(jù)的輸入輸出,實(shí)現(xiàn)計(jì)算功能。使用C+,在VC下進(jìn)行編寫。2. 軟件主體框架 總體設(shè)計(jì)思路流程圖如圖1 圖1 計(jì)算器總體設(shè)計(jì)思路流程圖3、 詳細(xì)設(shè)計(jì)1、程序流程及解釋1.1 圖2為

4、主要關(guān)系圖: 圖2 主要關(guān)系圖1.2功能模塊流程圖舉例1)輸入數(shù)字的流程圖,以輸入數(shù)字1為例(如圖3):圖3 輸入數(shù)字1流程圖2)四則運(yùn)算、x2、x3、xy、取模、log、ln和開方運(yùn)算的流程圖(以開方運(yùn)算為例,如圖4) 圖4 開方運(yùn)算流程圖3)三角函數(shù)運(yùn)算流程圖,以sin運(yùn)算為例,如圖5圖5 sin運(yùn)算流程圖2、函數(shù)模塊#include stdafx.h#include Calculator.h#include CalculatorDlg.h#include math.h #ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic cha

5、r THIS_FILE = _FILE_;#endif #define PI 3.1415926535897932384626433832795/ CAboutDlg dialog 應(yīng)用程序class CAboutDlg : public CDialogpublic:CAboutDlg();enum IDD = IDD_ABOUTBOX ;protected:virtual void DoDataExchange(CDataExchange* pDX);protected:DECLARE_MESSAGE_MAP();CAboutDlg:CAboutDlg() : CDialog(CAboutD

6、lg:IDD) void CAboutDlg:DoDataExchange(CDataExchange* pDX)CDialog:DoDataExchange(pDX); BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)END_MESSAGE_MAP()/ CCalculatorDlg dialog CCalculatorDlg:CCalculatorDlg(CWnd* pParent): CDialog(CCalculatorDlg:IDD, pParent)m_EDIT = _T();temp=_T();op=#;a=b=r=0; first=second=res

7、ult=0;m_hIcon = AfxGetApp()-LoadIcon(IDR_MAINFRAME);void CCalculatorDlg:DoDataExchange(CDataExchange* pDX)CDialog:DoDataExchange(pDX);DDX_Text(pDX, IDC_EDIT1, m_EDIT); BEGIN_MESSAGE_MAP(CCalculatorDlg, CDialog)ON_WM_SYSCOMMAND()ON_WM_PAINT()ON_WM_QUERYDRAGICON()ON_BN_CLICKED(IDC_BUTTON0, OnButton0)O

8、N_BN_CLICKED(IDC_BUTTON1, OnButton1)ON_BN_CLICKED(IDC_BUTTON2, OnButton2)ON_BN_CLICKED(IDC_BUTTON3, OnButton3)ON_BN_CLICKED(IDC_BUTTON4, OnButton4)ON_BN_CLICKED(IDC_BUTTON5, OnButton5)ON_BN_CLICKED(IDC_BUTTON6, OnButton6)ON_BN_CLICKED(IDC_BUTTON7, OnButton7)ON_BN_CLICKED(IDC_BUTTON8, OnButton8)ON_BN

9、_CLICKED(IDC_BUTTON9, OnButton9)ON_BN_CLICKED(IDC_BUTTONA, OnButtona)ON_BN_CLICKED(IDC_BUTTONB, OnButtonb)ON_BN_CLICKED(IDC_BUTTONC, OnButtonc)ON_BN_CLICKED(IDC_BUTTOND, OnButtond)ON_BN_CLICKED(IDC_BUTTONE, OnButtone)ON_BN_CLICKED(IDC_BUTTONF, OnButtonf)ON_BN_CLICKED(IDC_BTN_BACK, OnBtnBack)ON_BN_CL

10、ICKED(IDC_BTN_DOT, OnBtnDot)ON_BN_CLICKED(IDC_BTN_AC, OnBtnAc)ON_BN_CLICKED(IDC_BTN_ADD, OnBtnAdd)ON_BN_CLICKED(IDC_BTN_DECREASE, OnBtnDecrease)ON_BN_CLICKED(IDC_BTN_MULTI, OnBtnMulti)ON_BN_CLICKED(IDC_BTN_DIV, OnBtnDiv)ON_BN_CLICKED(IDC_BTN_EQUAL, OnBtnEqual)ON_BN_CLICKED(IDC_BTN_SIGN, OnBtnSign)ON

11、_BN_CLICKED(IDC_BTN_HEX, OnBtnHex)ON_BN_CLICKED(IDC_BTN_DEC, OnBtnDec)ON_BN_CLICKED(IDC_BTN_OCT, OnBtnOct)ON_BN_CLICKED(IDC_BTN_BIN, OnBtnBin)ON_BN_CLICKED(IDC_BTN_DEGRESS, OnBtnDegress)ON_BN_CLICKED(IDC_BTN_MOD, OnBtnMod)ON_BN_CLICKED(IDC_BTN_SQUARE, OnBtnSquare)ON_BN_CLICKED(IDC_BTN_CUBE, OnBtnCub

12、e)ON_BN_CLICKED(IDC_BTN_RADIANS, OnBtnRadians)ON_BN_CLICKED(IDC_BTN_SIN, OnBtnSin)ON_BN_CLICKED(IDC_BTN_ARCSIN, OnBtnArcsin)ON_BN_CLICKED(IDC_BTN_COS, OnBtnCos)ON_BN_CLICKED(IDC_BTN_ARCCOS, OnBtnArccos)ON_BN_CLICKED(IDC_BTN_TAN, OnBtnTan)ON_BN_CLICKED(IDC_BTN_ARCTAN, OnBtnArctan)ON_BN_CLICKED(IDC_BT

13、N_COT, OnBtnCot)ON_BN_CLICKED(IDC_BTN_ARCCOT, OnBtnArccot)ON_BN_CLICKED(IDC_BTN_XY, OnBtnXy)ON_BN_CLICKED(IDC_BTN_LOG, OnBtnLog)ON_BN_CLICKED(IDC_BTN_LN, OnBtnLn)ON_BN_CLICKED(IDC_BTN_EXT, OnBtnExt)END_MESSAGE_MAP() / CCalculatorDlg 程序運(yùn)行/初始化對(duì)話框BOOL CCalculatorDlg:OnInitDialog()CDialog:OnInitDialog()

14、; / 加上系統(tǒng)項(xiàng)目菜單,IDM_ABOUTBOX 必須在系統(tǒng)控制的范圍。ASSERT(IDM_ABOUTBOX & 0xFFF0) = IDM_ABOUTBOX);ASSERT(IDM_ABOUTBOX AppendMenu(MF_SEPARATOR);pSysMenu-AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); / 此架構(gòu)是自動(dòng)為這個(gè)對(duì)話框設(shè)置圖標(biāo).當(dāng)這個(gè)應(yīng)用主窗口不是一個(gè)對(duì)話框。SetIcon(m_hIcon, TRUE);/ 設(shè)置一個(gè)大圖標(biāo)SetIcon(m_hIcon, FALSE);/ 設(shè)置一個(gè)小圖標(biāo)/ TODO: 在這里增

15、加額外的初始化 form=D; degngra=1;point=false;GetDlgItem(IDC_BUTTONA)-EnableWindow(0);GetDlgItem(IDC_BUTTONB)-EnableWindow(0);GetDlgItem(IDC_BUTTONC)-EnableWindow(0);GetDlgItem(IDC_BUTTOND)-EnableWindow(0);GetDlgItem(IDC_BUTTONE)-EnableWindow(0);GetDlgItem(IDC_BUTTONF)-EnableWindow(0);CheckRadioButton(IDC_B

16、TN_HEX,IDC_BTN_BIN,IDC_BTN_DEC);CheckRadioButton(IDC_BTN_DEGRESS,IDC_BTN_RADIANS,IDC_BTN_DEGRESS);return TRUE; /只要不設(shè)置控制就返回 TRUE void CCalculatorDlg:OnSysCommand(UINT nID, LPARAM lParam)if (nID & 0xFFF0) = IDM_ABOUTBOX)CAboutDlg dlgAbout;dlgAbout.DoModal();elseCDialog:OnSysCommand(nID, lParam); / 如果增

17、加一個(gè)小按鈕到對(duì)話框,需要下面的代碼繪制圖標(biāo)。void CCalculatorDlg:OnPaint() if (IsIconic()CPaintDC dc(this); / 設(shè)置上下文的繪制圖表SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);/ 圖標(biāo)設(shè)置成長(zhǎng)方形int cxIcon = GetSystemMetrics(SM_CXICON);int cyIcon = GetSystemMetrics(SM_CYICON);CRect rect;GetClientRect(&rect);int x = (rect.Widt

18、h() - cxIcon + 1) / 2;int y = (rect.Height() - cyIcon + 1) / 2;/ 繪制圖標(biāo)dc.DrawIcon(x, y, m_hIcon);elseCDialog:OnPaint(); / 系統(tǒng)調(diào)用該鼠標(biāo)顯示當(dāng)用戶拖動(dòng)最小化窗口。HCURSOR CCalculatorDlg:OnQueryDragIcon()return (HCURSOR) m_hIcon;/控件觸發(fā)void CCalculatorDlg:OnButton0() / TODO: 0鍵m_EDIT=m_EDIT+0;SetDlgItemText(IDC_EDIT1,m_EDIT

19、); void CCalculatorDlg:OnButton1() / TODO:1鍵m_EDIT=m_EDIT+1;SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnButton2() / TODO: 2鍵m_EDIT=m_EDIT+2;SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnButton3() / TODO:3鍵m_EDIT=m_EDIT+3;SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnButt

20、on4() / TODO:4鍵m_EDIT=m_EDIT+4;SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnButton5() / TODO:5鍵m_EDIT=m_EDIT+5;SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnButton6() / TODO:6鍵m_EDIT=m_EDIT+6;SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnButton7() / TODO:7鍵m_EDIT=m_EDIT+7

21、;SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnButton8() / TODO:8鍵m_EDIT=m_EDIT+8;SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnButton9() / TODO:9鍵m_EDIT=m_EDIT+9;SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnButtona() / TODO:A鍵m_EDIT=m_EDIT+A;SetDlgItemText(IDC_EDIT1,m_ED

22、IT);void CCalculatorDlg:OnButtonb() / TODO:B鍵m_EDIT=m_EDIT+B;SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnButtonc() / TODO:C鍵m_EDIT=m_EDIT+C;SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnButtond() / TODO:D鍵m_EDIT=m_EDIT+D;SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnButt

23、one() / TODO:E鍵m_EDIT=m_EDIT+E;SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnButtonf() / TODO:F鍵m_EDIT=m_EDIT+F;SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnBtnBack() / TODO: 退格m_EDIT=m_EDIT.Left(m_EDIT.GetLength()-1);SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnBtnDot()

24、 / TODO: 取-if(point=false)m_EDIT=m_EDIT+.; SetDlgItemText(IDC_EDIT1,m_EDIT);point=true;void CCalculatorDlg:OnBtnAc() / TODO: 取+m_EDIT=_T();point=false;SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnBtnAdd() / TODO: 加法temp=m_EDIT;op=+;m_EDIT=_T();point=false;void CCalculatorDlg:OnBtnDecrease(

25、) / TODO: 減法temp=m_EDIT;op=-;m_EDIT=_T();point=false;void CCalculatorDlg:OnBtnMulti() / TODO: 乘法temp=m_EDIT;op=*;m_EDIT=_T();point=false;void CCalculatorDlg:OnBtnDiv() / TODO: 除法temp=m_EDIT;op=/;m_EDIT=_T();point=false;void CCalculatorDlg:OnBtnEqual() / TODO: 等于char c50;switch(form)case H:first=_tcs

26、toul(temp, 0, 16); second=_tcstoul(m_EDIT, 0, 16); switch (op) case %: if(second=0) MessageBox(第二個(gè)操作數(shù)不能為0!,ERROR!); m_EDIT=_T(); point=false; else result=first%second; m_EDIT.Format(%d,result); break; case +: result=first+second; m_EDIT.Format(%X,result); break; case -: result=first-second; m_EDIT.F

27、ormat(%X,result); break; case *: result=first*second; m_EDIT.Format(%X,result); break; case /: if(second=0) MessageBox(除數(shù)不能為0!,ERROR!); m_EDIT=_T(); point=false; else result=first/second; m_EDIT.Format(%X,result); break; default: return; op=#; SetDlgItemText(IDC_EDIT1,m_EDIT); break;case D: first=_t

28、cstoul(temp, 0, 10); second=_tcstoul(m_EDIT, 0, 10); a = atof(LPCTSTR)temp); b = atof(LPCTSTR)m_EDIT); switch (op) case : r=pow(a,b); m_EDIT.Format(%f,r); break; case %: if(second=0) MessageBox(第二個(gè)操作數(shù)不能為0!,ERROR!); m_EDIT=_T(); point=false; else result=first%second; m_EDIT.Format(%d,result); break;

29、case +: r=a+b; m_EDIT.Format(%f,r); break; case -: r=a-b; m_EDIT.Format(%f,r); break; case *: r=a*b; m_EDIT.Format(%f,r); break; case /:if(b=0) MessageBox(除數(shù)不能為0!,ERROR!); m_EDIT=_T(); point=false; else r=a/b; m_EDIT.Format(%f,r); break; default: return; op=#; point=true; SetDlgItemText(IDC_EDIT1,m_

30、EDIT); break;case O:first=_tcstoul(temp, 0, 8); second=_tcstoul(m_EDIT, 0, 8); switch (op) case : result=pow(first,second); m_EDIT.Format(%o,result); break; case %: if(second=0) MessageBox(第二個(gè)操作數(shù)不能為0!,ERROR!); m_EDIT=_T(); point=false; else result=first%second; m_EDIT.Format(%d,result); break; case

31、+: result=first+second; m_EDIT.Format(%o,result); break; case -: result=first-second; m_EDIT.Format(%o,result); break; case *: result=first*second; m_EDIT.Format(%o,result); break; case /: if(second=0) MessageBox(除數(shù)不能為0!,ERROR!); m_EDIT=_T(); point=false; else result=first/second; m_EDIT.Format(%o,r

32、esult); break; default: return; op=#; SetDlgItemText(IDC_EDIT1,m_EDIT); break;case B: first=_tcstoul(temp, 0, 2); second=_tcstoul(m_EDIT, 0, 2); switch (op) case : result=pow(first,second); itoa(result,c,2); m_EDIT.Format(%s,c); break; case %: if(second=0) MessageBox(第二個(gè)操作數(shù)不能為0!,ERROR!); m_EDIT=_T()

33、; point=false; else result=first%second; itoa(result,c,2); m_EDIT.Format(%s,c); break; case +: result=first+second; itoa(result,c,2); m_EDIT.Format(%s,c); break; case -: result=first-second; itoa(result,c,2); m_EDIT.Format(%s,c); break; case *: result=first*second; itoa(result,c,2); m_EDIT.Format(%s

34、,c); break; case /:if(second=0) MessageBox(除數(shù)不能為0!,ERROR!); m_EDIT=_T(); point=false; else result=first/second; itoa(result,c,2); m_EDIT.Format(%s,c); break; default: return; op=#; SetDlgItemText(IDC_EDIT1,m_EDIT); break;default:return;void CCalculatorDlg:OnBtnSign() double tmp;tmp=(double)atof(m_ED

35、IT);tmp*=-1;m_EDIT.Format(%g,tmp);SetDlgItemText(IDC_EDIT1,m_EDIT);void CCalculatorDlg:OnBtnHex() /十六進(jìn)制GetDlgItem(IDC_BUTTON0)-EnableWindow(1);GetDlgItem(IDC_BUTTON1)-EnableWindow(1);GetDlgItem(IDC_BUTTON2)-EnableWindow(1);GetDlgItem(IDC_BUTTON3)-EnableWindow(1);GetDlgItem(IDC_BUTTON4)-EnableWindow(

36、1);GetDlgItem(IDC_BUTTON5)-EnableWindow(1);GetDlgItem(IDC_BUTTON6)-EnableWindow(1);GetDlgItem(IDC_BUTTON7)-EnableWindow(1);GetDlgItem(IDC_BUTTON8)-EnableWindow(1);GetDlgItem(IDC_BUTTON9)-EnableWindow(1);GetDlgItem(IDC_BUTTONA)-EnableWindow(1);GetDlgItem(IDC_BUTTONB)-EnableWindow(1);GetDlgItem(IDC_BU

37、TTONC)-EnableWindow(1);GetDlgItem(IDC_BUTTOND)-EnableWindow(1);GetDlgItem(IDC_BUTTONE)-EnableWindow(1);GetDlgItem(IDC_BUTTONF)-EnableWindow(1);GetDlgItem(IDC_BTN_DOT)-EnableWindow(0);GetDlgItem(IDC_BTN_DEGRESS)-EnableWindow(0);GetDlgItem(IDC_BTN_RADIANS)-EnableWindow(0);GetDlgItem(IDC_BTN_SIN)-Enabl

38、eWindow(0);GetDlgItem(IDC_BTN_ARCSIN)-EnableWindow(0);GetDlgItem(IDC_BTN_COS)-EnableWindow(0);GetDlgItem(IDC_BTN_ARCCOS)-EnableWindow(0);GetDlgItem(IDC_BTN_TAN)-EnableWindow(0);GetDlgItem(IDC_BTN_ARCTAN)-EnableWindow(0);GetDlgItem(IDC_BTN_COT)-EnableWindow(0);GetDlgItem(IDC_BTN_ARCCOT)-EnableWindow(

39、0);if(atof(LPCTSTR)m_EDIT)!=0)switch(form) case D: m_EDIT.Format(%X,_tcstoul(m_EDIT, 0, 10); break; case O: m_EDIT.Format(%X,_tcstoul(m_EDIT, 0, 8); break; case B: m_EDIT.Format(%X,_tcstoul(m_EDIT, 0, 2); break; default: return; SetDlgItemText(IDC_EDIT1,m_EDIT);else m_EDIT=_T();SetDlgItemText(IDC_ED

40、IT1,m_EDIT);form=H;void CCalculatorDlg:OnBtnDec() /十進(jìn)制GetDlgItem(IDC_BUTTONA)-EnableWindow(0);GetDlgItem(IDC_BUTTONB)-EnableWindow(0);GetDlgItem(IDC_BUTTONC)-EnableWindow(0);GetDlgItem(IDC_BUTTOND)-EnableWindow(0);GetDlgItem(IDC_BUTTONE)-EnableWindow(0);GetDlgItem(IDC_BUTTONF)-EnableWindow(0);GetDlg

41、Item(IDC_BUTTON0)-EnableWindow(1);GetDlgItem(IDC_BUTTON1)-EnableWindow(1);GetDlgItem(IDC_BUTTON2)-EnableWindow(1);GetDlgItem(IDC_BUTTON3)-EnableWindow(1);GetDlgItem(IDC_BUTTON4)-EnableWindow(1);GetDlgItem(IDC_BUTTON5)-EnableWindow(1);GetDlgItem(IDC_BUTTON6)-EnableWindow(1);GetDlgItem(IDC_BUTTON7)-En

42、ableWindow(1);GetDlgItem(IDC_BUTTON8)-EnableWindow(1);GetDlgItem(IDC_BUTTON9)-EnableWindow(1);GetDlgItem(IDC_BTN_DOT)-EnableWindow(1);GetDlgItem(IDC_BTN_SIN)-EnableWindow(1);GetDlgItem(IDC_BTN_ARCSIN)-EnableWindow(1);GetDlgItem(IDC_BTN_COS)-EnableWindow(1);GetDlgItem(IDC_BTN_ARCCOS)-EnableWindow(1);

43、GetDlgItem(IDC_BTN_TAN)-EnableWindow(1);GetDlgItem(IDC_BTN_ARCTAN)-EnableWindow(1);GetDlgItem(IDC_BTN_COT)-EnableWindow(1);GetDlgItem(IDC_BTN_ARCCOT)-EnableWindow(1);GetDlgItem(IDC_BTN_DEGRESS)-EnableWindow(1);GetDlgItem(IDC_BTN_RADIANS)-EnableWindow(1);if(_tcstoul(m_EDIT, 0, 16)!=0) switch(form) ca

44、se H: m_EDIT.Format(%d,_tcstoul(m_EDIT, 0, 16); break; case O: m_EDIT.Format(%d,_tcstoul(m_EDIT, 0, 8); break; case B: m_EDIT.Format(%d,_tcstoul(m_EDIT, 0, 2); break; default: return; SetDlgItemText(IDC_EDIT1,m_EDIT);else m_EDIT=_T();SetDlgItemText(IDC_EDIT1,m_EDIT);point=false;form=D;void CCalculat

45、orDlg:OnBtnOct() /八進(jìn)制GetDlgItem(IDC_BUTTON0)-EnableWindow(1);GetDlgItem(IDC_BUTTON1)-EnableWindow(1);GetDlgItem(IDC_BUTTON2)-EnableWindow(1);GetDlgItem(IDC_BUTTON3)-EnableWindow(1);GetDlgItem(IDC_BUTTON4)-EnableWindow(1);GetDlgItem(IDC_BUTTON5)-EnableWindow(1);GetDlgItem(IDC_BUTTON6)-EnableWindow(1)

46、;GetDlgItem(IDC_BUTTON7)-EnableWindow(1);GetDlgItem(IDC_BUTTON8)-EnableWindow(0);GetDlgItem(IDC_BUTTON9)-EnableWindow(0);GetDlgItem(IDC_BUTTONA)-EnableWindow(0);GetDlgItem(IDC_BUTTONB)-EnableWindow(0);GetDlgItem(IDC_BUTTONC)-EnableWindow(0);GetDlgItem(IDC_BUTTOND)-EnableWindow(0);GetDlgItem(IDC_BUTTONE)-EnableWindow(0);GetDlgItem(IDC_BUTTONF)-EnableWindow(0);GetDlgItem(IDC_BTN_DOT)-EnableWindow(0);GetDlgItem(IDC_BTN_DEGRESS)-EnableWindow(0);GetDlgItem(IDC_BTN_RADIANS)-EnableWindow(0);GetDl

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論