Procházet zdrojové kódy

修复焦点问题

张洋 před 1 týdnem
rodič
revize
ce27a781e8

+ 0 - 0
.github/copilot-instructions.md


+ 1 - 1
DuiLib/Control/UIEdit.cpp

@@ -282,7 +282,7 @@ namespace DuiLib
 		}
 		if( event.Type == UIEVENT_WINDOWSIZE )
 		{
-			if( m_pWindow != NULL ) m_pManager->SetFocusNeeded(this);
+			//if( m_pWindow != NULL ) m_pManager->SetFocusNeeded(this);
 		}
 		if( event.Type == UIEVENT_SCROLLWHEEL )
 		{

+ 3 - 1
DuiLib/Core/UIManager.cpp

@@ -1158,7 +1158,9 @@ namespace DuiLib
 				// Set focus to first control?
 				if (m_bFocusNeeded)
 				{
-					SetNextTabControl();
+					//修复新窗口自动切换焦点的问题
+					//SetNextTabControl();
+					m_bFocusNeeded = false;
 				}
 
 				SetPainting(true);

binární
bin/Win32/Debug/zhipuzi_pos_windows/DuiLib_d.dll


+ 1 - 1
bin/Win32/Debug/zhipuzi_pos_windows/skin/chufang_printer_setting.xml

@@ -17,7 +17,7 @@
 			<HorizontalLayout height="56" valign="center">
 				<Label text="IP地址" width="160" />
 				<Edit name="chufang_setting_ip" width="150" height="32" padding="0,12,0,12" normalimage="file='Chat_InputBox_BG.png' corner='4,4,4,4'" hotimage="file='Chat_InputBox_BG_Hover.png' corner='4,4,4,4'" />
-				<Label name="chufang_setting_ip_error" text="IP地址格式不正确" padding="20,0,0,0" textcolor="#FFFF0000" />
+				<Label name="chufang_setting_ip_error" text="IP地址格式不正确" padding="20,0,0,0" textcolor="#FFFF0000" visible="false"/>
 			</HorizontalLayout>
 
 			<HorizontalLayout height="56" valign="center">

binární
dll/debug/DuiLib_d.dll


binární
temp/link/Win32/Debug/DuiLib/DuiLib_d.pdb


+ 14 - 7
zhipuzi_pos_windows/wnd/CChufangSettingWnd.cpp

@@ -88,21 +88,22 @@ LRESULT CChufangSettingWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lPar
 	{
 		if (wParam == VK_RETURN)
 		{
-			return true;
+			bHandled = true;
+			return 0;
 		}
 		else if (wParam == VK_ESCAPE)
 		{
-			return true;
+			bHandled = true;
+			return 0;
 		}
 	}
-	return false;
+	
+	bHandled = false;
+	return 0;
 }
 
 void CChufangSettingWnd::Init()
 {
-	CLabelUI* ip_error = static_cast<CLabelUI*>(m_pm.FindControl(_T("chufang_setting_ip_error")));
-	ip_error->SetVisible(false);
-
 	CLabelUI* title = static_cast<CLabelUI*>(m_pm.FindControl(_T("chufang_setting_title")));
 	if (m_mode == 1)
 	{
@@ -244,6 +245,12 @@ void CChufangSettingWnd::Init()
 
 void CChufangSettingWnd::Notify(TNotifyUI& msg)
 {
+	if (msg.sType == _T("setfocus"))
+	{
+		::OutputDebugString(msg.pSender->GetName());
+		::OutputDebugString(L"\r\n");
+	}
+
 	if (msg.sType == _T("click"))
 	{
 		DuiLib::CDuiString senderName = msg.pSender->GetName();
@@ -362,7 +369,7 @@ LRESULT CChufangSettingWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BO
 	m_pm.Init(m_hWnd);
 
 	m_pm.AddPreMessageFilter(this);
-
+	
 	CDialogBuilder builder;
 
 	CControlUI* pRoot = builder.Create(_T("chufang_printer_setting.xml"), (UINT)0, NULL, &m_pm);

+ 0 - 11
zhipuzi_pos_windows/wnd/CMainWnd.cpp

@@ -187,17 +187,6 @@ void CMainWnd::SwitchPage(MainPageName name, bool is_init_show)
 	{
 		pChildContainer->InitShow();
 	}
-
-	//根据AI识别的设置,启动或者暂停AI识别【在进入点单页面的时候设置刚好合适】
-	std::string is_ai_shibie = CSetting::GetInstance()->GetParam("setting_is_ai_recognition_open");
-	if (is_ai_shibie == "1")
-	{
-		CDiandanAIShibieWorker::GetInstance()->StartAIShibie();
-	}
-	else
-	{
-		CDiandanAIShibieWorker::GetInstance()->StopAIShibie();
-	}
 }
 
 LRESULT CMainWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)