付费下载
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、中南大学SSD4 用户界面设计与评价项目设计学生步凡学生学号3901130622专业班级1306时间2015 年 01 月一、项目相关小组成员:杨非凡、项目名称:dairy、3.开发目的:为频繁使用计算机的人群所准备的来日程。并添加了一些调剂心情的小插件。,旨在个人日常或者添加未二、使用1.日期与时间:打开,首先看到的便是日期和时间。其中时间分为荷兰时与中国时:点击 area 按钮可以切换时区:2.日程功能:接下来右边会有相应的数据,如果之前未曾,则为空。上面四个按钮对应心情,下面四个按钮对应良好的生活之后可以在编辑框中编辑文字。编辑完成后点击下方的 save 按钮,即可。之后如果想看 23
2、日的,只需在日历上点击 23 日,之前写好的就会在右侧显示。3.壁纸切换:每天面对同一张壁纸,难免会产生审美疲劳。于是,换张壁纸,欣赏不同的,感受不同的美丽。(未一一列举)4.植物培养每天写会给植物滋润,而好的心情与生活也会让他获得的阳光。对它用心呵护,它就会生长并开出美丽花朵来报答你。(创意来自 Qzone 花藤)三、功能实现本作品使用Visual C+ 6.0 开发。1.日期:voidCDairyDlg:OnTimer(UnIDEvent)由于本默认荷兰时为当地时间,而荷兰时分为夏令时与冬令时,于是选择ernet 自动同步世界,亦可手动更改。国内时间则由荷兰时转换。每秒运行相关函数。2.v
3、oidCDairyDlg:OnSelectDate(NMHDR*pNMHDR,LRESULT*pResult)选择日期后调用程序,寻找的,并且显示。m_calendar.GetCurSel(selectTime); CStringfilePath=selectTime.Format(%Y-%m-%d.txt); CFileFindfinder;BOOLexist=finder.FindFile(filePath);当未做出选择时,默认打开当天的。按下按钮时自动。voidCDairyDlg:OnSave()此函数用来保存,同时增添植物生长所需的成长值。DIALOG1:DIALOG1(CWnd*p
4、Parent/*=NULL*/)保存成功的同时弹出 3.壁纸voidCDairyDlg:OnPa()利用该函数切换壁纸4.其他框以提示。BOOLCDairyDlg:OnInitDialog()此函数中功能的代码。了与程序相关的细小事物以及大量的初始化四、有待完善1.控件的透明问题未能解决默认的透明只是灰色,无色是白色,比如这里,曾经用过了 CBrush 有关的方法,但是使用后显示会有 bug,文字会有一部分莫名2.日历不够美观。为了减少 bug 使用了 MFC 自带的控件,并不美观实用。五、项目代码/dairy.h:mainheaderfilefortheDAIRYapplication/#i
5、f!defined(AFX_DAIRY_H 71E43E06_745F_4062_A9D9_9469E72CC INCLUDED_)#defineAFX_DAIRY_H 71E43E06_745F_4062_A9D9_9469E72CC INCLUDED_#if_MSC_VER1000#pragmaonce #endif/_MSC_VER1000#ifndef AFXWIN_H #errorincludestdafx.hbeforeincludingthisfileforPCH#endif#includeresource.h/mainsymbols/CDairyApp:/Seedairy.cp
6、pfortheimplemenionofthisclass/classCDairyApp:publicCWinApppublic: CDairyApp();/Overrides/ClassWizardgeneratedvirtualfunctionoverrides/AFX_VIRTUAL(CDairyApp) public: virtualBOOLInitInstance();/AFX_VIRTUAL/Implemenion/AFX_MSairyApp)/NOTE-theClassWizardwilladdandremovememberfunctionshere./DONOTEDITwhat
7、youseeheseblocksofgeneratedcode!/AFX_MSG DECLARE_MESSAGE_MAP();/AFX_INSERT_LOCATION/VisualC+willinsertadditionaldeclarationsimmediaybeforethepreviousline.#endif/!defined(AFX_DAIRY_H 71E43E06_745F_4062_A9D9_9469E D_)/dairyDlg.h:headerfile/72CC INCLUDE#if!defined(AFX_DAIRYDLG_H 764738DD_E581_400D_A3FE
8、_D0F1567A316A INCLUD ED_)#defineAFX_DAIRYDLG_H 764738DD_E581_400D_A3FE_D0F1567A316A INCLUDED_#if_MSC_VER1000#pragmaonce #endif/_MSC_VER1000/CDairyDlgdialogclassCDairyDlg:publicCDialog/Construction public:CDairyDlg(CWnd*pParent=NULL);/standardconstructor/DialogData/AFX_DDairyDlg)enumIDD=IDD_DAIRY_DIA
9、LOG;CEditm_edit; CMonthCalCtrlm_calendar;CButtonm_M4; CButtonm_M3; CButtonm_M2; CButtonm_M1; CButtonm_L4; CButtonm_L3; CButtonm_L2; CButtonm_L1; CSicm_CTime; CSicm_HTime;CStringm_hollandTime; CStringm_chinaTime; COleDateTimem_selectDate;/AFX_DATA/ClassWizardgeneratedvirtualfunctionoverrides/AFX_VIRT
10、UAL(CDairyDlg) protected:virtualvoidDoDataExchange(CDataExchange*pDX);/DDX/DDVsupport/AFX_VIRTUAL/Implemenionprotected: HICONm_hIcon;/Generatedmessagemapfunctions/AFX_MSairyDlg)virtualBOOLOnInitDialog();aafx_msgvoidOnPa();mand(UnID,LPARAMlParam);afx_msgHCURSOROnQueryDragIcon();afx_msgvoidOnTimer(UnI
11、DEvent);afx_msgvoidOnSelectDate(NMHDR*pNMHDR,LRESULT*pResult); afx_msgvoidOnMind1();afx_msgvoidOnMind2(); afx_msgvoidOnMind3(); afx_msgvoidOnMind4(); afx_msgvoidOnLife1(); afx_msgvoidOnLife2(); afx_msgvoidOnLife3(); afx_msgvoidOnLife4(); afx_msgvoidOnSave(); afx_msgvoidOnChangeEdit();/AFX_MSGDECLARE
12、_MESSAGE_MAP();/AFX_INSERT_LOCATION/VisualC+willinsertadditionaldeclarationsimmediaybeforethepreviousline.#endif/!defined(AFX_DAIRYDLG_H 764738DD_E581_400D_A3FE_D0F1567A316A INC LUDED_)DILOAG1.h#if!defined(AFX_DIALOG1_H 6571C58F_7683_4A1E_8027_2D6F0F572B4D INCLUDED_)#defineAFX_DIALOG1_H 6571C58F_768
13、3_4A1E_8027_2D6F0F572B4D INCLUDED_#if_MSC_VER1000#pragmaonce #endif/_MSC_VER1000/DIALOG1.h:headerfile/DIALOG1dialogclassDIALOG1:publicCDialog/Construction public:DIALOG1(CWnd*pParent=NULL);/standardconstructor BOOLDIALOG1:OnInitDialog();/DialogData/AFX_DATA(DIALOG1) enumIDD=IDD_DIALOG1;CSicm_TIP; CS
14、tringm_tip;/AFX_DATA/Overrides/ClassWizardgeneratedvirtualfunctionoverrides/AFX_VIRTUAL(DIALOG1)protected: virtualvoidDoDataExchange(CDataExchange*pDX);/DDX/DDVsupport/AFX_VIRTUAL/Implemenionprotected:/Generatedmessagemapfunctions/AFX_MSG(DIALOG1)/NOTE:theClassWizardwilladdmemberfunctionshere/AFX_MS
15、G DECLARE_MESSAGE_MAP();/AFX_INSERT_LOCATION/VisualC+willinsertadditionaldeclarationsimmediaybeforethepreviousline.#endif/!defined(AFX_DIALOG1_H 6571C58F_7683_4A1E_8027_2D6F0F572B4D INCLU DED_)Resource.h/NO_DEPENDENCIES/DeveloperStudiogeneratedincludefile./Usedbydairy.rc/ #defineIDM_ABOUTBOX0 x0010
16、#defineIDD_ABOUTBOX100 #defineIDS_ABOUTBOX101 #defineIDD_DAIRY_DIALOG102 #defineIDR_MAINFRAME128 #defineIDB_M1130 #defineIDB_M4131 #defineIDB_M2132 #defineIDB_M3133 #defineIDB_L1134 #defineIDB_L2135 #defineIDB_L3136 #defineIDB_L4138 #defineIDB_B1140 #defineIDB_B2141 #defineIDB_B7142 #defineIDB_B3143
17、 #defineIDB_B4144 #defineIDB_B5145 #defineIDB_B6146 #defineIDD_DIALOG1147 #defineIDB_P148#defineIDB_BITMAP1149#defineIDC_HOLL1000#defineIDC_CHINATIME1001#defineIDC_MONTHCALENDAR1003#defineIDC_BUTTON11004 #defineIDC_MIND11004 #defineIDC_BUTTON21005 #defineIDC_MIND21005 #defineIDC_BUTTON31006 #defineI
18、DC_MIND31006 #defineIDC_BUTTON41007 #defineIDC_LIFE11007 #defineIDC_BUTTON51008 #defineIDC_LIFE21008 #defineIDC_BUTTON61009 #defineIDC_LIFE31009 #defineIDC_EDIT11010 #defineIDC_EDIT1010 #defineIDC_BUTTON71011 #defineIDC_SAVE1011 #defineIDC_BUTTON81012 #defineIDC_MIND41013 #defineIDC_LIFE41014 #defin
19、eIDC_TIP1017#defineIDC_P1018/Nextdefaultvaluesfornewobjects/ #ifdefAPSTUDIO_INVOKED#ifndefAPSTUDIO_READONLY_SYMBOLS#define_APS_NEXT_RESOURCE_VALUE151#dMAND_VALUE32771#define_APS_NEXT_CONTROL_VALUE1019#define_APS_NEXT_SYMED_VALUE101 #endif#endif/stdafx.h:includefileforstandardsystemincludefiles,/orpr
20、ojectspecificincludefiles/arechangedinfrequently/tareusedfrequently,but#if!defined(AFX_STDAFX_H 96380EDD_B40B_4A33_BFA7_3A71908AF6F8 INCLUDED_)#defineAFX_STDAFX_H 96380EDD_B40B_4A33_BFA7_3A71908AF6F8 INCLUDED_#if_MSC_VER1000#pragmaonce#endif/_MSC_VER1000#defineVC_EXTRALEAN/Excluderarely-usedsturomWi
21、ndowsheaders#include/MFC#include/MFCextenponentss#include/MFCAutomationclasses #include/MFCsupportfor #ifndef_AFX_NO_AFXCMN_SUPPORT #include/MFCsu#endif/_AFX_NO_AFXCMN_SUPPORTonControlsmonControlsexternCTimecurrentTime;externCTimechiTime;externCTimeselectTime;externCTimeSp externCStringdata;externch
22、ange;Span;/AFX_INSERT_LOCATION/VisualC+willinsertadditionaldeclarationsimmediaybeforethepreviousline.#endif/!defined(AFX_STDAFX_H 96380EDD_B40B_4A33_BFA7_3A71908AF6F8 INCLU DED_)Basetsd.h/*+Copyright(c)1997-1998CorporationModuleName:basetsd.hAbstract:Typedefinitionsforthebasicsizedtypes.Author:JeffH
23、avens(jhavens)23-Oct-1997ReviHistory:-*/#ifndef_BASETSD_H_#define_BASETSD_H_#ifdef cplusplusexternC #endif/Thefollowingtypesareguaranteedtobesignedand32bitswide./typedefLONG32,*PLONG32;typedef32,*P32;/Thefollowingtypesareguaranteedtobeunsignedand32bitswide./typedefunsigned typedefunsignedtypedefunsi
24、gnedULONG32,*PULONG32;DWORD32,*PDWORD32;U32,*PU32;/The_PTRisguaranteedtobethesamesizeasapoer.Its/sizewithchangewithpoersize(32/64).Itshouldbeused/anywheretapoeriscasttoanegertype.U_PTRis/theunsignedvariation./HALF_PTRishalfthesizeofapoeritendedforusewith/withinstrcuturewhichcontainapoerandtwosmallfi
25、elds./UHALF_PTRistheunsignedvariation./#ifdef_WIN64typedef 64_PTR,*P_PTR;_PTR,*PU_PTR;typedefunsigned 64U#defineMAX #defineMIN#defineMAXU_PTR(0 x7I64)_PTR(0 x8000000000000000I64)_PTR(0 xfUI64)typedefunsignedUHALF_PTR,*PUHALF_PTR;typedefHALF_PTR,*PHALF_PTR;#defineMAXUHALF_PTR(0 x#defineMAXHALF_PTR(0
26、x7ffUL)fL)#defineMINHALF_PTR(0 x80000000L)#pragmawarning(disable:4311)/typecasttruncation#if!defined( midl) inline unsignedlong HandleToUlong( void*h)return(unsignedlong)h); inline unsignedlong PtrToUlong( void*p)return(unsignedlong)p); inline unsignedshort PtrToUshort( void*p)return(unsignedshort)p
27、); inline long PtrToLong( void*p)return(long)p); inline short PtrToShort( void*p)return(short)p);#endif #pragmawarning(3:4311)/typecasttruncation#elsetypedeflong_PTR,*P_PTR;typedefunsignedlongU_PTR,*PU_PTR;#defineMAX#defineMIN #defineMAXU_PTR(0 x7fL)_PTR(0 x80000000L)_PTR(0 xffUL)typedefunsignedshor
28、tUHALF_PTR,*PUHALF_PTR;typedefshorLF_PTR,*PHALF_PTR;#defineMAXUHALF_PTR0 x f#defineMAXHALF_PTR0 x7 #defineMINHALF_PTR0 x8000#defineHandleToUlong(h)(ULONG)(h) #definePtrToUlong(p)(ULONG)(p) #definePtrToLong(p)(LONG)(p) #definePtrToUshort(p)(unsignedshort)(p)#definePtrToShort(p)(short)(p)#endif/SIZE_T
29、usedforcountsorrangeswhichneedtospantherangeof/ofapoer.SSIZE_Tisthesignedvariation./typedefU_PTRSIZE_T,*PSIZE_T;typedef_PTRSSIZE_T,*PSSIZE_T;/Thefollowingtypesareguaranteedtobesignedand64bitswide./typedef 64LONG64,*PLONG64;typedef 6464,*P64;/Thefollowingtypesareguaranteedtobeunsignedand64bitswide./t
30、ypedefunsigned typedefunsignedtypedefunsigned64ULONG64,*PULONG64;64DWORD64,*PDWORD64;64U64,*PU64;#ifdef cplusplus#endif#endif/_BASETSD_H_/dairy.cpp:Definestheclassbehaviorsfortheapplication./#includestdafx.h#includedairy.h #includedairyDlg.h#ifdef_DEBUG #definenewDEBUG_NEW #undefTHIS_FILEsiccharTHIS
31、_FILE= FILE ;#endif/CDairyAppBEGIN_MESSAGE_MAP(CDairyApp,CWinApp)/AFX_MSG_MAP(CDairyApp)/NOTE-theClassWizardwilladdandremovemapmacroshere./DONOTEDITwhatyouseeheseblocksofgeneratedcode!/AFX_MSGMAND(ID_HELP,CWinApp:OnHelp) END_MESSAGE_MAP()/CDairyAppconstructionCDairyApp:CDairyApp()/TODO:addconstructi
32、oncodehere,/PlaceallsignificantinitializationinInitInstance/TheoneandonlyCDairyAppobjectCDairyApptheApp;/CDairyAppinitializationBOOLCDairyApp:InitInstance()AfxEnableControlContainer();/Standardinitialization/Ifyouarenotusingthesefeaturesandwishtoreducethesize/ofyourfinalexecutable,youshouldremovefro
33、mthefollowing/thespecificinitializationroutinesyoudonotneed.#ifdef_AFXDLL Enable3dControls();/CallthiswhenusingMFCinasharedDLL #elseEnable3dControlsSic();/CallthiswhenlinkingtoMFCsically#endifCDairyDlgdlg; m_pMainWnd=&dlg;nResponse=dlg.DoModal(); if(nResponse=IDOK)/TODO:Placecodeheretohandlewhenthed
34、ialogis/dismissedwithOKelseif(nResponse=IDCANCEL)/TODO:Placecodeheretohandlewhenthedialogis/dismissedwithCancel/Sincethedialoghasbeenclosed,returnFALSEsotxitthe/application,rather returnFALSE;nstarttheapplicationsmessagepump./dairyDlg.cpp:implemenionfile/#includestdafx.h #includedairy.h #includedair
35、yDlg.h#includeDIALOG1.h#include#ifdef_DEBUG #definenewDEBUG_NEW #undefTHIS_FILEsiccharTHIS_FILE= FILE ;#endif/CAboutDlgdialogusedforAppAboutclassCAboutDlg:publicCDialogpublic: CAboutDlg();/DialogData/AFX_DAboutDlg)enumIDD=IDD_ABOUTBOX;/AFX_DATA/ClassWizardgeneratedvirtualfunctionoverrides/AFX_VIRTUA
36、L(CAboutDlg) protected:virtualvoidDoDataExchange(CDataExchange*pDX);/DDX/DDVsupport/AFX_VIRTUAL/Implemenionprotected:/AFX_MSG(CAboutDlg)/AFX_MSG DECLARE_MESSAGE_MAP();CAboutDlg:CAboutDlg():CDialog(CAboutDlg:IDD)/AFX_DATA_INIT(CAboutDlg)/AFX_DATA_INITvoidCAboutDlg:DoDataExchange(CDataExchange*pDX)CDi
37、alog:DoDataExchange(pDX);/AFX_DATA_MAP(CAboutDlg)/AFX_DATA_MAPBEGIN_MESSAGE_MAP(CAboutDl/AFX_MSG_MAP(CAboutDlg)/Nomessagehandlers/AFX_MSG_MAP END_MESSAGE_MAP()ialog)/CDairyDlgdialogCDairyDlg:CDairyDlg(CWnd*pParent/*=NULL*/):CDialoairyDlg:IDD,pParent)/AFX_DATA_INIT(CDairyDlg) m_hollandTime=_T(); m_ch
38、inaTime=_T();m_selectDate=COleDateTime:GetCurrentTime();/AFX_DATA_INIT/NotetLoadIcondoesnotrequireasubsequentDestroyIconinWin32m_hIcon=AfxGetApp()-LoadIcon(IDR_MAINFRAME);voidCDairyDlg:DoDataExchange(CDataExchange*pDX)CDialog:DoDataExchange(pDX);/AFX_DATA_MAP(CDairyDlg)DDX_Control(pDX,IDC_EDIT,m_edi
39、t); DDX_Control(pDX,IDC_MONTHCALENDAR,m_calendar); DDX_Control(pDX,IDC_MIND4,m_M4); DDX_Control(pDX,IDC_MIND3,m_M3); DDX_Control(pDX,IDC_MIND2,m_M2); DDX_Control(pDX,IDC_MIND1,m_M1); DDX_Control(pDX,IDC_LIFE4,m_L4); DDX_Control(pDX,IDC_LIFE3,m_L3); DDX_Control(pDX,IDC_LIFE2,m_L2); DDX_Control(pDX,ID
40、C_LIFE1,m_L1);DDX_Control(pDX,IDC_CHINATIME,m_CTime);DDX_Control(pDX,IDC_HOLLDDX_Text(pDX,IDC_HOLL,m_HTime);,m_hollandTime);DDX_Text(pDX,IDC_CHINATIME,m_chinaTime); DDX_MonthCalCtrl(pDX,IDC_MONTHCALENDAR,m_selectDate);/AFX_DATA_MAPBEGIN_MESSAGE_MAP(CDairyDl/AFX_MSG_MAP(CDairyDlg)MAND()ialog)ON_WM_PA
41、()ON_WM_QUERYDRAGICON() ON_WM_TIMER()ON_NOTIFY(MCN_SELCHANGE,IDC_MONTHCALENDAR,OnSelectDate) ON_BN_CLICKED(IDC_MIND1,OnMind1) ON_BN_CLICKED(IDC_MIND2,OnMind2) ON_BN_CLICKED(IDC_MIND3,OnMind3) ON_BN_CLICKED(IDC_MIND4,OnMind4) ON_BN_CLICKED(IDC_LIFE1,OnLife1) ON_BN_CLICKED(IDC_LIFE2,OnLife2) ON_BN_CLI
42、CKED(IDC_LIFE3,OnLife3) ON_BN_CLICKED(IDC_LIFE4,OnLife4) ON_BN_CLICKED(IDC_SAVE,OnSave)ON_EN_CHANGE(IDC_EDIT,OnChangeEdit)/AFX_MSG_MAP END_MESSAGE_MAP()/CDairyDlgmessagehandlersBOOLCDairyDlg:OnInitDialog()CDialog:OnInitDialog();/AddAbout.itemtosystem./IDM_ABOUTBOXmuASSERT(IDM_ABOUTBOX&0 xmandrange.0
43、)=IDM_ABOUTBOX);ASSERT(IDM_ABOUTBOXAppend-Append(MF_SEPARATOR);(MF_STRING,IDM_ABOUTBOX,strAbout);/Settheiconforthisdialog.Theframeworkdoesthisautomatically/whentheapplicationsmainwindowisnotadialog SetIcon(m_hIcon,TRUE);/Setbigicon SetIcon(m_hIcon,FALSE);/Setsmallicon/TODO:Addextrainitializationhere
44、SetTimer(1,1000,NULL);/time=CTime:GetCurrentTime();/获取当前时间日期/m_hollandTime=time.Format(%H:%M:%S);/*m_strDate=m_time.Format(_T(%x);/格式化日期 m_strTime=m_time.Format(_T(%X);/格式化时间 m_strDateTime=m_time.Format(_T(%Y-%m-%d%H:%M:%S%A);/格式化日期时间 UpdateData(false);*/ HBITMAPhBitmap;hBitmap=LoadBitmap(AfxGetInst
45、anceHandle(),MAKERESOURCE(IDB_M1);(CButton*)GetDlgItem(IDC_MIND1)-SetBitmap(hBitmap);hBitmap=LoadBitmap(AfxGetInstanceHandle(),MAKERESOURCE(IDB_M2);(CButton*)GetDlgItem(IDC_MIND2)-SetBitmap(hBitmap);hBitmap=LoadBitmap(AfxGetInstanceHandle(),MAKERESOURCE(IDB_M3);(CButton*)GetDlgItem(IDC_MIND3)-SetBit
46、map(hBitmap);hBitmap=LoadBitmap(AfxGetInstanceHandle(),MAKERESOURCE(IDB_M4);(CButton*)GetDlgItem(IDC_MIND4)-SetBitmap(hBitmap);/hBitmap=LoadBitmap(AfxGetInstanceHandle(),MAKERESOURCE(IDB_L1);(CButton*)GetDlgItem(IDC_LIFE1)-SetBitmap(hBitmap);hBitmap=LoadBitmap(AfxGetInstanceHandle(),MAKERESOURCE(IDB
47、_L2);(CButton*)GetDlgItem(IDC_LIFE2)-SetBitmap(hBitmap);hBitmap=LoadBitmap(AfxGetInstanceHandle(),MAKERESOURCE(IDB_L3);(CButton*)GetDlgItem(IDC_LIFE3)-SetBitmap(hBitmap);hBitmap=LoadBitmap(AfxGetInstanceHandle(),MAKERESOURCE(IDB_L4);(CButton*)GetDlgItem(IDC_LIFE4)-SetBitmap(hBitmap);/m_calendar.GetC
48、urSel(selectTime); CStringfilePath=selectTime.Format(%Y-%m-%d.txt); CFileFindfinder;BOOLexist=finder.FindFile(filePath);hBitmap=LoadBitmap(AfxGetInstanceHandle(),MAKERESOURCE(IDB_P);(CButton*)GetDlgItem(IDC_P)-SetBitmap(hBitmap);/CFile:GetSus(WMSIniFilePath,filesus)/ifnotexist if(!exist) data=000000
49、00;m_edit.SetWindowText();/ifalreadyexist,data+=telse/read ifstreamifs;ifs.open(filePath); charcstr1024;ifscstr;dstr;/pr/m_edit1.SetWindowText(m_strArray0.Ge CStringdairy=data;dairy=dairy.Mid(8); m_edit.SetWindowText(dairy); ifs.close();(0);returnTRUE;/returnTRUEunlessyousetthefocustoacontrolvoidCif
50、(nID&0 xmand(UnID,LPARAMlParam)0)=IDM_ABOUTBOX)CAboutDlgdlgAbout; dlgAbout.DoModal();elsemand(nID,lParam);/Ifyouaddaminimizebuttontoyourdialog,youwillneedthecodebelow/todrawtheicon.ForMFCapplicationsusingthe/thisisautomaticallydoneforyoubytheframework./viewm,voidCDairyDlg:OnPa()if(IsIconic()CPaDCdc(
51、this);/devicecontextforpaingSendMessage(WM_ICONERASEBKGND,(RAM)dc.GetSafeHdc(),0);/CentericonincntrectanglecxIcon=GetSystemMetrics(SM_CXICON); cyIcon=GetSystemMetrics(SM_CYICON);CRectrect;GetCntRect(&rect); x=(rect.Width()-cxIcon+1)/2; y=(rect.Height()-cyIcon+1)/2;/Drawtheicondc.DrawIcon(x,y,m_hIcon
52、);else/CDialog:OnPa();/m_hollandTime=currentTime.Format(%H:%M:%S); CStringw=currentTime.Format(%w);CPaDCdc(this); CBitmapbitmap;if(w=1)bitmap.LoadBitma if(w=2) bitmap.LoadBitma if(w=3) bitmap.LoadBitma if(w=4) bitmap.LoadBitma if(w=5) bitmap.LoadBitma if(w=6) bitmap.LoadBitma if(w=0) bitmap.LoadBitm
53、aCBrushbrush;B_B1);/这个 IDB_BITMAP1 要自己添加B_B2);B_B3);B_B4);B_B5);B_B6);B_B7);brush.CreatePatternBrush(&bitmap);CBrush*pOldBrush=electObject(&brush);dc.Rectangle(0,0,2000,2000);/这些参数可以调整electObject(pOldBrush);添加位置和大小/Thesystemcallsthistoobtahecursortodisplaywhiletheuserdrags/theminimizedwindow. HCURSO
54、RCDairyDlg:OnQueryDragIcon()return(HCURSOR)m_hIcon;voidCDairyDlg:OnTimer(UnIDEvent)/TODO:Addyourmessagehandlercodehereand/orcalldefault currentTime=CTime:GetCurrentTime(); m_hollandTime=currentTime.Format(%H:%M:%S);m_HTime.SetWindowText(m_hollandTime);chiTime=currentTime+timeSpan;m_chinaTime=chiTime
55、.Format(%H:%M:%S);m_CTime.SetWindowText(m_chinaTime);CDialog:OnTimer(nIDEvent);voidCDairyDlg:OnSelectDate(NMHDR*pNMHDR,LRESULT*pResult)/TODO:Addyourcontrolnotificationhandlercodehere m_calendar.GetCurSel(selectTime); CStringfilePath=selectTime.Format(%Y-%m-%d.txt); CFileFindfinder;BOOLexist=finder.F
56、indFile(filePath);/CFile:GetSus(WMSIniFilePath,filesus)/ifnotexist if(!exist)*pResult=0; m_edit.SetWindowText();/ifalreadyexist,data+= else/read ifstreamifs;tifs.open(filePath);charcstr1024; ifscstr;dstr;/pr/m_edit1.SetWindowText(m_strArray0.Ge CStringdairy=data;dairy=dairy.Mid(8); m_edit.SetWindowT
57、ext(dairy); ifs.close();(0);voidCDairyDlg:OnMind1()/TODO:Addyourcontrolnotificationhandlercodeheredata.Se data.Se data.Se data.Se(0,1);(1,0);(2,0);(3,0);voidCDairyDlg:OnMind2()/TODO:Addyourcontrolnotificationhandlercodeheredata.Se data.Se data.Se data.Se(0,0);(1,1);(2,0);(3,0);voidCDairyDlg:OnMind3(
58、)/TODO:Addyourcontrolnotificationhandlercodeheredata.Se data.Se data.Se data.Se(0,0);(1,0);(2,1);(3,0);voidCDairyDlg:OnMind4()/TODO:Addyourcontrolnotificationhandlercodeheredata.Se data.Se data.Se data.Se(0,0);(1,0);(2,0);(3,1);voidCDairyDlg:OnLife1()/TODO:Addyourcontrolnotificationhandlercodehereif
59、(data.Gedata.Se(4)=0)(4,1);elsedata.Se(4,0);voidCDairyDlg:OnLife2()/TODO:Addyourcontrolnotificationhandlercodehereif(data.Gedata.Se(5)=0)(5,1);elsedata.Se(5,0);voidCDairyDlg:OnLife3()/TODO:Addyourcontrolnotificationhandlercodehereif(data.Gedata.Se(6)=0)(6,1);elsedata.Se(6,0);voidCDairyDlg:OnLife4()/TODO:Addyourcontrolnotificationhandlercodehereif(dat
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 太原市辅警招聘笔试题及答案
- 2025年惠州市博罗县县直机关单位招聘考试试卷真题
- 苏州市辅警招聘面试题及答案
- 抛开烦恼拥抱快乐童年
- 2026年乡村医生定期考核真题试卷及答案(二十)
- 26年检测中药联用适配要点
- 医学26年:糖尿病教育要点解读 查房课件
- 项目印章管理制度
- 26年基因检测同质化管理指南
- 脑出血清除护理质量标准
- 2026年深度学习及其应用-复旦大学中国大学mooc课后章节答案期末练习题(典型题)附答案详解
- 2026云南昆华医院投资管理有限公司(云南新昆华医院)招聘5人备考题库及答案详解参考
- 2026届陕西省西安市五校中考三模语文试题含解析
- 2026年辽宁省沈阳市铁西区中考数学一模试卷(含答案)
- 2025年东莞市康复实验学校招聘笔试真题
- 2026年长沙市初三中考模拟语文试卷试题(含答案详解)
- 广东省汕头市2026年中考数学模拟试卷五套附答案
- 铁路信号设备操作规程
- 机加工供应商考核制度
- 中学全员育人岗位责任制(标准版)
- 产科全身麻醉指南与专家共识2025
评论
0/150
提交评论