/
LineDlg.h
179 lines (147 loc) · 4.88 KB
/
LineDlg.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
/*
* Copyright (C) 2001-2024 Jacek Sieka, arnetheduck on gmail point com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef LINE_DLG_H
#define LINE_DLG_H
#include "resource.h"
#include <airdcpp/typedefs.h>
class LineDlg : public CDialogImpl<LineDlg>
{
CEdit ctrlLine;
CStatic ctrlDescription;
public:
tstring line;
tstring description;
tstring title;
bool password = false;
bool disable = false;
bool allowEmpty = true;
enum { IDD = IDD_LINE };
BEGIN_MSG_MAP(LineDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
MESSAGE_HANDLER(WM_SETFOCUS, onFocus)
COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
END_MSG_MAP()
LineDlg() { }
LRESULT onFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
};
class ComboDlg : public CDialogImpl<ComboDlg>
{
CStatic ctrlDescription;
CComboBox ctrlCombo;
public:
tstring description;
tstring title;
int curSel = 0;
StringList strings;
enum { IDD = IDD_COMBO };
BEGIN_MSG_MAP(ComboDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
MESSAGE_HANDLER(WM_SETFOCUS, onFocus)
COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
END_MSG_MAP()
ComboDlg() { }
ComboDlg(const CComboBox& aCombo) : ctrlCombo(aCombo) { }
ComboDlg(const StringList& aStrings);
void setList(const StringList& aStrings) { strings = aStrings; }
LRESULT onFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
};
class KickDlg : public CDialogImpl<KickDlg> {
CComboBox ctrlLine;
CStatic ctrlDescription;
public:
tstring line;
static tstring m_sLastMsg;
tstring description;
tstring title;
enum { IDD = IDD_KICK };
BEGIN_MSG_MAP(KickDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
MESSAGE_HANDLER(WM_SETFOCUS, onFocus)
COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
END_MSG_MAP()
KickDlg() {};
LRESULT onFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
ctrlLine.SetFocus();
return FALSE;
}
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
private:
tstring Msgs[20];
};
class ChngPassDlg : public CDialogImpl<ChngPassDlg>
{
CEdit ctrlOldLine;
CEdit ctrlNewLine;
CEdit ctrlConfirmLine;
CStatic ctrlOldDescription;
CStatic ctrlNewDescription;
CStatic ctrlConfirmDescription;
CButton ctrlOK;
CButton ctrlCancel;
public:
tstring Oldline;
tstring Newline;
tstring Confirmline;
tstring title;
tstring ok;
tstring cancel;
bool hideold;
bool okexit;
enum { IDD = IDD_CHANGE_PASS };
BEGIN_MSG_MAP(LineDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
MESSAGE_HANDLER(WM_SETFOCUS, onFocus)
COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
END_MSG_MAP()
ChngPassDlg();
LRESULT onFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
};
class PassDlg : public CDialogImpl<PassDlg>
{
CEdit ctrlLine;
CStatic ctrlDescription;
CButton ctrlOK;
public:
tstring line;
tstring description;
tstring title;
bool password;
tstring ok;
enum { IDD = IDD_PASS };
BEGIN_MSG_MAP(PassDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
MESSAGE_HANDLER(WM_SETFOCUS, onFocus)
COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
END_MSG_MAP()
PassDlg() : password(true) { };
LRESULT onFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
};
#endif // !defined(LINE_DLG_H)