Files
SimpleRemoter/server/2015Remote/SearchBarDlg.h
T
yuanyuanxiang 6b87a31c6f UI: explain dangerous operations, screen modes and host filtering
Four items from a user-side review of the master. The common thread: the UI
now says what it is about to do instead of leaving the user to guess.

Confirm boxes. Logout, restart, shutdown, delete host and uninstall client
all asked "are you sure" without naming the action or the hosts, so a
multi-selection could not be checked. DescribeTargetHosts() lists
"note (or computer name) (ip)" capped at five lines, and the default button
is No. The preview is dropped before the modal box and targets are
re-resolved after it, since the list can reshuffle in between.

Screen modes. High Speed / Ultra Speed became High Quality (DXGI +
differential: lossless, bandwidth hungry) and Smooth (GDI + H264: lossy,
cheap). TranslateMenu looks menus up by displayed text, so the .rc entries,
the FeatureLimitsDlg item names and the language pack keys changed together.

Host filter. The Ctrl+F bar was find-next; it now filters as you type over
IP, location, note, OS and version, and Esc clears the filter. The status
line reads "filtered: N / M total" while active. Commands still resolve by
clientID and m_FilteredIndices still maps row to m_HostList index, so no
command path changes. SearchBarDlg drops from 446 to 312 lines.

Quality changes. The adaptive level now shows its reason for twenty seconds
("Good (high latency)") instead of silently changing. The full-screen info
bar was a fixed 170px, so that reason was clipped; the width is now measured
from the text with the same font that paints it, 170 becoming the floor and
16px quantisation so changing digits do not jitter the window. Cosmetic
only: no threshold, hysteresis, cooldown or lock-out logic is touched.

Verified: debug server build, 0 errors; new strings present in .res and in
the exe. UI not exercised - the debug master would fight the running release
master for the listening port in Bin/settings.ini.
2026-11-07 15:34:45 +01:00

66 lines
2.1 KiB
C++

// SearchBarDlg.h - 浮动搜索工具栏
#pragma once
#include "Resource.h"
#include "LangManager.h"
#include "CIconButton.h"
#include <vector>
class CMy2015RemoteDlg;
class CSearchBarDlg : public CDialogLangEx
{
DECLARE_DYNAMIC(CSearchBarDlg)
public:
CSearchBarDlg(CMy2015RemoteDlg* pParent = nullptr);
virtual ~CSearchBarDlg();
enum { IDD = IDD_SEARCH_BAR };
CMy2015RemoteDlg* m_pParent;
// 控件
CEdit m_editSearch;
CIconButton m_btnPrev;
CIconButton m_btnNext;
CIconButton m_btnClose;
CStatic m_staticCount;
CToolTipCtrl m_tooltip;
// 搜索状态
CString m_strLastSearch; // 上次已应用到列表的筛选文本
// 方法
void Show(); // 显示搜索栏
void Hide(); // 隐藏搜索栏(同时撤掉筛选)
void DoSearch(); // 应用筛选(输入防抖后调用)
void InvalidateCache(); // 刷新计数(Tab切换/列表变化时调用)
void GotoPrev(); // 选中上一行
void GotoNext(); // 选中下一行
void MoveSelection(int delta); // 在筛选结果内移动选中项
void UpdateCountText(); // 更新计数显示
void UpdatePosition(); // 更新位置(居中于父窗口)
protected:
virtual void DoDataExchange(CDataExchange* pDX);
virtual BOOL OnInitDialog();
virtual BOOL PreTranslateMessage(MSG* pMsg);
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedPrev();
afx_msg void OnBnClickedNext();
afx_msg void OnBnClickedClose();
afx_msg void OnEnChangeSearch();
afx_msg void OnTimer(UINT_PTR nIDEvent);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
static const UINT_PTR TIMER_SEARCH = 1; // 延迟搜索定时器
static const UINT SEARCH_DELAY_MS = 500; // 延迟时间(毫秒)
private:
CBrush m_brushEdit; // 输入框背景画刷
CBrush m_brushStatic; // 静态控件背景画刷
};