LAPTOP-SNT8I5JK\Boounion
2024-11-15 4fafc27775bc8d7ae23fd8d15bae54547d706830
Merge branch 'liuyang' into clh
已添加3个文件
已修改4个文件
338 ■■■■■ 文件已修改
SourceCode/Bond/BLControlsSDK/include/BLControls.h 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/BondEq/AxisSettingsDlg.cpp 242 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/BondEq/AxisSettingsDlg.h 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/BondEq/BondEq.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/BondEq/BondEq.vcxproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/BondEq/BondEqDlg.cpp 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/BondEq/Resource.h 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/BLControlsSDK/include/BLControls.h
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,37 @@
#if !defined(AFX_BLCONTROLS_H__16C6D980_BD45_11D3_BDA3_00104B133581__INCLUDED_)
#define AFX_BLCONTROLS_H__16C6D980_BD45_11D3_BDA3_00104B133581__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// BLControls.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CBLControls window
#include "BLButton.h"
#include "BLFolderScheduling.h"
#include "BLJogBtn2Parent.h"
#include "BLJogButton.h"
#include "BLLabel.h"
#include "BLListBoxLog.h"
#include "BLListCtrlExt.h"
#include "CellCtrl.h"
#include "ColorButton.h"
#include "FontStatic.h"
#include "GradientStatic.h"
#include "HeadCtrl.h"
#include "InPlaceComboBox.h"
#include "InPlaceEdit.h"
#include "LogCtrl.h"
#include "SortClass.h"
#include "StaticMap.h"
#include "WKButton.h"
#include "XTabCtrl.h"
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_BLCONTROLS_H__16C6D980_BD45_11D3_BDA3_00104B133581__INCLUDED_)
SourceCode/Bond/BondEq/AxisSettingsDlg.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,242 @@
// AxisSettingsDlg.cpp: å®žçŽ°æ–‡ä»¶
//
#include "stdafx.h"
#include "BondEq.h"
#include "afxdialogex.h"
#include "AxisSettingsDlg.h"
// CAxisSettingsDlg å¯¹è¯æ¡†
IMPLEMENT_DYNAMIC(CAxisSettingsDlg, CDialogEx)
CAxisSettingsDlg::CAxisSettingsDlg(CWnd* pParent /*=nullptr*/)
    : CDialogEx(IDD_DIALOG_AXIS_SETTINGS, pParent)
{
    m_nInitialWidth = 0;
    m_nInitialHeight = 0;
}
CAxisSettingsDlg::~CAxisSettingsDlg()
{
}
void CAxisSettingsDlg::DoDataExchange(CDataExchange* pDX)
{
    CDialogEx::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CAxisSettingsDlg, CDialogEx)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_LAST, &CAxisSettingsDlg::OnBnClickedButtonAxisLast)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_NEXT, &CAxisSettingsDlg::OnBnClickedButtonAxisNext)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT_GROUP1, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup1)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT_GROUP2, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup2)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT_GROUP3, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup3)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT_GROUP4, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup4)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT_GROUP5, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup5)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT1, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint1)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT2, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint2)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT3, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint3)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT4, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint4)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT5, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint5)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_TEST_OPR, &CAxisSettingsDlg::OnBnClickedButtonAxisTestOpr)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_TEST_JOG_ADD, &CAxisSettingsDlg::OnBnClickedButtonAxisTestJogAdd)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_TEST_JOG_SUB, &CAxisSettingsDlg::OnBnClickedButtonAxisTestJogSub)
    ON_BN_CLICKED(IDC_BUTTON_AXIS_TEST_STOP, &CAxisSettingsDlg::OnBnClickedButtonAxisTestStop)
    ON_WM_SIZE()
    ON_WM_CTLCOLOR()
    ON_WM_SIZING()
END_MESSAGE_MAP()
// CAxisSettingsDlg æ¶ˆæ¯å¤„理程序
BOOL CAxisSettingsDlg::OnInitDialog()
{
    CDialogEx::OnInitDialog();
    // TODO:  åœ¨æ­¤æ·»åŠ é¢å¤–çš„åˆå§‹åŒ–
    //ModifyStyle(0, WS_THICKFRAME | WS_SIZEBOX);
    CRect rect;
    GetClientRect(&rect);
    m_nInitialWidth = rect.Width();
    m_nInitialHeight = rect.Height();
    rect.right *= 1.5;
    rect.bottom *= 1.5;
    // è°ƒæ•´å¯¹è¯æ¡†å¤§å°
    MoveWindow(rect);
    return TRUE;  // return TRUE unless you set the focus to a control
    // å¼‚常: OCX å±žæ€§é¡µåº”返回 FALSE
}
void CAxisSettingsDlg::OnSize(UINT nType, int cx, int cy)
{
    CDialogEx::OnSize(nType, cx, cy);
    // TODO: åœ¨æ­¤å¤„添加消息处理程序代码
    CRect rect;
    GetClientRect(&rect);
    // éåŽ†å¯¹è¯æ¡†ä¸­çš„æ‰€æœ‰æŽ§ä»¶
    AdjustControls(rect.Width(), rect.Height());
}
void CAxisSettingsDlg::OnSizing(UINT fwSide, LPRECT pRect)
{
    if (fwSide == WMSZ_BOTTOMRIGHT) {
        if (pRect->right - pRect->left < 200) {
            pRect->right = pRect->left + 200;
        }
        if (pRect->bottom - pRect->top < 150) {
            pRect->bottom = pRect->top + 150;
        }
    }
    CDialogEx::OnSizing(fwSide, pRect);
}
HBRUSH CAxisSettingsDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
    HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
    // TODO:  åœ¨æ­¤æ›´æ”¹ DC çš„任何特性
    // TODO:  å¦‚果默认的不是所需画笔,则返回另一个画笔
    return hbr;
}
void CAxisSettingsDlg::OnBnClickedButtonAxisLast()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::OnBnClickedButtonAxisNext()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup1()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup2()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup3()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup4()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup5()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint1()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint2()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint3()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint4()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint5()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::OnBnClickedButtonAxisTestOpr()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::OnBnClickedButtonAxisTestJogAdd()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::OnBnClickedButtonAxisTestJogSub()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::OnBnClickedButtonAxisTestStop()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
}
void CAxisSettingsDlg::AdjustControls(int nWidth, int nHeight)
{
    CWnd* pWnd = GetWindow(GW_CHILD);
    while (pWnd) {
        UINT nCtrlID = pWnd->GetDlgCtrlID();
        CRect ctrlRect;
        pWnd->GetWindowRect(&ctrlRect);
        ScreenToClient(&ctrlRect);
        // è®¡ç®—控件的新位置和大小,按比例调整
        int newX = (int)(ctrlRect.left * (nWidth / (float)m_nInitialWidth));
        int newY = (int)(ctrlRect.top * (nHeight / (float)m_nInitialHeight));
        int newWidth = (int)(ctrlRect.Width() * (nWidth / (float)m_nInitialWidth));
        int newHeight = (int)(ctrlRect.Height() * (nHeight / (float)m_nInitialHeight));
        pWnd->MoveWindow(newX, newY, newWidth, newHeight);
        AdjustControlFont(pWnd, newWidth, newHeight);
        if (pWnd->IsKindOf(RUNTIME_CLASS(CComboBox))) {
            CComboBox* pComboBox = (CComboBox*)pWnd;
            pComboBox->SetItemHeight(-1, newHeight);  // -1 è¡¨ç¤ºæ‰€æœ‰é¡¹çš„高度
        }
        if (pWnd->IsKindOf(RUNTIME_CLASS(CStatic))) {
            CStatic* pStatic = (CStatic*)pWnd;
            pStatic->ModifyStyle(0, SS_CENTER | SS_CENTERIMAGE);
        }
        // èŽ·å–ä¸‹ä¸€ä¸ªæŽ§ä»¶
        pWnd = pWnd->GetNextWindow();
    }
}
void CAxisSettingsDlg::AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight)
{
    int fontSize = nHeight - 10;
    CFont* pCurrentFont = pWnd->GetFont();
    LOGFONT logFont;
    pCurrentFont->GetLogFont(&logFont);
    logFont.lfHeight = -fontSize;
    CFont newFont;
    newFont.CreateFontIndirect(&logFont);
    pWnd->SetFont(&newFont);
    pWnd->Invalidate();
}
SourceCode/Bond/BondEq/AxisSettingsDlg.h
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,51 @@
#pragma once
#include "afxdialogex.h"
// CAxisSettingsDlg å¯¹è¯æ¡†
class CAxisSettingsDlg : public CDialogEx
{
    DECLARE_DYNAMIC(CAxisSettingsDlg)
public:
    CAxisSettingsDlg(CWnd* pParent = nullptr);   // æ ‡å‡†æž„造函数
    virtual ~CAxisSettingsDlg();
// å¯¹è¯æ¡†æ•°æ®
#ifdef AFX_DESIGN_TIME
    enum { IDD = IDD_DIALOG_AXIS_SETTINGS };
#endif
protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV æ”¯æŒ
    virtual BOOL OnInitDialog();
    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
    afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
    afx_msg void OnBnClickedButtonAxisLast();
    afx_msg void OnBnClickedButtonAxisNext();
    afx_msg void OnBnClickedButtonAxisAnchorPointGroup1();
    afx_msg void OnBnClickedButtonAxisAnchorPointGroup2();
    afx_msg void OnBnClickedButtonAxisAnchorPointGroup3();
    afx_msg void OnBnClickedButtonAxisAnchorPointGroup4();
    afx_msg void OnBnClickedButtonAxisAnchorPointGroup5();
    afx_msg void OnBnClickedButtonAxisAnchorPoint1();
    afx_msg void OnBnClickedButtonAxisAnchorPoint2();
    afx_msg void OnBnClickedButtonAxisAnchorPoint3();
    afx_msg void OnBnClickedButtonAxisAnchorPoint4();
    afx_msg void OnBnClickedButtonAxisAnchorPoint5();
    afx_msg void OnBnClickedButtonAxisTestOpr();
    afx_msg void OnBnClickedButtonAxisTestJogAdd();
    afx_msg void OnBnClickedButtonAxisTestJogSub();
    afx_msg void OnBnClickedButtonAxisTestStop();
    DECLARE_MESSAGE_MAP()
private:
    void AdjustControls(int nWidth, int nHeight);
    void AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight);
private:
    int m_nInitialWidth;
    int m_nInitialHeight;
};
SourceCode/Bond/BondEq/BondEq.rc
Binary files differ
SourceCode/Bond/BondEq/BondEq.vcxproj
@@ -195,6 +195,7 @@
    <ClInclude Include="Alarm.h" />
    <ClInclude Include="AlarmMonitor.h" />
    <ClInclude Include="ApredTreeCtrl.h" />
    <ClInclude Include="AxisSettingsDlg.h" />
    <ClInclude Include="BaseSetPage.h" />
    <ClInclude Include="BlButton.h" />
    <ClInclude Include="BondEq.h" />
@@ -250,6 +251,7 @@
    <ClCompile Include="Alarm.cpp" />
    <ClCompile Include="AlarmMonitor.cpp" />
    <ClCompile Include="ApredTreeCtrl.cpp" />
    <ClCompile Include="AxisSettingsDlg.cpp" />
    <ClCompile Include="BaseSetPage.cpp" />
    <ClCompile Include="BlButton.cpp" />
    <ClCompile Include="BondEq.cpp" />
SourceCode/Bond/BondEq/BondEqDlg.cpp
@@ -12,6 +12,9 @@
#include "UserManager.h"
#include "LoginDlg.h"
// test
#include "AxisSettingsDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -538,6 +541,9 @@
                userManager.logout();
                m_pTopToolbar->SetOperatorBtnText(_T("未登录"));
            }
            CAxisSettingsDlg loginDlg;
            loginDlg.DoModal();
        }
    }
SourceCode/Bond/BondEq/Resource.h
Binary files differ