Every edit box, combo box and radio button on the master settings dialog now explains itself on hover. The tips use explicit line breaks so long explanations do not run on one wide line. The dialog uses MFC's built-in tooltip support (EnableToolTips + OnToolHitTest + TTN_NEEDTEXT) instead of a hand-rolled CToolTipCtrl relay. OnToolHitTest hits controls by rectangle, which covers combo boxes (mouse messages target their internal edit child) and controls disabled at runtime (FRP port/token while FRP is off); the framework then translates the relay and shows the tip. Two details make the tips behave: the thread tooltip gets a max tip width (otherwise it draws one line and ignores the breaks), and the read-only max-connections field is lifted above its group box in z-order, because the relay's child-window lookup otherwise resolves the group box instead of the field. The 14 texts are translated in the en_US, de_DE and zh_TW packs. The listen-port tip warns that deployed clients keep the old port, and the report-interval/detect tips say the value is pushed after OK (Apply only saves). The UDP-params tip covers the 0/1 aliases and the restart requirement. Co-Authored-By: deepseek-flash
65 lines
2.0 KiB
C++
65 lines
2.0 KiB
C++
#pragma once
|
|
#include "afxwin.h"
|
|
#include "LangManager.h"
|
|
#include "2015RemoteDlg.h"
|
|
#include <map>
|
|
|
|
// CSettingDlg 对话框
|
|
|
|
class CSettingDlg : public CDialogLang
|
|
{
|
|
DECLARE_DYNAMIC(CSettingDlg)
|
|
|
|
public:
|
|
CSettingDlg(CMy2015RemoteDlg* pParent); // 标准构造函数
|
|
virtual ~CSettingDlg();
|
|
CMy2015RemoteDlg* g_2015RemoteDlg = nullptr;
|
|
|
|
// 对话框数据
|
|
enum { IDD = IDD_DIALOG_SET };
|
|
|
|
protected:
|
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
public:
|
|
CString m_nListenPort;
|
|
UINT m_nMax_Connect;
|
|
virtual BOOL OnInitDialog();
|
|
afx_msg void OnBnClickedButtonSettingapply();
|
|
afx_msg void OnEnChangeEditPort();
|
|
afx_msg void OnEnChangeEditMax();
|
|
CButton m_ApplyButton;
|
|
virtual void OnOK();
|
|
CComboBox m_ComboScreenCapture;
|
|
CString m_sScreenCapture;
|
|
CComboBox m_ComboScreenCompress;
|
|
CString m_sScreenCompress;
|
|
CEdit m_EditReportInterval;
|
|
int m_nReportInterval;
|
|
CComboBox m_ComboSoftwareDetect;
|
|
CString m_sSoftwareDetect;
|
|
CEdit m_EditPublicIP;
|
|
CString m_sPublicIP;
|
|
afx_msg void OnBnClickedRadioAllScreen();
|
|
afx_msg void OnBnClickedRadioMainScreen();
|
|
CEdit m_EditUdpOption;
|
|
CString m_sUdpOption;
|
|
// MFC 内建工具提示(EnableToolTips + OnToolHitTest + TTN_NEEDTEXT):
|
|
// 由框架负责 combo 内部编辑框、禁用控件的命中转换,比手动 RelayEvent 可靠。
|
|
std::map<UINT, CString> m_tips; // 控件 ID -> 提示文本
|
|
virtual INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
|
|
afx_msg BOOL OnToolTipText(UINT id, NMHDR* pNMHDR, LRESULT* pResult);
|
|
afx_msg void OnBnClickedRadioFrpOff();
|
|
afx_msg void OnBnClickedRadioFrpOn();
|
|
CEdit m_EditFrpPort;
|
|
int m_nFrpPort;
|
|
CEdit m_EditFrpToken;
|
|
CString m_sFrpToken;
|
|
CComboBox m_ComboVideoWall;
|
|
CEdit m_EditFileServerPort;
|
|
int m_nFileServerPort;
|
|
afx_msg void OnEnKillfocusEditPublicIp();
|
|
CString m_sOriginalMaster; // 缓存原始公网地址,用于检测修改
|
|
};
|