|
|
@@ -1,120 +0,0 @@
|
|
|
-#pragma once
|
|
|
-
|
|
|
-#include "../pch/pch.h"
|
|
|
-
|
|
|
-class CWaimaiOrderFailReasonWnd : public CWindowWnd, public INotifyUI, public IMessageFilterUI
|
|
|
-{
|
|
|
-public:
|
|
|
- LPCTSTR GetWindowClassName() const
|
|
|
- {
|
|
|
- return _T("UIWaimaiOrderFailFrame");
|
|
|
- };
|
|
|
-
|
|
|
- UINT GetClassStyle() const
|
|
|
- {
|
|
|
- return UI_CLASSSTYLE_DIALOG;
|
|
|
- };
|
|
|
-
|
|
|
- void OnFinalMessage(HWND /*hWnd*/)
|
|
|
- {
|
|
|
- //WindowImplBase::OnFinalMessage(hWnd);
|
|
|
- m_pm.RemovePreMessageFilter(this);
|
|
|
-
|
|
|
- //delete this;
|
|
|
- };
|
|
|
-
|
|
|
- void Init()
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- std::string getReason()
|
|
|
- {
|
|
|
- return m_reason;
|
|
|
- }
|
|
|
-
|
|
|
- void Notify(TNotifyUI& msg)
|
|
|
- {
|
|
|
- if(msg.sType == _T("click"))
|
|
|
- {
|
|
|
- DuiLib::CDuiString senderName = msg.pSender->GetName();
|
|
|
-
|
|
|
- if(senderName == _T("waimai_order_fail_dlg_closebtn"))
|
|
|
- {
|
|
|
- Close(IDCANCEL);
|
|
|
- return;
|
|
|
- }
|
|
|
- else if(senderName == _T("waimai_order_fail_dlg_save"))
|
|
|
- {
|
|
|
- //开始保存厨房打印机的数据
|
|
|
- CEditUI* pReason = static_cast<CEditUI*>(m_pm.FindControl(_T("waimai_order_fail_dlg_reason")));
|
|
|
- wstring wsReason = pReason->GetText();
|
|
|
-
|
|
|
- m_reason = CLewaimaiString::UnicodeToUTF8(wsReason);
|
|
|
-
|
|
|
- Close(IDOK);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
|
|
- {
|
|
|
- LONG styleValue = ::GetWindowLong(*this, GWL_STYLE);
|
|
|
- styleValue &= ~WS_CAPTION;
|
|
|
- ::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
|
|
|
-
|
|
|
- // 把自己的窗口句柄与窗口绘制管理器挂接在一起
|
|
|
- m_pm.Init(m_hWnd);
|
|
|
-
|
|
|
- m_pm.AddPreMessageFilter(this);
|
|
|
-
|
|
|
- CDialogBuilder builder;
|
|
|
-
|
|
|
- CControlUI* pRoot = builder.Create(_T("waimai_order_fail_reason_dlg.xml"), (UINT)0, NULL, &m_pm);
|
|
|
- ASSERT(pRoot && "Failed to parse XML");
|
|
|
-
|
|
|
- // 把这些控件绘制到本窗口上
|
|
|
- m_pm.AttachDialog(pRoot);
|
|
|
-
|
|
|
- // 把自己加入到CPaintManagerUI的m_aNotifiers数组中,用于处理Notify函数
|
|
|
- m_pm.AddNotifier(this);
|
|
|
-
|
|
|
- Init();
|
|
|
-
|
|
|
- return 0;
|
|
|
- }
|
|
|
-
|
|
|
- LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
|
|
- {
|
|
|
- if(::IsIconic(*this))
|
|
|
- {
|
|
|
- bHandled = FALSE;
|
|
|
- }
|
|
|
- return (wParam == 0) ? TRUE : FALSE;
|
|
|
- }
|
|
|
-
|
|
|
- LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
|
|
- {
|
|
|
- return 0;
|
|
|
- }
|
|
|
-
|
|
|
- LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
|
|
- {
|
|
|
- return 0;
|
|
|
- }
|
|
|
-
|
|
|
- LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
|
-
|
|
|
- LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
|
-
|
|
|
- LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
-
|
|
|
- LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
|
|
|
-
|
|
|
-public:
|
|
|
- CPaintManagerUI m_pm;
|
|
|
-
|
|
|
- std::string m_reason;
|
|
|
-};
|
|
|
-
|