#ifndef __SATISFACTIONSURVEYDEF_H_ #define __SATISFACTIONSURVEYDEF_H_ #include class SatisfactionSurvey; int g_nIdxCtrlID = 0; //控件索引 typedef enum _CTRLTYPE { TYPE_STATIC = 1, TYPE_BUTTON, TYPE_CHECKBOX }CTRLTYPE; typedef struct _SCTRLINFO { int nID; CTRLTYPE nType; //控件类型 CWnd* pCtrl; //控件 }SCTRLINFO; //控件ID static const int szCtrlIDD[] = { 90001, 90002, 90003, 90004, 90005, 90006, 90007, 90008, 90009, 90010, 90011, 90012, 90013, 90014, 90015, 90016, 90017, 90018, 90019, 90020, 90021, 90022, 90023, 90024, 90025, 90026, 90027, 90028, 90029, 90030, 90031, 90032, 90033, 90034, 90035, 90036, 90037, 90038, 90039, 90040, 90041, 90042, 90043, 90044, 90045, 90046, 90047, 90048, 90039, 90050, 90051, 90052, 90053, 90054, 90055, 90056, 90057, 90058, 90059, 90060, 90061, 90062, 90063, 90064, 90065, 90066, 90067, 90068, 90069, 90070, 90071, 90072, 90073, 90074, 90075, 90076, 90077, 90078, 90079, 90080, 90081, 90082, 90083, 90084, 90085, 90086, 90087, 90088, 90089, 90090, 90091, 90092, 90093, 90094, 90095, 90096, 90097, 90098, 90099, 90100, 99999 }; //评分类型 CString szstrScoreCN[] = { _T("1分"),_T("2分"),_T("3分"),_T("4分"),_T("5分"), _T("非常不满意"),_T("不满意"),_T("一般"),_T("满意"),_T("非常满意") }; /*--------------------------------------- 函数名: CreateStatic 描述: 创建文本控件 参数: const int nCtrlIdx, 控件ID CString& strText, 文本 CRect& rt 位置大小 返回值:CWnd* 返回控件指针 ----------------------------------------*/ CWnd* CreateStatic(SatisfactionSurvey* pFather, const int nCtrlIdx, CString& strText, CRect& rt) { int nFontSize = 128; CFont f; f.CreatePointFont(nFontSize, _T("宋体")); Color color(255, 255, 255); CRect crt(0, 0, 0, 0); crt.left = rt.left + 175; crt.right = rt.right; crt.top = rt.top; crt.bottom = rt.top + 20; CStatic* p = new CStatic(); p->Create(strText, WS_CHILD|WS_VISIBLE|SS_LEFT, crt, (CWnd*)pFather, szCtrlIDD[nCtrlIdx]); p->SetFont(&f); rt = crt; return (CWnd*)p; } /*--------------------------------------- 函数名: CreateCheckBox 描述: 创建复选框 参数: const int nCtrlIdx, 控件ID CString& strText, 文本 CRect& rt 位置大小 返回值:CWnd* 返回控件指针 ----------------------------------------*/ CWnd* CreateCheckBox(SatisfactionSurvey* pFather, const int nCtrlIdx, CString& strText, CRect& rt) { //返回栈中元素的个数 DWORD dwStyle = WS_CHILD | WS_TABSTOP | WS_VISIBLE | BS_AUTOCHECKBOX; CRect crt(0, 0, 0, 0); crt.left = rt.left; crt.right = crt.left + 100; crt.top = rt.top; crt.bottom = crt.top + 20; CButton* p = new CButton(); p->Create(strText, dwStyle, crt, (CWnd*)pFather, szCtrlIDD[nCtrlIdx]); rt = crt; return (CWnd*)p; } #endif