From c3aa662297c2182de2e7a53d7bf63f4ab6b1adbd Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 15 九月 2025 17:29:22 +0800
Subject: [PATCH] 1.千传调度调整,修改为物料从哪个Port, 那个Slot搬出就最终终回哪个位置 ;
---
SourceCode/Bond/Servo/CExpandableListCtrl.cpp | 80 +++++++++++++++++++++++++++++++++++++++
1 files changed, 79 insertions(+), 1 deletions(-)
diff --git a/SourceCode/Bond/Servo/CExpandableListCtrl.cpp b/SourceCode/Bond/Servo/CExpandableListCtrl.cpp
index 7b1e307..ef21ed0 100644
--- a/SourceCode/Bond/Servo/CExpandableListCtrl.cpp
+++ b/SourceCode/Bond/Servo/CExpandableListCtrl.cpp
@@ -3,7 +3,11 @@
IMPLEMENT_DYNAMIC(CExpandableListCtrl, CListCtrl)
-CExpandableListCtrl::CExpandableListCtrl() {}
+CExpandableListCtrl::CExpandableListCtrl()
+{
+ m_popupCols = { };
+}
+
CExpandableListCtrl::~CExpandableListCtrl() {}
BEGIN_MESSAGE_MAP(CExpandableListCtrl, CListCtrl)
@@ -249,6 +253,38 @@
}
}
}
+
+ // 鈥斺�� 鑻ョ偣鍑诲埌闇�瑕佲�滃叏鏂囨樉绀衡�濈殑鍒楋紝鍒欏悜鐖剁獥鍙e彂閫佽嚜瀹氫箟閫氱煡 鈥斺�� //
+ if (!m_popupCols.empty()) {
+ LPNMITEMACTIVATE pia = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
+
+ // 鐢� SubItemHitTest 鏇寸簿鍑嗘嬁鍒板垪
+ LVHITTESTINFO ht{};
+ ht.pt = pia->ptAction;
+ int hit = SubItemHitTest(&ht);
+ if (hit >= 0 && ht.iItem >= 0 && ht.iSubItem >= 0) {
+ const int row = ht.iItem;
+ const int col = ht.iSubItem;
+
+ if (m_popupCols.count(col)) {
+ CString full = GetItemText(row, col);
+ if (!full.IsEmpty() && _IsCellTruncated(row, col, full)) {
+ NMC_ELC_SHOWFULLTEXT nm{};
+ nm.hdr.hwndFrom = m_hWnd;
+ nm.hdr.idFrom = GetDlgCtrlID();
+ nm.hdr.code = ELCN_SHOWFULLTEXT;
+ nm.iItem = row;
+ nm.iSubItem = col;
+ nm.text = full;
+
+ if (CWnd* pParent = GetParent()) {
+ pParent->SendMessage(WM_NOTIFY, nm.hdr.idFrom, reinterpret_cast<LPARAM>(&nm));
+ }
+ }
+ }
+ }
+ }
+
*pResult = 0;
}
@@ -425,3 +461,45 @@
return nRet;
}
+
+// CExpandableListCtrl.cpp 閲�
+void CExpandableListCtrl::ClearTree()
+{
+ // 娓呮暟鎹�
+ m_roots.clear();
+ m_visible.clear();
+
+ // 娓呭彲瑙侀」锛堝姟蹇咃紒鍚﹀垯鏃ч〉鐨勮浼氭畫鐣欙級
+ SetRedraw(FALSE);
+ DeleteAllItems();
+ SetRedraw(TRUE);
+
+ Invalidate();
+}
+
+void CExpandableListCtrl::SetPopupFullTextColumns(const std::vector<int>& cols)
+{
+ m_popupCols.clear();
+ for (int c : cols) m_popupCols.insert(c);
+}
+
+bool CExpandableListCtrl::_IsCellTruncated(int row, int col, const CString& text) const
+{
+ if (text.IsEmpty()) return false;
+
+ // 鍗曞厓鏍兼樉绀哄尯鍩熷搴�
+ CRect rcCell;
+ if (!const_cast<CExpandableListCtrl*>(this)->GetSubItemRect(row, col, LVIR_BOUNDS, rcCell))
+ return false;
+
+ // 鐢ㄦ帶浠跺瓧浣撴祴閲忔枃鏈儚绱犲
+ CClientDC dc(const_cast<CExpandableListCtrl*>(this));
+ CFont* pOld = dc.SelectObject(const_cast<CExpandableListCtrl*>(this)->GetFont());
+ CSize sz = dc.GetTextExtent(text);
+ dc.SelectObject(pOld);
+
+ const int kPadding = 8; // 棰勭暀涓�鐐硅竟璺�/鐪佺暐鍙蜂綑閲�
+ return sz.cx > (rcCell.Width() - kPadding);
+}
+
+
--
Gitblit v1.9.3