Feature: add tooltips to the main toolbar and status bar

The main toolbar already carried CBRS_TOOLTIPS/CBRS_FLYBY, but the dialog had
no TTN_NEEDTEXT handler, so hovering produced no usable text. The status bar
had no pane-level tooltip at all: CStatusBar panes are not child windows.

Add a shared tip text builder and ANSI/Unicode TTN_NEEDTEXT handlers. The
toolbar supplies one line per command, noting which actions need a selected
host. The dialog's OnToolHitTest maps the cursor onto status-bar panes, which
report live TLS, MCP, FRP, runtime and licence-expiry text; the hit pane index
is recorded so the delayed text request cannot pick a neighbouring pane. The
status bar is a Unicode window, so the W notification is handled too, decoding
GBK with code page 936 rather than the system ACP. Width is widened for
multi-line tips and every string goes through _TR.

Add the 36 new strings to en_US, zh_TW and de_DE (GBK, literal \n). Toolbar
buttons share one width taken from the longest label, so duplicate keys
(Registry Mgr, Build Server, Keylogger, Connections, 登錄檔管理, 產生伺服器端,
and long German labels) pushed every button to 111px and clipped the last
icons. Shortening the effective labels brings them to 85px so all 19 fit a
1920-wide monitor.

Verified with a Debug x64 build and automated hovering of all 19 buttons plus
6 status panes in en_US, zh_TW and de_DE (25/25 each); zh_CN passed earlier.

Co-Authored-By: deepseek-flash
This commit is contained in:
yuanyuanxianganddeepseek-flash committed 2026-12-01 18:32:12 +01:00
1 parent f1315a8790
commit 1d03cbeb3f
5 files changed
+377 -27

No files matched your search

+13
View File
@@ -474,6 +474,7 @@ public:
bool PromoteStandby(uint64_t clientID); // 旧连接移除后,取替补转正(需持有 m_cs);返回是否真的转正
CStatusBar m_StatusBar; //状态条
CString m_sToolTipText; // TTN_NEEDTEXT 回填文本:提示显示期间须保持有效
ULONGLONG m_ullStartTime = 0; // 程序启动时间 (GetTickCount64)
CString m_strExpireDate; // 到期日期 (YYYYMMDD),空表示无授权
CString m_strFrpAddr; // FRP 地址 (IP:Port),由上级提供
@@ -484,6 +485,18 @@ public:
int m_nPaneExpireWidth = 0; // 到期时间分区宽度(按当前文本实测;0 = 无授权/隐藏)
void UpdateStatusBarStats(); // 更新状态栏统计信息
void LayoutStatusPanes(); // 按窗口宽度布置状态栏分区(空间不足时按优先级隐藏)
// 工具栏按钮 / 状态栏分区的悬浮提示。文本在 TTN_NEEDTEXT 时现算,
// 以便语言切换、TLS/MCP/FRP/运行/到期状态变化后立即生效。
CString BuildToolBarTip(UINT cmdId) const;
CString BuildStatusTip(UINT paneId) const;
CString BuildTipText(UINT_PTR nID, UINT uFlags) const;
afx_msg BOOL OnToolTipText(UINT id, NMHDR* pNMHDR, LRESULT* pResult);
afx_msg BOOL OnToolTipTextW(UINT id, NMHDR* pNMHDR, LRESULT* pResult);
std::wstring m_sToolTipTextW; // Unicode 提示文本(状态栏是 Unicode 窗口,发 TTN_NEEDTEXTW)
mutable int m_statusTipPane = -1; // OnToolHitTest 命中的状态栏分区下标,供 NEEDTEXT 复用
// 状态栏 pane 不是子窗口,CStatusBar 没有 pane 级命中;由对话框的
// OnToolHitTest 命中 pane(返回 0x7000+index 并记录下标),NEEDTEXT 时按该下标取文本。
INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const override;
CTrueColorToolBar m_ToolBar;
CGridDialog * m_gridDlg = NULL;
std::vector<DllInfo*> m_DllList;