From 709e6278abe167a6ff96a7f9814651a7812f142c Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期六, 10 五月 2025 10:26:18 +0800
Subject: [PATCH] 1.合并刘洋的修改,主要是将警告和日志窗口上移,方便查看和调试。
---
SourceCode/Bond/Servo/LogDlg.cpp | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/SourceCode/Bond/Servo/LogDlg.cpp b/SourceCode/Bond/Servo/LogDlg.cpp
index ce0617e..5451114 100644
--- a/SourceCode/Bond/Servo/LogDlg.cpp
+++ b/SourceCode/Bond/Servo/LogDlg.cpp
@@ -40,6 +40,7 @@
BEGIN_MESSAGE_MAP(CLogDlg, CDialogEx)
ON_WM_CTLCOLOR()
ON_WM_SIZE()
+ ON_WM_TIMER()
ON_WM_DESTROY()
ON_WM_CLOSE()
ON_NOTIFY(BLBUTTON_MENU_ITEM_CLICKED, IDC_BUTTON_LEVEL, &CLogDlg::OnButtonLevelMenuClicked)
@@ -105,6 +106,7 @@
BOOL CLogDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
+ SetTimer(1, 3000, nullptr);
// 缓存
@@ -154,12 +156,11 @@
// 内容
- m_logEdit.SetMaxLineCount(20);
+ m_logEdit.SetMaxLineCount(500);
m_logEdit.SetLimitText(-1);
- InitRxWindow();
-
+ Resize();
return TRUE; // return TRUE unless you set the focus to a control
@@ -170,14 +171,26 @@
{
CDialogEx::OnSize(nType, cx, cy);
if (GetDlgItem(IDC_EDIT_LOG) == nullptr) return;
+ Resize();
+}
+void CLogDlg::OnTimer(UINT_PTR nIDEvent)
+{
+ if (1 == nIDEvent) {
+ KillTimer(1);
+ InitRxWindow();
+ }
+}
+
+void CLogDlg::Resize()
+{
int x, y, y2, temp;
CRect rcClient, rcItem;
CWnd* pItem;
GetClientRect(&rcClient);
- y = 0;
- x = 12;
+ y = 12;
+ x = 8;
pItem = GetDlgItem(IDC_BUTTON_LEVEL);
pItem->GetWindowRect(&rcItem);
ScreenToClient(&rcItem);
@@ -185,6 +198,7 @@
x += rcItem.Width();
x += 18;
y2 = rcItem.bottom;
+ y2 += 8;
pItem = GetDlgItem(IDC_BUTTON_INCLUDE);
pItem->GetWindowRect(&rcItem);
@@ -203,9 +217,9 @@
pItem->GetWindowRect(&rcItem);
pItem->MoveWindow(x, y + (temp - rcItem.Height()) / 2, rcItem.Width(), rcItem.Height());
- x = 12;
+ x = 8;
pItem = GetDlgItem(IDC_EDIT_LOG);
- pItem->MoveWindow(x, y2, rcClient.Width() - 24, rcClient.Height() - 5 - y2);
+ pItem->MoveWindow(x, y2, rcClient.Width() - 16, rcClient.Height() - 5 - y2);
}
void CLogDlg::OnDestroy()
--
Gitblit v1.9.3