xref: /MusicPlayer2/MusicPlayer2/AppearanceSettingDlg.h (revision 1c827ad792140918617518cdf8b7156c522e3c66)
1 #pragma once
2 #include "Common.h"
3 #include "DrawCommon.h"
4 #include "ColorStatic.h"
5 #include "TabDlg.h"
6 #include "SpinEdit.h"
7 #include "BrowseEdit.h"
8 #include "SliderCtrlEx.h"
9 #include "MyComboBox.h"
10 
11 // CAppearanceSettingDlg 对话框
12 
13 class CAppearanceSettingDlg : public CTabDlg
14 {
15     DECLARE_DYNAMIC(CAppearanceSettingDlg)
16 
17 public:
18     HWND m_hMainWnd;		//主窗口的句柄,用于实时更改窗口不透明度
19 
20     ApperanceSettingData m_data;
21 
22     CAppearanceSettingDlg(CWnd* pParent = NULL);   // 标准构造函数
23     virtual ~CAppearanceSettingDlg();
24 
25     void DrawColor();
26 
27     const int PREVIEW_WIDTH = theApp.DPI(200);		//预览图的宽高
28     const int PREVIEW_HEIGHT = theApp.DPI(40);
29 
30     const int ICON_X = theApp.DPI(46);		//预览图中图标的位置
31     const int ICON_Y = theApp.DPI(12);
32 
33     // 对话框数据
34 #ifdef AFX_DESIGN_TIME
35     enum { IDD = IDD_APPEREANCE_SETTING_DLG };
36 #endif
37 
38 protected:
39     CSliderCtrlEx m_transparency_slid;
40     CColorStatic m_color_static;
41     CColorStatic m_color_static1;
42     CColorStatic m_color_static2;
43     CColorStatic m_color_static3;
44     CColorStatic m_color_static4;
45     CColorStatic m_color_static5;
46     CColorStatic m_color_static6;
47     CColorStatic m_color_static7;
48 
49     const COLORREF m_color1{ RGB(134,186,249) };		//天蓝色
50     const COLORREF m_color2{ RGB(115,210,45) };			//绿色
51     const COLORREF m_color3{ RGB(255,164,16) };			//橙色
52     const COLORREF m_color4{ RGB(33,147,167) };			//青绿色
53     const COLORREF m_color5{ RGB(249,153,197) };		//浅红色
54     const COLORREF m_color6{ RGB(162,161,216) };		//淡紫色
55     const COLORREF m_color7{ RGB(110,110,110) };		//灰色
56 
57     CToolTipCtrl m_toolTip;
58 
59     CButton m_follow_system_color_check;
60     CSliderCtrlEx m_spectrum_height_slid;
61     CButton m_show_album_cover_chk;
62     CMyComboBox m_album_cover_fit_combo;
63     CButton m_album_cover_as_background_chk;
64     CButton m_show_spectrum_chk;
65     CSliderCtrlEx m_back_transparency_slid;
66     CButton m_use_out_image_chk;
67     CButton m_background_gauss_blur_chk;
68     CSliderCtrlEx m_gauss_blur_radius_sld;
69     CButton m_lyric_background_chk;
70     CButton m_dark_mode_chk;
71     CButton m_use_inner_image_first_chk;
72     CButton m_enable_background_chk;
73     CButton m_low_freq_in_center_chk;
74     CButton m_default_cover_hq_chk;
75     CSpinEdit m_ui_refresh_interval_edit;
76     CMyComboBox m_icon_select_combo;
77     CButton m_notify_icon_auto_adapt_chk;
78     CButton m_btn_round_corners_chk;
79 
80     CRect m_notify_icon_preview;
81     CRect m_system_titlebar_preview_rect;
82     CRect m_owner_draw_titlebar_preview_rect;
83 
84     CImage m_preview_dark;
85     CImage m_preview_light;
86     CImage m_preview_system_titlebar;
87     CImage m_preview_owner_draw_titlebar;
88 
89     CBrowseEdit m_default_background_edit;
90     CBrowseEdit m_album_cover_name_edit;
91     CBrowseEdit m_album_cover_path_edit;
92 
93     virtual bool InitializeControls() override;
94     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持
95 
96     void SetTransparency();
97     void ClickColor();
98     static int SpectrumHeightChg(int value);		//使用二次函数将10~300范围内的值映射到0~100范围内
99     static int SpectrumHeightRChg(int value);		//使用二次函数将0~100范围内的值映射到10~300范围内
100 
101     void SetControlEnable();
102     void CalculatePreviewBitmapRect();
103 
104     virtual void GetDataFromUi() override;
105     virtual void ApplyDataToUi() override;
106 
107     DECLARE_MESSAGE_MAP()
108 public:
109     virtual BOOL OnInitDialog();
110     //	afx_msg void OnNMReleasedcaptureTransparentSlider(NMHDR *pNMHDR, LRESULT *pResult);
111     afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
112     afx_msg void OnBnClickedSetThemeButton();
113     afx_msg void OnStnClickedColorStatic2();
114     afx_msg void OnStnClickedColorStatic3();
115     afx_msg void OnStnClickedColorStatic4();
116     afx_msg void OnStnClickedColorStatic5();
117     afx_msg void OnStnClickedColorStatic6();
118     afx_msg void OnStnClickedColorStatic7();
119     afx_msg void OnStnClickedColorStatic8();
120     virtual BOOL PreTranslateMessage(MSG* pMsg);
121     afx_msg void OnBnClickedFollowSystemColorCheck();
122     afx_msg void OnBnClickedShowAlbumCoverCheck();
123     afx_msg void OnCbnSelchangeAlbumFitCombo();
124     afx_msg void OnBnClickedAlbumCoverBackgroundCheck();
125     afx_msg void OnBnClickedShowSpectrumCheck();
126     afx_msg void OnBnClickedUseOutImageCheck();
127     afx_msg void OnBnClickedBackgroundGaussBlurCheck();
128     afx_msg void OnBnClickedLyricBackgroundCheck();
129     afx_msg void OnBnClickedDarkModeCheck();
130     afx_msg void OnBnClickedUseInnerImageFirstCheck();
131     afx_msg void OnBnClickedEnableBackgroundCheck();
132     afx_msg void OnBnClickedLowFreqInCenterCheck();
133     afx_msg void OnBnClickedDefaultAlbumCoverHq();
134     afx_msg void OnBnClickedRestoreDefaultButton();
135     afx_msg void OnCbnSelchangeCombo1();
136     afx_msg void OnPaint();
137     afx_msg void OnBnClickedNotifyIconAutoAdaptCheck();
138     afx_msg void OnBnClickedBtnRoundCornersCheck();
139 protected:
140     afx_msg LRESULT OnEditBrowseChanged(WPARAM wParam, LPARAM lParam);
141 public:
142     afx_msg void OnBnClickedUseDesktopBackgroundCheck();
143     afx_msg void OnBnClickedShowNextCheck();
144     afx_msg void OnBnClickedShowFpsCheck();
145     afx_msg void OnBnClickedAlwaysShowStatusbarCheck();
146     afx_msg void OnBnClickedUseSystemTitlebarRadio();
147     afx_msg void OnBnClickedUseOwnerDrawTitlebarRadio();
148 };
149