-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathConfigDialog.h
More file actions
203 lines (164 loc) · 5.42 KB
/
Copy pathConfigDialog.h
File metadata and controls
203 lines (164 loc) · 5.42 KB
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/* -------------------------------------
This file is part of AnalysePlugin for NotePad++
Copyright (c) 2022 Matthias H. mattesh(at)gmx.net
partly copied from the NotePad++ project from
Don HO don.h(at)free.fr
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, see <https://www.gnu.org/licenses/>.
------------------------------------- */
#ifndef CONFIG_DIALOG_H
#define CONFIG_DEFINE_H
#include "StaticDialog.h"
#include "PluginInterface.h"
#include "URLCtrl.h"
#include <string>
#include <set>
#include "chardefines.h"
#include "MyPlugin.h"
#include "tclComboBoxCtrl.h"
#include "tclPattern.h"
#include "ColourPicker2.h"
#include "AddCtxDlg.h"
typedef std::set<generic_string> tlsString;
enum teOnEnterAction {
enOnEntNoAction,
enOnEntUpdate,
enOnEntAdd,
max_onEnterAction
};
class ConfigDialog : public StaticDialog
{
public:
ConfigDialog()
: StaticDialog()
, _pFindDlg(0)
, _pResultDlg(0)
, _pParent(0)
, _cmdId(0)
, mOnEnterAction(enOnEntNoAction)
, mbOkPressed(false)
, mResultFontSize(8)
,_pFgColour(0)
,_pBgColour(0)
,mOnAutoUpdate(0)
,mUseBookmark(1)
,mDisplayLineNo(1)
,mNumOfCfgFiles(4)
,mIsSyncScroll(true)
,mDblClickJumps2EditView(false)
,mIsConfigured(false)
{}
void init(HINSTANCE hInst, NppData nppData);
void setFontList(HWND hWnd);
void setOnAutoUpdate(int iOn) {
mOnAutoUpdate = iOn;
}
int getOnAutoUpdate() const {
return mOnAutoUpdate;
}
void setUseBookmark(int iOn) {
mUseBookmark = iOn;
}
int getUseBookmark() const {
return mUseBookmark;
}
int getDisplayLineNo() const {
return mDisplayLineNo;
}
void setDisplayLineNo(bool iOn) {
mDisplayLineNo = iOn;
}
void setOnEnterAction(teOnEnterAction i) {
mOnEnterAction = i;
}
teOnEnterAction getOnEnterAction() const {
return mOnEnterAction ;
}
void setDblClickJumps2EditView(bool bJump) {
mDblClickJumps2EditView = bJump;
}
bool getDblClickJumps2EditView() const {
return mDblClickJumps2EditView;
}
generic_string getOnEnterActionStr() const ;
void setOnEnterActionStr(const generic_string& action) ;
void setFontText(const generic_string& str);
const generic_string& getFontText() const;
void setFontSize(unsigned s);
void setFontSizeStr(const generic_string& s);
unsigned getFontSize() const;
generic_string getFontSizeStr() const;
const generic_string getNumOfCfgFilesStr() const;
void setNumOfCfgFilesStr(const generic_string& str);
void setDefaultPattern(const tclPattern& p);
void setDialogData(const tclPattern& p);
// returns true if pattern was set.
bool getDialogData(tclPattern& p) const;
void doDialog(int FuncCmdId=0);
bool isConfigured() const {
return mIsConfigured;
}
virtual void destroy() {
// remove data
}
void setParent(MyPlugin* parent, Window* pFindDlg, Window* pResultDlg) {
_pParent = parent;
_pFindDlg = pFindDlg;
_pResultDlg = pResultDlg;
}
bool getIsSyncScroll() const {
return mIsSyncScroll;
}
void setIsSyncScroll(bool bIsScroll) {
mIsSyncScroll = bIsScroll;
}
// used to retrive the different font names from windows
static int CALLBACK EnumFontFamExProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *, int, LPARAM lParam) ;
protected :
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
virtual INT_PTR CALLBACK run_dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
/* Handles */
NppData _nppData;
Window* _pFindDlg; // used to inform find dialog about update
Window* _pResultDlg; // used to inform result dialog about update
MyPlugin* _pParent;
int _cmdId;
//tclComboBoxCtrl mCmbSearchText;
tclComboBoxCtrl mCmbSearchType;
tclComboBoxCtrl mCmbSelType;
tclComboBoxCtrl mCmbNumOfCfgFiles;
#ifdef RESULT_COLORING
// replaced by colorPicker: tclComboBoxCtrl mCmbColor;
#endif
tclComboBoxCtrl mCmbOnEnterAction;
tclPattern mDefPat;
static const TCHAR* transOnEnterAction[max_onEnterAction];
teOnEnterAction mOnEnterAction;
bool mbOkPressed;
tlsString mlsFontList;
/** defines the name of the font to be used for the result */
tclComboBoxCtrl mCmbFontName;
/** defines the text size in the result window **/
tclComboBoxCtrl mCmbFontSize;
generic_string mResultFontName;
unsigned mResultFontSize;
ColourPicker2* _pFgColour;
ColourPicker2* _pBgColour;
int mOnAutoUpdate;
int mUseBookmark;
bool mDisplayLineNo;
int mNumOfCfgFiles;
AddCtxDlg _addCtxDlg;
bool mIsSyncScroll;
bool mDblClickJumps2EditView;
bool mIsConfigured;
};
#endif // CONFIG_DEFINE_H