| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #pragma once
- #include "../pch/pch.h"
- #include "CMainWnd.h"
- #include "../helper/CSerialPort.h"
- #include "CModalWnd.h"
- class CChengzhongWnd : public CModalWnd
- {
- public:
- LPCTSTR GetWindowClassName() const
- {
- return _T("UIMemoWndFrame");
- };
- UINT GetClassStyle() const
- {
- return UI_CLASSSTYLE_DIALOG;
- };
- void OnFinalMessage(HWND /*hWnd*/)
- {
- //WindowImplBase::OnFinalMessage(hWnd);
- m_pm.RemovePreMessageFilter(this);
- //delete this;
- };
- void Init();
- std::string getContent();
- void SetTitle(std::wstring title);
- void SetPrice(std::string price);
- void Notify(TNotifyUI& msg);
- LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- 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);
- LRESULT OnChengzhongSuccess(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
- //读取串口的值,用于电子秤读取数据
- void ReadChuankouValue();
- void SaveWeight();
- void Quit();
- //处理键盘捕捉结果
- void HandleTextCapture(std::string content)
- {
- }
- public:
- CPaintManagerUI m_pm;
- //商品单价
- std::string m_price;
- //最终称出来的重量
- std::string m_weight;
- //临时读取到的串口数据
- std::string m_chuankou_string;
- //这个表示当前是否正在读取串口值
- bool m_is_chuangkou_working = false;
- bool m_is_watching = false;
- CSerialPort m_serial;
- };
|