Files
SimpleRemoter/server/2015Remote/CIconButton.h
yuanyuanxiang dd845823b6 Feature: Add get/set clipboard buttons to remote desktop toolbar
Add two toolbar buttons — get clipboard (letter C) and set clipboard (letter P) —
after the screenshot button and before the minimize button, so clipboard sync stays
reachable in fullscreen mode where the system menu cannot be opened.

The buttons reuse the existing IDM_GET_CLIPBOARD / IDM_SET_CLIPBOARD system-menu
handlers by posting WM_SYSCOMMAND to the parent. The toolbar button count grows
from 16 to 18, and the slide/animation dimensions are widened from 640 to 720.
Letter C/P icons and Simplified-Chinese source strings ("获取剪贴板", "设置剪贴板")
are added, along with English and Traditional-Chinese translations.

Co-Authored-By: deepseek-v4-pro
2026-09-03 13:29:39 +02:00

71 lines
3.0 KiB
C++

#pragma once
// CIconButton - Owner-draw button with geometric icon drawing
// Used by the fullscreen toolbar for a modern, icon-based appearance.
#include <functional>
class CIconButton : public CButton
{
DECLARE_DYNAMIC(CIconButton)
public:
// Icon drawing function: receives CDC* and icon bounding CRect
typedef void (*IconDrawFunc)(CDC* pDC, const CRect& rc);
CIconButton();
virtual ~CIconButton();
void SetIconDrawFunc(IconDrawFunc fn) { m_fnDrawIcon = fn; }
void SetIsCloseButton(bool b) { m_bIsCloseButton = b; }
void SetActive(bool b) { m_bActive = b; Invalidate(FALSE); }
// --- Static icon draw functions ---
static void DrawIconExitFullscreen(CDC* pDC, const CRect& rc);
static void DrawIconPlay(CDC* pDC, const CRect& rc);
static void DrawIconPause(CDC* pDC, const CRect& rc);
static void DrawIconLock(CDC* pDC, const CRect& rc);
static void DrawIconUnlock(CDC* pDC, const CRect& rc);
static void DrawIconArrowDown(CDC* pDC, const CRect& rc);
static void DrawIconArrowUp(CDC* pDC, const CRect& rc);
static void DrawIconArrowLeft(CDC* pDC, const CRect& rc);
static void DrawIconArrowRight(CDC* pDC, const CRect& rc);
static void DrawIconOpacityFull(CDC* pDC, const CRect& rc);
static void DrawIconOpacityMedium(CDC* pDC, const CRect& rc);
static void DrawIconOpacityLow(CDC* pDC, const CRect& rc);
static void DrawIconScreenshot(CDC* pDC, const CRect& rc);
static void DrawIconSwitchScreen(CDC* pDC, const CRect& rc);
static void DrawIconBlockInput(CDC* pDC, const CRect& rc);
static void DrawIconUnblockInput(CDC* pDC, const CRect& rc);
static void DrawIconQuality(CDC* pDC, const CRect& rc);
static void DrawIconRestoreConsole(CDC* pDC, const CRect& rc);
static void DrawIconMinimize(CDC* pDC, const CRect& rc);
static void DrawIconClose(CDC* pDC, const CRect& rc);
static void DrawIconInfo(CDC* pDC, const CRect& rc);
static void DrawIconInfoHide(CDC* pDC, const CRect& rc);
static void DrawIconLetterX(CDC* pDC, const CRect& rc); // 字母 X 图标
static void DrawIconLetterY(CDC* pDC, const CRect& rc); // 字母 Y 图标
static void DrawIconLetterZ(CDC* pDC, const CRect& rc); // 字母 Z 图标
static void DrawIconLetterC(CDC* pDC, const CRect& rc); // 字母 C 图标 (获取剪贴板)
static void DrawIconLetterP(CDC* pDC, const CRect& rc); // 字母 P 图标 (设置剪贴板)
static void DrawIconAudioOn(CDC* pDC, const CRect& rc); // 音频开启图标 (喇叭+声波)
static void DrawIconAudioOff(CDC* pDC, const CRect& rc); // 音频关闭图标 (喇叭+斜线)
protected:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
virtual void PreSubclassWindow();
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnMouseLeave();
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
DECLARE_MESSAGE_MAP()
private:
IconDrawFunc m_fnDrawIcon;
bool m_bHover;
bool m_bIsCloseButton;
bool m_bTracking;
bool m_bActive;
};