下载

1下载券

加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 界面

界面.doc

界面

璇寳寳
2011-05-18 0人阅读 举报 0 0 0 暂无简介

简介:本文档为《界面doc》,可适用于高等教育领域

CharStatisticDlgcpp:implementationfile#include"stdafxh"#include"CharStatistich"#include"CharStatisticDlgh"#ifdefDEBUG#definenewDEBUGNEW#undefTHISFILEstaticcharTHISFILE=FILE#endifCAboutDlgdialogusedforAppAboutclassCAboutDlg:publicCDialog{public:CAboutDlg()DialogData{{AFXDATA(CAboutDlg)enum{IDD=IDDABOUTBOX}}}AFXDATAClassWizardgeneratedvirtualfunctionoverrides{{AFXVIRTUAL(CAboutDlg)protected:virtualvoidDoDataExchange(CDataExchange*pDX)DDXDDVsupport}}AFXVIRTUALImplementationprotected:{{AFXMSG(CAboutDlg)}}AFXMSGDECLAREMESSAGEMAP()}CAboutDlg::CAboutDlg():CDialog(CAboutDlg::IDD){{{AFXDATAINIT(CAboutDlg)}}AFXDATAINIT}voidCAboutDlg::DoDataExchange(CDataExchange*pDX){CDialog::DoDataExchange(pDX){{AFXDATAMAP(CAboutDlg)}}AFXDATAMAP}BEGINMESSAGEMAP(CAboutDlg,CDialog){{AFXMSGMAP(CAboutDlg)Nomessagehandlers}}AFXMSGMAPENDMESSAGEMAP()CCharStatisticDlgdialogCCharStatisticDlg::CCharStatisticDlg(CWnd*pParent*=*):CDialog(CCharStatisticDlg::IDD,pParent){{{AFXDATAINIT(CCharStatisticDlg)mstrTxt=T("")mstrfifth=T("")mstrfinalshuchu=T("")mstrlocation=T("")mstrtotal=T("")mstrchangdu=T("")}}AFXDATAINITNotethatLoadIcondoesnotrequireasubsequentDestroyIconinWinmhIcon=AfxGetApp()>LoadIcon(IDRMAINFRAME)}voidCCharStatisticDlg::DoDataExchange(CDataExchange*pDX){CDialog::DoDataExchange(pDX){{AFXDATAMAP(CCharStatisticDlg)DDXText(pDX,IDCEDIT,mstrTxt)DDXText(pDX,IDCfifth,mstrfifth)DDXText(pDX,IDCfinalshuchu,mstrfinalshuchu)DDXText(pDX,IDClocation,mstrlocation)DDXText(pDX,IDCtotal,mstrtotal)DDXText(pDX,IDCchangdu,mstrchangdu)}}AFXDATAMAP}BEGINMESSAGEMAP(CCharStatisticDlg,CDialog){{AFXMSGMAP(CCharStatisticDlg)ONWMSYSCOMMAND()ONWMPAINT()ONWMQUERYDRAGICON()ONBNCLICKED(IDOK,OnStatistic)}}AFXMSGMAPENDMESSAGEMAP()CCharStatisticDlgmessagehandlersBOOLCCharStatisticDlg::OnInitDialog(){CDialog::OnInitDialog()Add"About"menuitemtosystemmenuIDMABOUTBOXmustbeinthesystemcommandrangeASSERT((IDMABOUTBOXxFFF)==IDMABOUTBOX)ASSERT(IDMABOUTBOX<xF)CMenu*pSysMenu=GetSystemMenu(FALSE)if(pSysMenu!=){CStringstrAboutMenustrAboutMenuLoadString(IDSABOUTBOX)if(!strAboutMenuIsEmpty()){pSysMenu>AppendMenu(MFSEPARATOR)pSysMenu>AppendMenu(MFSTRING,IDMABOUTBOX,strAboutMenu)}}SettheiconforthisdialogTheframeworkdoesthisautomaticallywhentheapplication'smainwindowisnotadialogSetIcon(mhIcon,TRUE)SetbigiconSetIcon(mhIcon,FALSE)SetsmalliconTODO:AddextrainitializationherereturnTRUEreturnTRUEunlessyousetthefocustoacontrol}voidCCharStatisticDlg::OnSysCommand(UINTnID,LPARAMlParam){if((nIDxFFF)==IDMABOUTBOX){CAboutDlgdlgAboutdlgAboutDoModal()}else{CDialog::OnSysCommand(nID,lParam)}}Ifyouaddaminimizebuttontoyourdialog,youwillneedthecodebelowtodrawtheiconForMFCapplicationsusingthedocumentviewmodel,thisisautomaticallydoneforyoubytheframeworkvoidCCharStatisticDlg::OnPaint(){if(IsIconic()){CPaintDCdc(this)devicecontextforpaintingSendMessage(WMICONERASEBKGND,(WPARAM)dcGetSafeHdc(),)CentericoninclientrectangleintcxIcon=GetSystemMetrics(SMCXICON)intcyIcon=GetSystemMetrics(SMCYICON)CRectrectGetClientRect(rect)intx=(rectWidth()cxIcon)inty=(rectHeight()cyIcon)DrawtheicondcDrawIcon(x,y,mhIcon)}else{CDialog::OnPaint()}}ThesystemcallsthistoobtainthecursortodisplaywhiletheuserdragstheminimizedwindowHCURSORCCharStatisticDlg::OnQueryDragIcon(){return(HCURSOR)mhIcon}voidCCharStatisticDlg::OnStatistic(){UpdateData(TRUE)获得字符串按字节计算的长度intLength=mstrTxtGetLength()inttotalLength=for(inti=i<Lengthi){charc=mstrTxtGetAt(i)totalLengthif(c=='d'){mstrlocationFormat("d的位置是d",totalLength)}}if(totalLength==){mstrchangduFormat("链表为空")mstrfinalshuchuFormat("")mstrfifthFormat("")mstrtotalFormat("")mstrlocationFormat("")}else{mstrchangduFormat("链表不为空且链表长度:d",totalLength)charafor(into=o<Lengtho){ao=mstrTxtGetAt(o)}for(inte=e<Lengthe){if(ae=='f'){for(intp=Lengthp>ep){ap=ap}ae='x'}}mstrfinalshuchuFormat("f后插入x后链表输出:s",a)CStringl=mstrTxtGetAt()mstrfifthFormat("第五个元素是s",l)CStringk=mstrTxtMid(,totalLength)mstrtotalFormat("链表输出:s",k)}UpdateData(FALSE)}

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

评分:

/7

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利