Browse Source

完成点单页面,开始修改其他页面

张洋 1 month ago
parent
commit
9ae6646689
2 changed files with 20 additions and 8 deletions
  1. 2 8
      zhipuzi_pos_windows/page/CDiandanPageUI.cpp
  2. 18 0
      zhipuzi_pos_windows/wnd/CMainWnd.cpp

+ 2 - 8
zhipuzi_pos_windows/page/CDiandanPageUI.cpp

@@ -693,11 +693,11 @@ void CDiandanPageUI::UpdateJiesuanZhifuPos()
 	int nZhangdanWidth;
 	if (m_is_yincangyouhui == true)
 	{
-		nZhangdanWidth = nWidth - 481 - 5;				// 隐藏优惠后只剩账单卡,占满剩余宽度
+		nZhangdanWidth = nWidth - 481 - 13;				// 隐藏优惠后只剩账单卡;13=右侧 inset12 + 余量1
 	}
 	else
 	{
-		nZhangdanWidth = nWidth - 481 - 330 - 12 - 5;	// 优惠卡330 + 卡间距12 + 余量5
+		nZhangdanWidth = nWidth - 481 - 330 - 12 - 13;	// 优惠卡330 + 卡间距12;13=右侧 inset12 + 余量1
 	}
 
 	if (nZhangdanWidth < 300)
@@ -3993,9 +3993,6 @@ void CDiandanPageUI::StartSearchFood(std::string foodname)
 
 	m_sousuo_foodname = foodname;
 
-	CLabelUI* pTishi = static_cast<CLabelUI*>(this->FindSubControl(_T("diandan_food_search_tishi")));
-	pTishi->SetVisible(false);
-
 	this->InitFoodShow();
 }
 
@@ -4012,9 +4009,6 @@ void CDiandanPageUI::StopSerachFood()
 
 	m_cur_type_id = m_type_id_before_sousuo;
 
-	CLabelUI* pTishi = static_cast<CLabelUI*>(this->FindSubControl(_T("diandan_food_search_tishi")));
-	pTishi->SetVisible(true);
-
 	this->InitFoodShow();
 }
 

+ 18 - 0
zhipuzi_pos_windows/wnd/CMainWnd.cpp

@@ -265,6 +265,17 @@ void CMainWnd::Notify(TNotifyUI& msg)
 		if (senderClassName == L"EditUI")
 		{
 			CSystem::HideSystemKeyboard();
+
+			// 点餐页商品搜索框:失去焦点且内容为空时恢复占位提示语
+			if (name == _T("diandan_food_search_edit"))
+			{
+				CControlUI* pEdit = m_pm.FindControl(_T("diandan_food_search_edit"));
+				CControlUI* pTishi = m_pm.FindControl(_T("diandan_food_search_tishi"));
+				if (pEdit != NULL && pTishi != NULL)
+				{
+					if (pEdit->GetText().IsEmpty()) pTishi->SetVisible(true);
+				}
+			}
 		}
 	}
 	else if (msg.sType == _T("setfocus"))
@@ -275,6 +286,13 @@ void CMainWnd::Notify(TNotifyUI& msg)
 			{
 				CSystem::ShowSystemKeyboard(m_hWnd);
 			}
+
+			// 点餐页商品搜索框:获得焦点即隐藏占位提示语,避免与光标/输入文字重叠
+			if (name == _T("diandan_food_search_edit"))
+			{
+				CControlUI* pTishi = m_pm.FindControl(_T("diandan_food_search_tishi"));
+				if (pTishi != NULL) pTishi->SetVisible(false);
+			}
 		}
 	}
 }