LAPTOP-SNT8I5JK\Boounion
2025-01-13 c6bfb4fc0801c4cb1f9dd2128df5f20d2e9cf27d
1.PLC名字显示,按钮边框等;
已修改6个文件
22 ■■■■■ 文件已修改
SourceCode/Bond/BoounionPLC/AxisSettingsDlg.cpp 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/BoounionPLC/BoounionPLC.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/BoounionPLC/Common.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/BoounionPLC/PlcView.cpp 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/BoounionPLC/PlcView.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/BoounionPLC/AxisSettingsDlg.cpp
@@ -200,6 +200,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);
SourceCode/Bond/BoounionPLC/BoounionPLC.rc
Binary files differ
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);
                        }
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)
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);
    }
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