From d2e6f402c0705170c83cffef1b09bf3994a9127f Mon Sep 17 00:00:00 2001
From: LAPTOP-T815PCOQ\25526 <mr.liuyang@126.com>
Date: 星期一, 13 一月 2025 16:56:39 +0800
Subject: [PATCH] Merge branch 'master' into liuyang
---
SourceCode/Bond/BoounionPLC/BoounionPLC.rc | 0
SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp | 5 ++++-
SourceCode/Bond/BoounionPLC/Common.h | 1 +
SourceCode/Bond/BoounionPLC/PlcView.cpp | 13 +++++++++++++
SourceCode/Bond/BoounionPLC/PlcView.h | 2 ++
SourceCode/Bond/BoounionPLC/AxisSettingsDlg.cpp | 1 +
6 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/SourceCode/Bond/BoounionPLC/AxisSettingsDlg.cpp b/SourceCode/Bond/BoounionPLC/AxisSettingsDlg.cpp
index 9492fdf..2d66d4c 100644
--- a/SourceCode/Bond/BoounionPLC/AxisSettingsDlg.cpp
+++ b/SourceCode/Bond/BoounionPLC/AxisSettingsDlg.cpp
@@ -175,6 +175,7 @@
void CAxisSettingsDlg::UpdatePageButtonStates()
{
for (int i = 0; i < AXIS_PAGE_SIZE; ++i) {
+ m_pBlBtns[i]->SetFrameColor(BTN_PAGE_FRAME_COLOR);
BOOL bSelect = (i + 1 == m_currentPage);
m_pBlBtns[i]->SetFaceColor(bSelect ?
BTN_PAGE_FACE_SELECT_COLOR: BTN_PAGE_FACE_NORMAL_COLOR);
diff --git a/SourceCode/Bond/BoounionPLC/BoounionPLC.rc b/SourceCode/Bond/BoounionPLC/BoounionPLC.rc
index 82b9000..e661b4b 100644
--- a/SourceCode/Bond/BoounionPLC/BoounionPLC.rc
+++ b/SourceCode/Bond/BoounionPLC/BoounionPLC.rc
Binary files differ
diff --git a/SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp b/SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp
index 3da6b35..70c30d3 100644
--- a/SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp
+++ b/SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp
@@ -126,7 +126,10 @@
}
ASSERT(m_pActiveView);
if (m_pActiveView->GetContext() != (void*)pPlc) {
- m_pActiveView->SetWindowText(pPlc->getName().c_str());
+ CString strTitle;
+ strTitle.Format(_T("%s[%s:%d]"), pPlc->getName().c_str(), pPlc->getIp().c_str(),
+ pPlc->getPort());
+ m_pActiveView->SetWindowText(strTitle);
m_pActiveView->SetContext(pPlc);
m_pActiveView->SendMessage(WM_NCPAINT, 0, 0);
}
diff --git a/SourceCode/Bond/BoounionPLC/Common.h b/SourceCode/Bond/BoounionPLC/Common.h
index 6ef354a..dedacdb 100644
--- a/SourceCode/Bond/BoounionPLC/Common.h
+++ b/SourceCode/Bond/BoounionPLC/Common.h
@@ -47,6 +47,7 @@
/* 轴设定页面颜色定义 */
/* 5个按钮页, 按钮背景色,正常状态*/
+#define BTN_PAGE_FRAME_COLOR RGB(58, 58, 58)
#define BTN_PAGE_FACE_NORMAL_COLOR RGB(0, 168, 0)
#define BTN_PAGE_FACE_SELECT_COLOR RGB(0, 232, 0)
#define BTN_PAGE_TEXT_NORMAL_COLOR RGB(22, 22, 22)
diff --git a/SourceCode/Bond/BoounionPLC/PlcView.cpp b/SourceCode/Bond/BoounionPLC/PlcView.cpp
index 1b69175..2c716b4 100644
--- a/SourceCode/Bond/BoounionPLC/PlcView.cpp
+++ b/SourceCode/Bond/BoounionPLC/PlcView.cpp
@@ -19,12 +19,18 @@
for (int i = 0; i < BTN_MAX; i++) {
m_pBlBtns[i] = new CBlButton();
}
+ m_crPlcNameBack = RGB(228, 228, 228);
+
}
CPlcView::~CPlcView()
{
for (int i = 0; i < BTN_MAX; i++) {
delete m_pBlBtns[i];
+ }
+ if (m_hbrPlcName != nullptr) {
+ ::DeleteObject(m_hbrPlcName);
+ m_hbrPlcName = nullptr;
}
}
@@ -286,11 +292,18 @@
HBRUSH CPlcView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CBaseView::OnCtlColor(pDC, pWnd, nCtlColor);
+ int nCtrlId = pWnd->GetDlgCtrlID();
if (nCtlColor == CTLCOLOR_STATIC) {
pDC->SetBkColor(m_crBkgnd);
}
+ if (IDC_LABEL_PLC_NAME == nCtrlId) {
+ pDC->SetBkColor(m_crPlcNameBack);
+ m_hbrPlcName = CreateSolidBrush(m_crPlcNameBack);
+ return m_hbrPlcName;
+ }
+
if (m_hbrBkgnd == nullptr) {
m_hbrBkgnd = CreateSolidBrush(m_crBkgnd);
}
diff --git a/SourceCode/Bond/BoounionPLC/PlcView.h b/SourceCode/Bond/BoounionPLC/PlcView.h
index 1b63539..27a3e52 100644
--- a/SourceCode/Bond/BoounionPLC/PlcView.h
+++ b/SourceCode/Bond/BoounionPLC/PlcView.h
@@ -53,6 +53,8 @@
private:
// 控件
CBlButton* m_pBlBtns[BTN_MAX];
+ COLORREF m_crPlcNameBack;
+ HBRUSH m_hbrPlcName;
// 对话框数据
#ifdef AFX_DESIGN_TIME
--
Gitblit v1.9.3