张洋 1 Minggu lalu
induk
melakukan
2031797c08

+ 4 - 1
bin/Win32/Debug/zhipuzi_pos_windows/skin/huiyuan_page.xml

@@ -13,8 +13,11 @@
 				<Label text="请输入会员手机号" heiht="30" padding="43,20,10,10"></Label>
 				
 				<HorizontalLayout height="50">
+					<Button name="huiyuan_page_shoujihao_edit" text="请输入会员手机号搜索" width="220" height="50" padding="43,0,0,10" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
+
+					<!--
 					<Edit name="huiyuan_page_shoujihao_edit" tooltip="请输入会员手机号搜索" width="220" height="50" padding="43,0,0,10" borderround="10,10" bkcolor="#FFF2F2F2" nativebkcolor="#FFF2F2F2" />
-				
+					-->
 					<Button name="huiiyuan_page_sousuo_btn" width="120" height="40" padding="15,0,0,0" text="搜索" textcolor="#FFFFFFFF" normalimage="file='btn_green_zhengchang.png' corner='5,5,5,5'" hotimage="file='btn_green_xuanfu.png' corner='5,5,5,5'" pushedimage="file='btn_green_dianji.png' corner='5,5,5,5'" />
 				</HorizontalLayout>
 				

+ 13 - 26
zhipuzi_pos_windows/page/CHuiyuanPageUI.cpp

@@ -30,8 +30,7 @@ void CHuiyuanPageUI::InitControl()
 //初始化当前页面的展示,处理默认展示效果,在页面被加载的时候调用
 void CHuiyuanPageUI::InitShow()
 {
-	CEditUI* pFukuanEdit = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
-	pFukuanEdit->SetFocus();
+	
 }
 
 //处理按钮点击类事件
@@ -41,123 +40,111 @@ void CHuiyuanPageUI::HandleClickMsg(TNotifyUI& msg)
 
 	if (senderName == L"jianpan_1")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+		CButtonUI* pContent = static_cast<CButtonUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
 		std::wstring wsReason = pContent->GetText();
 
 		wsReason += L"1";
 
 		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
 	}
 	else if (senderName == L"jianpan_2")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+		CButtonUI* pContent = static_cast<CButtonUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
 		std::wstring wsReason = pContent->GetText();
 
 		wsReason += L"2";
 
 		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
 	}
 	else if (senderName == L"jianpan_3")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+		CButtonUI* pContent = static_cast<CButtonUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
 		std::wstring wsReason = pContent->GetText();
 
 		wsReason += L"3";
 
 		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
 	}
 	else if (senderName == L"jianpan_4")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+		CButtonUI* pContent = static_cast<CButtonUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
 		std::wstring wsReason = pContent->GetText();
 
 		wsReason += L"4";
 
 		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
 	}
 	else if (senderName == L"jianpan_5")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+		CButtonUI* pContent = static_cast<CButtonUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
 		std::wstring wsReason = pContent->GetText();
 
 		wsReason += L"5";
 
 		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
 	}
 	else if (senderName == L"jianpan_6")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+		CButtonUI* pContent = static_cast<CButtonUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
 		std::wstring wsReason = pContent->GetText();
 
 		wsReason += L"6";
 
 		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
 	}
 	else if (senderName == L"jianpan_7")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+		CButtonUI* pContent = static_cast<CButtonUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
 		std::wstring wsReason = pContent->GetText();
 
 		wsReason += L"7";
 
 		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
 	}
 	else if (senderName == L"jianpan_8")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+		CButtonUI* pContent = static_cast<CButtonUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
 		std::wstring wsReason = pContent->GetText();
 
 		wsReason += L"8";
 
 		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
 	}
 	else if (senderName == L"jianpan_9")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+		CButtonUI* pContent = static_cast<CButtonUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
 		std::wstring wsReason = pContent->GetText();
 
 		wsReason += L"9";
 
 		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
 	}
 	else if (senderName == L"jianpan_0")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+		CButtonUI* pContent = static_cast<CButtonUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
 		std::wstring wsReason = pContent->GetText();
 
 		wsReason += L"0";
 
 		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
 	}
 	else if (senderName == L"jianpan_x")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+		CButtonUI* pContent = static_cast<CButtonUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
 		std::wstring wsReason = pContent->GetText();
 
 		wsReason = wsReason.substr(0, wsReason.length() - 1);
 
 		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
 	}
 	else if (senderName == L"jianpan_qingkong")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+		CButtonUI* pContent = static_cast<CButtonUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
 		std::wstring wsReason = pContent->GetText();
 
 		wsReason.clear();
 
 		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
 	}
 	else if (senderName == _T("huiiyuan_page_sousuo_btn"))
 	{

+ 45 - 45
zhipuzi_pos_windows/pch/define.h

@@ -1,70 +1,70 @@
 #pragma once
 
-#define WM_SHOWTASK 10001
-#define WM_ONCLOSE 10002
+#define WM_SHOWTASK WM_APP + 10001
+#define WM_ONCLOSE WM_APP + 10002
 
-#define WM_LOGIN_ERROR 10003
-#define WM_LOGIN_SUCCESS 10004
-#define WM_NEED_UPDATE 10005
-#define WM_UPDATEPROGRESS 10006
-#define WM_DOWNLOAD_FINISH 10007
+#define WM_LOGIN_ERROR WM_APP + 10003
+#define WM_LOGIN_SUCCESS WM_APP + 10004
+#define WM_NEED_UPDATE WM_APP + 10005
+#define WM_UPDATEPROGRESS WM_APP + 10006
+#define WM_DOWNLOAD_FINISH WM_APP + 10007
 
-#define WM_ORDERLIST_REFRESH 10008
+#define WM_ORDERLIST_REFRESH WM_APP + 10008
 
-#define WM_LOGIN_AGAIN_OUT 10009
-#define WM_LOGIN_START_INIT_DATA 10010
+#define WM_LOGIN_AGAIN_OUT WM_APP + 10009
+#define WM_LOGIN_START_INIT_DATA WM_APP + 10010
 
-#define WM_ZHENGCAN_SAOMADIANCAI_XIADAN 10011
+#define WM_ZHENGCAN_SAOMADIANCAI_XIADAN WM_APP + 10011
 
 //收款支付相关
-#define WM_SHOUKUAN_STATUS_NEEDPASSWORD 10100
-#define WM_SHOUKUAN_STATUS_SUCCESS 10101
-#define WM_SHOUKUAN_STATUS_FAIL 10102
+#define WM_SHOUKUAN_STATUS_NEEDPASSWORD WM_APP + 10100
+#define WM_SHOUKUAN_STATUS_SUCCESS WM_APP + 10101
+#define WM_SHOUKUAN_STATUS_FAIL WM_APP + 10102
 
-#define WM_TUIKUAN_STATUS_SUCCESS 10103
-#define WM_TUIKUAN_STATUS_FAIL 10104
-#define WM_TUIKUAN_STATUS_NEEDPASSWORD 10105
+#define WM_TUIKUAN_STATUS_SUCCESS WM_APP + 10103
+#define WM_TUIKUAN_STATUS_FAIL WM_APP + 10104
+#define WM_TUIKUAN_STATUS_NEEDPASSWORD WM_APP + 10105
 
 //会员相关消息
-#define WM_MEMBER_CHECK_FAIL 10200
-#define WM_MEMBER_CHECK_SUCCESS 10201
+#define WM_MEMBER_CHECK_FAIL WM_APP + 10200
+#define WM_MEMBER_CHECK_SUCCESS WM_APP + 10201
 
 //称重相关消息
-#define WM_CHENGZHONG_SUCCESS 10301
-#define WM_CHENGZHONG_FAIL 10302
+#define WM_CHENGZHONG_SUCCESS WM_APP + 10301
+#define WM_CHENGZHONG_FAIL WM_APP + 10302
 
 //报表相关的
-#define WM_BAOBIAO_REFRESH 10401
+#define WM_BAOBIAO_REFRESH WM_APP + 10401
 
 //交班相关的
-#define WM_JIAOBAN_REFRESH 10501
+#define WM_JIAOBAN_REFRESH WM_APP + 10501
 
 //设置相关的
-#define WM_SETTING_TONGBU_SUCCESS 10601
-#define WM_SETTING_TONGBU_FAIL 10602
+#define WM_SETTING_TONGBU_SUCCESS WM_APP + 10601
+#define WM_SETTING_TONGBU_FAIL WM_APP + 10602
 
 //商品管理相关的
-#define WM_FOOD_HANDLE_SUCCESS 10701 //异步处理商品添加、修改、删除等的消息
+#define WM_FOOD_HANDLE_SUCCESS WM_APP + 10701 //异步处理商品添加、修改、删除等的消息
 
 //热键相关的
-#define WM_MYHOTKEY_WEIXIN_SHOUKUAN 10801
-#define WM_MYHOTKEY_HUIYUAN_DENGLU 10802
-#define WM_MYHOTKEY_HUIYUAN_SHOUKUAN 10803
-#define WM_MYHOTKEY_XIANJIN_SHOUKUAN 10804
-#define WM_MYHOTKEY_QIANXIANG 10805
-#define WM_MYHOTKEY_LOGOUT 10806
-#define WM_MYHOTKEY_DIANDAN 10807
-#define WM_MYHOTKEY_DINGDAN 10808
-#define WM_MYHOTKEY_HUIYUAN 10809
-#define WM_MYHOTKEY_BAOBIAO 10810
-#define WM_MYHOTKEY_JIAOBAN 10811
-#define WM_MYHOTKEY_SHEZHI 10812
-#define WM_MYHOTKEY_SHANGPIN 10813
-#define WM_MYHOTKEY_KUCUN 10814
-#define WM_MYHOTKEY_CAIGOU 10815
-#define WM_MYHOTKEY_ZHUOTAI 10816
-#define WM_MYHOTKEY_SHOUKUAN 10817
+#define WM_MYHOTKEY_WEIXIN_SHOUKUAN WM_APP + 10801
+#define WM_MYHOTKEY_HUIYUAN_DENGLU WM_APP + 10802
+#define WM_MYHOTKEY_HUIYUAN_SHOUKUAN WM_APP + 10803
+#define WM_MYHOTKEY_XIANJIN_SHOUKUAN WM_APP + 10804
+#define WM_MYHOTKEY_QIANXIANG WM_APP + 10805
+#define WM_MYHOTKEY_LOGOUT WM_APP + 10806
+#define WM_MYHOTKEY_DIANDAN WM_APP + 10807
+#define WM_MYHOTKEY_DINGDAN WM_APP + 10808
+#define WM_MYHOTKEY_HUIYUAN WM_APP + 10809
+#define WM_MYHOTKEY_BAOBIAO WM_APP + 10810
+#define WM_MYHOTKEY_JIAOBAN WM_APP + 10811
+#define WM_MYHOTKEY_SHEZHI WM_APP + 10812
+#define WM_MYHOTKEY_SHANGPIN WM_APP + 10813
+#define WM_MYHOTKEY_KUCUN WM_APP + 10814
+#define WM_MYHOTKEY_CAIGOU WM_APP + 10815
+#define WM_MYHOTKEY_ZHUOTAI WM_APP + 10816
+#define WM_MYHOTKEY_SHOUKUAN WM_APP + 10817
 
 //AI识别相关的
-#define WM_AI_RECOGNITION_SUCCESS 10901
-#define WM_AI_XUEXI_UPDATE 10902
+#define WM_AI_RECOGNITION_SUCCESS WM_APP + 10901
+#define WM_AI_XUEXI_UPDATE WM_APP + 10902

+ 3 - 0
zhipuzi_pos_windows/tool/CAppEnv.cpp

@@ -106,6 +106,9 @@ void CAppEnv::AsyncInit()
 {
 	this->AddWorkerNum();
 
+	//关闭虚拟键盘的自动显示,程序来根据焦点控制
+	CSystem::SetTouchKeyboardAutoInvoke(false);
+
 	//初始化副屏
 	CShuangpingTool::GetInstance()->Init();
 

+ 8 - 8
zhipuzi_pos_windows/ui/TouchWindowBase.cpp → zhipuzi_pos_windows/ui/CTouchWindowBase.cpp

@@ -1,4 +1,4 @@
-#include "TouchWindowBase.h"
+#include "CTouchWindowBase.h"
 #include <vector>
 #include <cmath>
 
@@ -7,22 +7,22 @@
 #define TOUCH_COORD_TO_PIXEL(l) ((l) / 100)
 #endif
 
-TouchWindowBase::TouchWindowBase()
+CTouchWindowBase::CTouchWindowBase()
 {
 }
 
-TouchWindowBase::~TouchWindowBase()
+CTouchWindowBase::~CTouchWindowBase()
 {
 	StopInertia();
 }
 
-std::int64_t TouchWindowBase::NowMs() const
+std::int64_t CTouchWindowBase::NowMs() const
 {
 	using namespace std::chrono;
 	return duration_cast<milliseconds>(steady_clock::now().time_since_epoch()).count();
 }
 
-void TouchWindowBase::AddTouchSample(LONG y)
+void CTouchWindowBase::AddTouchSample(LONG y)
 {
 	std::int64_t t = NowMs();
 	m_samples.push_back({ t, y });
@@ -35,7 +35,7 @@ void TouchWindowBase::AddTouchSample(LONG y)
 		m_samples.pop_front();
 }
 
-void TouchWindowBase::StartInertia(float velocityPxPerMs)
+void CTouchWindowBase::StartInertia(float velocityPxPerMs)
 {
 	if (m_inertiaActive)
 		StopInertia();
@@ -53,7 +53,7 @@ void TouchWindowBase::StartInertia(float velocityPxPerMs)
 	m_inertiaActive = (m_inertiaTimerId != 0);
 }
 
-void TouchWindowBase::StopInertia()
+void CTouchWindowBase::StopInertia()
 {
 	if (m_inertiaActive && m_inertiaTimerId)
 	{
@@ -64,7 +64,7 @@ void TouchWindowBase::StopInertia()
 	m_inertiaVelocityPxPerMs = 0.0f;
 }
 
-LRESULT TouchWindowBase::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
+LRESULT CTouchWindowBase::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
 	switch (uMsg)
 	{

+ 64 - 0
zhipuzi_pos_windows/ui/CTouchWindowBase.h

@@ -0,0 +1,64 @@
+#pragma once
+
+#include "../pch/pch.h"
+#include <deque>
+#include <chrono>
+
+class CTouchWindowBase : public DuiLib::CWindowWnd
+{
+public:
+	CTouchWindowBase();
+	virtual ~CTouchWindowBase();
+
+	// 必须设置为 DuiLib 的 paint 窗口(CPaintManagerUI 创建的窗口)
+	void SetPaintWindow(HWND hWndPaint)
+	{
+		m_hWndPaint = hWndPaint;
+	}
+
+	virtual LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
+
+protected:
+	HWND m_hWndPaint = NULL;
+
+	// touch 状态
+	bool m_touchDown = false;
+	LONG m_lastY = 0;
+	int m_accumWheel = 0; // 累积 wheel 值(单位 wheel delta)
+
+	// 保存最后一次触摸的点(目标 paint 窗口的客户区坐标),用于惯性期间发送位置
+	POINT m_lastTouchPt = { 0, 0 };
+
+	// 每像素转多少 wheel units(可调节灵敏度)
+	// wheelUnits = dy * PIXEL_TO_WHEEL,后面按 WHEEL_DELTA(120) 做累积阈值
+	static constexpr float PIXEL_TO_WHEEL = 8.0f; // 约 15px -> 120,按需调整
+
+	// 采样用于计算速度
+	struct TouchSample
+	{
+		std::int64_t tms; // ms
+		LONG y;
+	};
+	std::deque<TouchSample> m_samples; // 保留最近若干样本
+
+	// 惯性滚动状态
+	bool m_inertiaActive = false;
+	float m_inertiaVelocityPxPerMs = 0.0f; // 像素每毫秒
+	UINT_PTR m_inertiaTimerId = 0;
+	std::int64_t m_lastInertiaTms = 0;
+
+	// 惯性参数(可调)
+	static constexpr int INERTIA_TIMER_ID = 0xA001;
+	static constexpr int INERTIA_TIMER_INTERVAL_MS = 16; // 约 60 FPS
+	// 衰减系数按每毫秒指数衰减: velocity *= pow(INERTIA_DECAY_PER_MS, dt)
+	static constexpr float INERTIA_DECAY_PER_MS = 0.995f; // 值接近 1,越接近 1 惯性持续越久
+	static constexpr float MIN_INERTIA_VELOCITY = 0.02f; // px/ms,低于则停止
+	static constexpr int SAMPLE_WINDOW_MS = 120; // 计算速度时回溯的时间窗口
+	static constexpr int MAX_SAMPLE_COUNT = 8;
+
+	// 内部方法
+	void AddTouchSample(LONG y);
+	void StartInertia(float velocityPxPerMs);
+	void StopInertia();
+	std::int64_t NowMs() const;
+};

+ 0 - 64
zhipuzi_pos_windows/ui/TouchWindowBase.h

@@ -1,64 +0,0 @@
-#pragma once
-
-#include "../pch/pch.h"
-#include <deque>
-#include <chrono>
-
-class TouchWindowBase : public DuiLib::CWindowWnd
-{
-public:
-	TouchWindowBase();
-	virtual ~TouchWindowBase();
-
-	// 必须设置为 DuiLib 的 paint 窗口(CPaintManagerUI 创建的窗口)
-	void SetPaintWindow(HWND hWndPaint)
-	{
-		m_hWndPaint = hWndPaint;
-	}
-
-	virtual LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
-
-protected:
-	HWND m_hWndPaint = NULL;
-
-	// touch 状态
-	bool m_touchDown = false;
-	LONG m_lastY = 0;
-	int m_accumWheel = 0; // 累积 wheel 值(单位 wheel delta)
-
-	// 保存最后一次触摸的点(目标 paint 窗口的客户区坐标),用于惯性期间发送位置
-	POINT m_lastTouchPt = { 0, 0 };
-
-	// 每像素转多少 wheel units(可调节灵敏度)
-	// wheelUnits = dy * PIXEL_TO_WHEEL,后面按 WHEEL_DELTA(120) 做累积阈值
-	static constexpr float PIXEL_TO_WHEEL = 8.0f; // 约 15px -> 120,按需调整
-
-	// 采样用于计算速度
-	struct TouchSample
-	{
-		std::int64_t tms; // ms
-		LONG y;
-	};
-	std::deque<TouchSample> m_samples; // 保留最近若干样本
-
-	// 惯性滚动状态
-	bool m_inertiaActive = false;
-	float m_inertiaVelocityPxPerMs = 0.0f; // 像素每毫秒
-	UINT_PTR m_inertiaTimerId = 0;
-	std::int64_t m_lastInertiaTms = 0;
-
-	// 惯性参数(可调)
-	static constexpr int INERTIA_TIMER_ID = 0xA001;
-	static constexpr int INERTIA_TIMER_INTERVAL_MS = 16; // 约 60 FPS
-	// 衰减系数按每毫秒指数衰减: velocity *= pow(INERTIA_DECAY_PER_MS, dt)
-	static constexpr float INERTIA_DECAY_PER_MS = 0.995f; // 值接近 1,越接近 1 惯性持续越久
-	static constexpr float MIN_INERTIA_VELOCITY = 0.02f; // px/ms,低于则停止
-	static constexpr int SAMPLE_WINDOW_MS = 120; // 计算速度时回溯的时间窗口
-	static constexpr int MAX_SAMPLE_COUNT = 8;
-
-	// 内部方法
-	void AddTouchSample(LONG y);
-	void StartInertia(float velocityPxPerMs);
-	void StopInertia();
-	std::int64_t NowMs() const;
-};

+ 9 - 8
zhipuzi_pos_windows/wnd/CMainWnd.cpp

@@ -64,8 +64,8 @@ void CMainWnd::Init()
 	//启动一个线程,开始同步商品图片
 	std::thread(&CMainWnd::UpdateFoodImage, this).detach();
 
-	//展示虚拟键盘(暂时测试用,不完善)
-	CSystem::SetTouchKeyboardAutoInvoke(true);
+	//手动关闭一次键盘,避免被手动打开了
+	//CSystem::HideSystemKeyboard();
 }
 
 void CMainWnd::End()
@@ -236,6 +236,7 @@ void CMainWnd::Notify(TNotifyUI& msg)
 {
 	CDuiString name = msg.pSender->GetName();
 	std::wstring senderName = name;
+	std::wstring senderClassName = msg.pSender->GetClass();
 
     if(msg.sType == _T("windowinit"))
     {
@@ -272,16 +273,16 @@ void CMainWnd::Notify(TNotifyUI& msg)
 			m_IsKuaijiejian = false;
 		}
 
-		if (senderName == L"diandan_food_search_edit")
+		if (senderClassName == L"EditUI")
 		{
-			//CSystem::HideSystemKeyboard();
+			CSystem::HideSystemKeyboard();
 		}
 	}
 	else if (msg.sType == _T("setfocus"))
 	{
-		if (senderName == L"diandan_food_search_edit")
+		if (senderClassName == L"EditUI")
 		{
-			//CSystem::ShowSystemKeyboard(m_hWnd);
+			CSystem::ShowSystemKeyboard(m_hWnd);
 		}
 	}
 }
@@ -468,7 +469,7 @@ LRESULT CMainWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
         return lRes;
     }
 
-    return TouchWindowBase::HandleMessage(uMsg, wParam, lParam);
+    return CTouchWindowBase::HandleMessage(uMsg, wParam, lParam);
 }
 
 bool CMainWnd::HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -1016,7 +1017,7 @@ LRESULT CMainWnd::OnHotKey(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandl
 		this->SwitchPageByName(L"main_shoukuan");
 	}
 
-	m_pm.SetFocus(NULL);
+	//m_pm.SetFocus(NULL);
 
 	bHandled = TRUE;
 	return  0;

+ 2 - 2
zhipuzi_pos_windows/wnd/CMainWnd.h

@@ -7,11 +7,11 @@
 
 #include "../page/CBasePageUI.h"
 
-#include "../ui/TouchWindowBase.h"
+#include "../ui/CTouchWindowBase.h"
 
 class CMessagePush;
 
-class CMainWnd : public TouchWindowBase, public INotifyUI, public IMessageFilterUI
+class CMainWnd : public CTouchWindowBase, public INotifyUI, public IMessageFilterUI
 {
 public:
 	enum MainPageName

+ 6 - 4
zhipuzi_pos_windows/wnd/CMemoWnd.cpp

@@ -1,4 +1,4 @@
-#include "../pch/pch.h"
+锘�#include "../pch/pch.h"
 #include "CMemoWnd.h"
 
 LRESULT CMemoWnd::OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
@@ -108,7 +108,7 @@ LRESULT CMemoWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandl
 	styleValue &= ~WS_CAPTION;
 	::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
 
-	// 把自己的窗口句柄与窗口绘制管理器挂接在一起
+	// 鎶婅嚜宸辩殑绐楀彛鍙ユ焺涓庣獥鍙g粯鍒剁�鐞嗗櫒鎸傛帴鍦ㄤ竴璧�
 	m_pm.Init(m_hWnd);
 
 	m_pm.AddPreMessageFilter(this);
@@ -118,10 +118,10 @@ LRESULT CMemoWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandl
 	CControlUI* pRoot = builder.Create(_T("memo_edit_dlg.xml"), (UINT)0, NULL, &m_pm);
 	ASSERT(pRoot && "Failed to parse XML");
 
-	// 把这些控件绘制到本窗口上
+	// 鎶婅繖浜涙帶浠剁粯鍒跺埌鏈�獥鍙d笂
 	m_pm.AttachDialog(pRoot);
 
-	// 把自己加入到CPaintManagerUI的m_aNotifiers数组中,用于处理Notify函数
+	// 鎶婅嚜宸卞姞鍏ュ埌CPaintManagerUI鐨刴_aNotifiers鏁扮粍涓�紝鐢ㄤ簬澶勭悊Notify鍑芥暟
 	m_pm.AddNotifier(this);
 
 	Init();
@@ -152,6 +152,8 @@ void CMemoWnd::Notify(TNotifyUI& msg)
 		CEditUI* pFukuanEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("content")));
 		pFukuanEdit->SetFocus();
 	}
+
+	CModalWnd::Notify(msg);
 }
 
 void CMemoWnd::Init()

+ 22 - 2
zhipuzi_pos_windows/wnd/CModalWnd.cpp

@@ -1,10 +1,30 @@
+#include "../pch/pch.h"
 #include "CModalWnd.h"
 
-
-
 CModalWnd::CModalWnd()
 {
 }
 
+CModalWnd::~CModalWnd()
+{
+	CSystem::HideSystemKeyboard();
+}
+
+void CModalWnd::Notify(DuiLib::TNotifyUI& msg)
+{
+	const std::wstring senderClassName = msg.pSender->GetClass();
 
+	if (senderClassName != L"EditUI")
+	{
+		return;
+	}
 
+	if (msg.sType == _T("setfocus"))
+	{
+		CSystem::ShowSystemKeyboard(m_hWnd);
+	}
+	else if (msg.sType == _T("killfocus"))
+	{
+		CSystem::HideSystemKeyboard();
+	}
+}

+ 7 - 8
zhipuzi_pos_windows/wnd/CModalWnd.h

@@ -1,18 +1,17 @@
-#pragma once
+锘�#pragma once
 
-#include "../pch/pch.h"
-
-//这个是所有模态对话框的基类
+//杩欎釜鏄�墍鏈夋ā鎬佸�璇濇�鐨勫熀绫�
 class CModalWnd : public CWindowWnd, public INotifyUI, public IMessageFilterUI
 {
 public:
 	CModalWnd();
 	
-	virtual ~CModalWnd()
+	~CModalWnd()
 	{
 	}
 
-	//处理键盘捕捉结果
-	virtual void HandleTextCapture(std::string content) = 0;
-};
+	void Notify(DuiLib::TNotifyUI& msg) override;
 
+	//澶勭悊閿�洏鎹曟崏缁撴灉
+	virtual void HandleTextCapture(std::string content) = 0;
+};

+ 2 - 2
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj

@@ -246,7 +246,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     <ClInclude Include="ai\YoloFeatureManager.h" />
     <ClInclude Include="control\CFoodXuexiImageItemUI.h" />
     <ClInclude Include="page\CAIxuexiPageUI.h" />
-    <ClInclude Include="ui\TouchWindowBase.h" />
+    <ClInclude Include="ui\CTouchWindowBase.h" />
     <ClInclude Include="worker\CDiandanAIShibieWorker.h" />
     <ClInclude Include="tool\CVideoCapture.h" />
     <ClInclude Include="sqlite3\sqlite-vec.h" />
@@ -376,7 +376,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     <ClCompile Include="control\CFoodXuexiImageItemUI.cpp" />
     <ClCompile Include="sqlite3\shell.c" />
     <ClCompile Include="page\CAIxuexiPageUI.cpp" />
-    <ClCompile Include="ui\TouchWindowBase.cpp" />
+    <ClCompile Include="ui\CTouchWindowBase.cpp" />
     <ClCompile Include="worker\CDiandanAIShibieWorker.cpp" />
     <ClCompile Include="tool\CVideoCapture.cpp" />
     <ClCompile Include="sqlite3\sqlite-vec.c" />

+ 2 - 2
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj.filters

@@ -393,7 +393,7 @@
     <ClInclude Include="page\CAIxuexiPageUI.h">
       <Filter>头文件</Filter>
     </ClInclude>
-    <ClInclude Include="ui\TouchWindowBase.h">
+    <ClInclude Include="ui\CTouchWindowBase.h">
       <Filter>头文件</Filter>
     </ClInclude>
     <ClInclude Include="control\CFoodXuexiImageItemUI.h">
@@ -746,7 +746,7 @@
     <ClCompile Include="page\CAIxuexiPageUI.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
-    <ClCompile Include="ui\TouchWindowBase.cpp">
+    <ClCompile Include="ui\CTouchWindowBase.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
     <ClCompile Include="control\CFoodXuexiImageItemUI.cpp">