| SourceCode/Bond/BLControlsSDK/include/BLLabel.h | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/BondEq/View/AxisSettingsDlg.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/BondEq/View/IOMonitoringDlg.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
SourceCode/Bond/BLControlsSDK/include/BLLabel.h
@@ -38,11 +38,20 @@ CBLLabel& FlashBackground(BOOL bActivate); // 闪烁背景 CBLLabel& SetLink(BOOL bLink); // 设置是否启用超链接 CBLLabel& SetLinkCursor(HCURSOR hCursor); // 设置超链接光标 CBLLabel& DisableBorder(); // 禁用边框 CBLLabel& SetBorderColor(COLORREF crBorder); // 设置边框颜色 CBLLabel& SetBorderWidth(int nWidth); // 设置边框宽度 CBLLabel& SetBorderStyle(int nStyle); // 设置边框样式 CBLLabel& SetDefaultCursor(HCURSOR hCursor); // 设置默认光标 CBLLabel& SetHandCursor(HCURSOR hCursor); // 设置手型光标 CBLLabel& SetRoundedCorners(BOOL bEnable, int nRadius); // 设置圆角及半径 CBLLabel& SetCornerRadius(int nTopLeft, int nTopRight, int nBottomRight, int nBottomLeft); // 设置各角圆角半径 protected: // 工具函数 void ReconstructFont(); // 重新构造字体 void UpdateFontSize(); // 动态调整字体大小 void CreateRoundedRegion(CRgn& rgn, const CRect& rect); // 创建圆角区域 virtual void OnPaint(); // 自定义绘制文本 // 属性 @@ -59,6 +68,23 @@ TextAlign m_alignment; // 文本对齐方式 FlashType m_Type; // 闪烁类型 HCURSOR m_hCursor; // 超链接光标 // 边框属性 COLORREF m_crBorderColor; // 边框颜色 int m_nBorderWidth; // 边框宽度 int m_nBorderStyle; // 边框样式(使用 GDI 样式:PS_SOLID, PS_DASH 等) // 圆角相关属性 BOOL m_bRoundedCorners; // 是否启用圆角 int m_nTopLeftRadius; // 左上角圆角半径 int m_nTopRightRadius; // 右上角圆角半径 int m_nBottomRightRadius; // 右下角圆角半径 int m_nBottomLeftRadius; // 左下角圆角半径 // 鼠标事件相关属性 BOOL m_bMouseIn; // 鼠标是否在控件上 HCURSOR m_hHandCursor; // 手型光标 HCURSOR m_hDefaultCursor; // 默认光标 std::function<void()> m_clickCallback; // 点击事件的回调函数 protected: @@ -66,8 +92,9 @@ virtual HBRUSH CtlColor(CDC* pDC, UINT nCtlColor); // 背景和文本颜色设置 afx_msg void OnTimer(UINT_PTR nIDEvent); // 定时器事件 afx_msg void OnLButtonDown(UINT nFlags, CPoint point); // 鼠标点击事件 afx_msg void OnMouseMove(UINT nFlags, CPoint point); // 鼠标移动事件 afx_msg void OnMouseLeave(); // 鼠标离开事件 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); // 设置光标事件 DECLARE_MESSAGE_MAP() }; SourceCode/Bond/BondEq/View/AxisSettingsDlg.cpp
@@ -1294,15 +1294,20 @@ if (ret != IDOK) { return; } writeAxisDataToPLC(axisId); Sleep(2000); refreshAxisDetails(axisId); refreshPositionDetails(axisId, m_currentPage); if (RecipeManager::getInstance().saveRecipe(std::string(CT2A(m_strRecipeName)))) { cstrMessage.Format(_T("保存轴 [%d] 参数到文件成功!"), axisId); SystemLogManager::getInstance().log(SystemLogManager::LogType::Operation, std::string(CT2A(cstrMessage))); updateDataFromUI(axisId); if (RecipeManager::getInstance().saveRecipe(std::string(CT2A(m_strRecipeName)))) { writeAxisDataToPLC(axisId); cstrMessage.Format(_T("保存轴 [%d] 参数成功!"), axisId); SystemLogManager::getInstance().log(SystemLogManager::LogType::Operation, std::string(CT2A(cstrMessage))); } else { cstrMessage.Format(_T("保存轴 [%d] 参数失败!"), axisId); cstrMessage.Format(_T("保存轴 [%d] 参数到文件失败!"), axisId); SystemLogManager::getInstance().log(SystemLogManager::LogType::Error, std::string(CT2A(cstrMessage))); } @@ -1321,9 +1326,6 @@ // 更新Labels状态 UpdateLabels(); // 更新定位点 //refreshPositionDetails(getCurrentSelectedAxisID(), m_currentPage); // OPR按钮是否要闪烁或停止闪烁 // 06.0和08.0 SourceCode/Bond/BondEq/View/IOMonitoringDlg.cpp
@@ -214,8 +214,8 @@ // 创建动态控件 CBLLabel* pStatic = new CBLLabel(); DWORD style = WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE; // 确保垂直居中 if (hasBorder) { style |= WS_BORDER; // 添加边框 if (!hasBorder) { pStatic->DisableBorder(); } pStatic->Create(text, style, CRect(x, y, x + width, y + height), this, id); @@ -234,6 +234,8 @@ UserRole enRole = userManager.getCurrentUserRole(); if (clickCallback && (enRole == UserRole::SuperAdmin || enRole == UserRole::Operator)) { pStatic->SetClickCallback(clickCallback); pStatic->SetRoundedCorners(TRUE, 5); pStatic->DisableBorder(); } // 存储控件指针