forked from rainmeter/rainmeter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDialogAbout.h
187 lines (149 loc) · 4.16 KB
/
DialogAbout.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
/* Copyright (C) 2011 Rainmeter Project Developers
*
* This Source Code Form is subject to the terms of the GNU General Public
* License; either version 2 of the License, or (at your option) any later
* version. If a copy of the GPL was not distributed with this file, You can
* obtain one at <https://www.gnu.org/licenses/gpl-2.0.html>. */
#ifndef __DIALOGABOUT_H__
#define __DIALOGABOUT_H__
#include "../Common/Dialog.h"
#include "Logger.h"
#include "Skin.h"
class DialogAbout : public Dialog
{
public:
DialogAbout();
virtual ~DialogAbout();
DialogAbout(const DialogAbout& other) = delete;
DialogAbout& operator=(DialogAbout other) = delete;
static Dialog* GetDialog() { return c_Dialog; }
static void Open(int tab = 0);
static void Open(const WCHAR* name);
static void ShowAboutLog();
static void AddLogItem(Logger::Level level, LPCWSTR time, LPCWSTR source, LPCWSTR message);
static void UpdateSkins();
static void UpdateMeasures(Skin* skin);
static void CloseDialog() { if (c_Dialog) c_Dialog->HandleMessage(WM_CLOSE, 0, 0); }
protected:
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnInitDialog(WPARAM wParam, LPARAM lParam);
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
private:
// Log tab
class TabLog : public Tab
{
public:
enum Id
{
Id_LogListView = 100,
Id_ErrorCheckBox,
Id_WarningCheckBox,
Id_NoticeCheckBox,
Id_DebugCheckBox,
Id_ClearButton
};
TabLog();
~TabLog();
void Create(HWND owner);
virtual void Initialize();
virtual void Resize(int w, int h);
void AddItem(Logger::Level level, LPCWSTR time, LPCWSTR source, LPCWSTR message);
protected:
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
private:
void DestroyImageList();
bool m_Error;
bool m_Warning;
bool m_Notice;
bool m_Debug;
HIMAGELIST m_ImageList;
};
// Skins tab
class TabSkins : public Tab
{
public:
enum Id
{
Id_SkinsListBox = 200,
Id_SkinsListView
};
TabSkins();
void Create(HWND owner);
virtual void Initialize();
virtual void Resize(int w, int h);
void UpdateSkinList();
void UpdateMeasureList(Skin* skin);
protected:
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
INT_PTR OnCustomDraw(WPARAM wParam, LPARAM lParam);
private:
static int CALLBACK ListSortProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
Skin* m_SkinWindow;
};
// Plugins tab
class TabPlugins : public Tab
{
public:
enum Id
{
Id_PluginsListView = 300
};
TabPlugins();
void Create(HWND owner);
virtual void Initialize();
virtual void Resize(int w, int h);
protected:
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
INT_PTR OnCustomDraw(WPARAM wParam, LPARAM lParam);
private:
typedef LPCTSTR (*GETPLUGINAUTHOR)();
typedef UINT (*GETPLUGINVERSION)();
};
// Version tab
class TabVersion : public Tab
{
public:
enum Id
{
Id_AppIcon = 400,
Id_VersionLabel,
Id_LanguageLabel,
Id_TimestampLabel,
Id_HomeLink,
Id_LicenseLink,
Id_WinVerLabel,
Id_PathLink,
Id_SkinPathLink,
Id_SettingsPathLink,
Id_IniFileLink,
Id_CopyButton
};
TabVersion();
void Create(HWND owner);
virtual void Initialize();
virtual void Resize(int w, int h);
protected:
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
};
enum Id
{
Id_CloseButton = IDCLOSE,
Id_Tab = 500
};
Tab& GetActiveTab();
TabLog m_TabLog;
TabSkins m_TabSkins;
TabPlugins m_TabPlugins;
TabVersion m_TabVersion;
static WINDOWPLACEMENT c_WindowPlacement;
static DialogAbout* c_Dialog;
};
#endif