SatisfactionSurveyDef.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #ifndef __SATISFACTIONSURVEYDEF_H_
  2. #define __SATISFACTIONSURVEYDEF_H_
  3. #include <vector>
  4. class SatisfactionSurvey;
  5. int g_nIdxCtrlID = 0; //控件索引
  6. typedef enum _CTRLTYPE
  7. {
  8. TYPE_STATIC = 1,
  9. TYPE_BUTTON,
  10. TYPE_CHECKBOX
  11. }CTRLTYPE;
  12. typedef struct _SCTRLINFO
  13. {
  14. int nID;
  15. CTRLTYPE nType; //控件类型
  16. CWnd* pCtrl; //控件
  17. }SCTRLINFO;
  18. //控件ID
  19. static const int szCtrlIDD[] = {
  20. 90001, 90002, 90003, 90004, 90005, 90006, 90007, 90008, 90009, 90010,
  21. 90011, 90012, 90013, 90014, 90015, 90016, 90017, 90018, 90019, 90020,
  22. 90021, 90022, 90023, 90024, 90025, 90026, 90027, 90028, 90029, 90030,
  23. 90031, 90032, 90033, 90034, 90035, 90036, 90037, 90038, 90039, 90040,
  24. 90041, 90042, 90043, 90044, 90045, 90046, 90047, 90048, 90039, 90050,
  25. 90051, 90052, 90053, 90054, 90055, 90056, 90057, 90058, 90059, 90060,
  26. 90061, 90062, 90063, 90064, 90065, 90066, 90067, 90068, 90069, 90070,
  27. 90071, 90072, 90073, 90074, 90075, 90076, 90077, 90078, 90079, 90080,
  28. 90081, 90082, 90083, 90084, 90085, 90086, 90087, 90088, 90089, 90090,
  29. 90091, 90092, 90093, 90094, 90095, 90096, 90097, 90098, 90099, 90100,
  30. 99999
  31. };
  32. //评分类型
  33. CString szstrScoreCN[] = {
  34. _T("1分"),_T("2分"),_T("3分"),_T("4分"),_T("5分"),
  35. _T("非常不满意"),_T("不满意"),_T("一般"),_T("满意"),_T("非常满意")
  36. };
  37. /*---------------------------------------
  38. 函数名: CreateStatic
  39. 描述: 创建文本控件
  40. 参数:
  41. const int nCtrlIdx, 控件ID
  42. CString& strText, 文本
  43. CRect& rt 位置大小
  44. 返回值:CWnd* 返回控件指针
  45. ----------------------------------------*/
  46. CWnd* CreateStatic(SatisfactionSurvey* pFather, const int nCtrlIdx, CString& strText, CRect& rt)
  47. {
  48. int nFontSize = 128;
  49. CFont f;
  50. f.CreatePointFont(nFontSize, _T("宋体"));
  51. Color color(255, 255, 255);
  52. CRect crt(0, 0, 0, 0);
  53. crt.left = rt.left + 175;
  54. crt.right = rt.right;
  55. crt.top = rt.top;
  56. crt.bottom = rt.top + 20;
  57. CStatic* p = new CStatic();
  58. p->Create(strText, WS_CHILD|WS_VISIBLE|SS_LEFT, crt, (CWnd*)pFather, szCtrlIDD[nCtrlIdx]);
  59. p->SetFont(&f);
  60. rt = crt;
  61. return (CWnd*)p;
  62. }
  63. /*---------------------------------------
  64. 函数名: CreateCheckBox
  65. 描述: 创建复选框
  66. 参数:
  67. const int nCtrlIdx, 控件ID
  68. CString& strText, 文本
  69. CRect& rt 位置大小
  70. 返回值:CWnd* 返回控件指针
  71. ----------------------------------------*/
  72. CWnd* CreateCheckBox(SatisfactionSurvey* pFather, const int nCtrlIdx, CString& strText, CRect& rt)
  73. {
  74. //返回栈中元素的个数
  75. DWORD dwStyle = WS_CHILD | WS_TABSTOP | WS_VISIBLE | BS_AUTOCHECKBOX;
  76. CRect crt(0, 0, 0, 0);
  77. crt.left = rt.left;
  78. crt.right = crt.left + 100;
  79. crt.top = rt.top;
  80. crt.bottom = crt.top + 20;
  81. CButton* p = new CButton();
  82. p->Create(strText, dwStyle, crt, (CWnd*)pFather, szCtrlIDD[nCtrlIdx]);
  83. rt = crt;
  84. return (CWnd*)p;
  85. }
  86. #endif