From 552b0d6e5d9f02c5f50e7407f0b274f4b926a043 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期四, 12 六月 2025 09:53:57 +0800
Subject: [PATCH] Merge branch 'clh'
---
SourceCode/Bond/Servo/InputDialog.cpp | 70 +++++++++++++++++++++++++++++++++++
1 files changed, 70 insertions(+), 0 deletions(-)
diff --git a/SourceCode/Bond/Servo/InputDialog.cpp b/SourceCode/Bond/Servo/InputDialog.cpp
new file mode 100644
index 0000000..389ba9b
--- /dev/null
+++ b/SourceCode/Bond/Servo/InputDialog.cpp
@@ -0,0 +1,70 @@
+锘�// InputDialog.cpp: 瀹炵幇鏂囦欢
+//
+
+#include "stdafx.h"
+#include "Servo.h"
+#include "afxdialogex.h"
+#include "InputDialog.h"
+
+
+// CInputDialog 瀵硅瘽妗�
+
+IMPLEMENT_DYNAMIC(CInputDialog, CDialogEx)
+
+CInputDialog::CInputDialog(const CString& strTitle, const CString& strPrompt, CWnd* pParent /*=nullptr*/)
+ : CDialogEx(IDD_DIALOG_INPUT, pParent), m_strTitle(strTitle), m_strPrompt(strPrompt), m_strInput(_T(""))
+{
+
+}
+
+CInputDialog::~CInputDialog()
+{
+}
+
+CString CInputDialog::GetInputText() const
+{
+ return m_strInput;
+}
+
+void CInputDialog::DoDataExchange(CDataExchange* pDX)
+{
+ CDialogEx::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_EDIT_INPUT, m_editInput);
+ DDX_Control(pDX, IDC_STATIC_PROMPT, m_staticPrompt);
+}
+
+
+BEGIN_MESSAGE_MAP(CInputDialog, CDialogEx)
+ ON_BN_CLICKED(IDOK, &CInputDialog::OnBnClickedOk)
+END_MESSAGE_MAP()
+
+
+// CInputDialog 娑堟伅澶勭悊绋嬪簭
+
+
+BOOL CInputDialog::OnInitDialog()
+{
+ CDialogEx::OnInitDialog();
+
+ // TODO: 鍦ㄦ娣诲姞棰濆鐨勫垵濮嬪寲
+ SetWindowText(m_strTitle);
+ m_staticPrompt.SetWindowText(m_strPrompt);
+ m_editInput.SetFocus();
+ m_editInput.SetWindowText("1");
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
+}
+
+
+void CInputDialog::OnBnClickedOk()
+{
+ // TODO: 鍦ㄦ娣诲姞鎺т欢閫氱煡澶勭悊绋嬪簭浠g爜
+ m_editInput.GetWindowText(m_strInput);
+ if (m_strInput.IsEmpty()) {
+ AfxMessageBox(_T("杈撳叆涓嶈兘涓虹┖锛�"));
+ return;
+ }
+
+ CDialogEx::OnOK();
+}
--
Gitblit v1.9.3