CMainWnd.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #pragma once
  2. #include "../pch/pch.h"
  3. #include "../control/CWaimaiOrderItemUI.h"
  4. #include "../order/CWaimaiOrder.h"
  5. #include "../tool/CPosPrinter.h"
  6. class CMainWnd : public CWindowWnd, public INotifyUI
  7. {
  8. public:
  9. CMainWnd() { };
  10. LPCTSTR GetWindowClassName() const
  11. {
  12. return _T("UIMainFrame");
  13. };
  14. UINT GetClassStyle() const
  15. {
  16. return CS_DBLCLKS;
  17. };
  18. void OnFinalMessage(HWND /*hWnd*/)
  19. {
  20. delete this;
  21. };
  22. void Init();
  23. void OnPrepare()
  24. {
  25. }
  26. void Notify(TNotifyUI& msg);
  27. void HandleClickMsg(TNotifyUI& msg);
  28. void HandleSelectChangeMsg(TNotifyUI& msg);
  29. void HandleItemSelectMsg(TNotifyUI& msg);
  30. void InitSettingStatus();
  31. LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  32. LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  33. {
  34. bHandled = FALSE;
  35. return 0;
  36. }
  37. LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  38. {
  39. ::PostQuitMessage(0L);
  40. bHandled = FALSE;
  41. return 0;
  42. }
  43. LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  44. {
  45. if(::IsIconic(*this))
  46. {
  47. bHandled = FALSE;
  48. }
  49. return (wParam == 0) ? TRUE : FALSE;
  50. }
  51. LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  52. {
  53. return 0;
  54. }
  55. LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  56. {
  57. return 0;
  58. }
  59. LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  60. LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  61. LRESULT OnGetMinMaxInfo(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  62. LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  63. LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
  64. public:
  65. CPaintManagerUI m_pm;
  66. private:
  67. CButtonUI* m_pCloseBtn;
  68. CButtonUI* m_pMaxBtn;
  69. CButtonUI* m_pRestoreBtn;
  70. CButtonUI* m_pMinBtn;
  71. };