ControlEx.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #pragma once
  2. #include "../pch/pch.h"
  3. #include "../page/CDiandanPageUI.h"
  4. #include "../page/CWaimaiOrderListPageUI.h"
  5. #include "../page/CWaimaiOrderInfoPageUI.h"
  6. #include "../page/CSettingPageUI.h"
  7. #include "CWaimaiOrderItemUI.h"
  8. #include "CDiandanFoodItemUI.h"
  9. #include "CFoodtypeOptionUI.h"
  10. #include "CDiandanNatureItemUI.h"
  11. #include "CDiandanZhifufangshiItemUI.h"
  12. class CDialogBuilderCallbackEx : public IDialogBuilderCallback
  13. {
  14. public:
  15. CControlUI* CreateControl(LPCTSTR pstrClass)
  16. {
  17. //page相关的
  18. if (_tcscmp(pstrClass, _T("DiandanPage")) == 0)
  19. {
  20. return new CDiandanPageUI;
  21. }
  22. else if (_tcscmp(pstrClass, _T("WaimaiOrderListPage")) == 0)
  23. {
  24. return new CWaimaiOrderListPageUI;
  25. }
  26. else if (_tcscmp(pstrClass, _T("WaimaiOrderInfoPage")) == 0)
  27. {
  28. return new CWaimaiOrderInfoPageUI;
  29. }
  30. else if (_tcscmp(pstrClass, _T("SettingPage")) == 0)
  31. {
  32. return new CSettingPageUI;
  33. }
  34. //控件相关的
  35. else if (_tcscmp(pstrClass, _T("WaimaiOrderItem")) == 0)
  36. {
  37. return new CWaimaiOrderItemUI;
  38. }
  39. else if (_tcscmp(pstrClass, _T("FoodtypeOption")) == 0)
  40. {
  41. return new CFoodtypeOptionUI;
  42. }
  43. else if (_tcscmp(pstrClass, _T("DiandanFoodItem")) == 0)
  44. {
  45. return new CDiandanFoodItemUI;
  46. }
  47. else if (_tcscmp(pstrClass, _T("DiandanNatureItem")) == 0)
  48. {
  49. return new CDiandanNatureItemUI;
  50. }
  51. else if (_tcscmp(pstrClass, _T("DiandanZhifufangshiItem")) == 0)
  52. {
  53. return new CDiandanZhifufangshiItemUI;
  54. }
  55. return NULL;
  56. }
  57. };