11
11
// ---------------------------------------------------------------------
12
12
// ダイアログプロシージャ(設定ダイアログ)
13
13
// ---------------------------------------------------------------------
14
- BOOL CALLBACK wndproc_daialog_settings (HWND hDlg , UINT msg, WPARAM wparam, LPARAM lparam)
14
+ BOOL CALLBACK dialogproc_settings (HWND hwnd , UINT msg, WPARAM wparam, LPARAM lparam)
15
15
{
16
16
static HDC hdc, hdc_mem;
17
17
static HWND hCombo, hCombo2;
18
18
static HBITMAP bitmap;
19
19
switch (msg) {
20
20
case WM_CLOSE:
21
21
DeleteObject (bitmap);
22
- EndDialog (hDlg , 1 );
22
+ EndDialog (hwnd , 1 );
23
23
return 0 ;
24
24
25
25
case WM_INITDIALOG:
26
- if (g_config.trace ) SendMessage (GetDlgItem (hDlg , IDC_PREVIOUSCURVE), BM_SETCHECK, BST_CHECKED, 0 );
27
- if (g_config.alert ) SendMessage (GetDlgItem (hDlg , IDC_ALERT), BM_SETCHECK, BST_CHECKED, 0 );
28
- if (g_config.auto_copy ) SendMessage (GetDlgItem (hDlg , IDC_AUTOCOPY), BM_SETCHECK, BST_CHECKED, 0 );
29
- hCombo = GetDlgItem (hDlg , IDC_THEME);
26
+ if (g_config.trace ) SendMessage (GetDlgItem (hwnd , IDC_PREVIOUSCURVE), BM_SETCHECK, BST_CHECKED, 0 );
27
+ if (g_config.alert ) SendMessage (GetDlgItem (hwnd , IDC_ALERT), BM_SETCHECK, BST_CHECKED, 0 );
28
+ if (g_config.auto_copy ) SendMessage (GetDlgItem (hwnd , IDC_AUTOCOPY), BM_SETCHECK, BST_CHECKED, 0 );
29
+ hCombo = GetDlgItem (hwnd , IDC_THEME);
30
30
SendMessage (hCombo, CB_ADDSTRING, 0 , (LPARAM)" ダーク" );
31
31
SendMessage (hCombo, CB_ADDSTRING, 0 , (LPARAM)" ライト" );
32
32
SendMessage (hCombo, CB_SETCURSEL, g_config.theme , 0 );
@@ -36,19 +36,19 @@ BOOL CALLBACK wndproc_daialog_settings(HWND hDlg, UINT msg, WPARAM wparam, LPARA
36
36
case WM_COMMAND:
37
37
switch (LOWORD (wparam)) {
38
38
case IDOK:
39
- g_config.trace = SendMessage (GetDlgItem (hDlg , IDC_PREVIOUSCURVE), BM_GETCHECK, 0 , 0 );
40
- g_config.alert = SendMessage (GetDlgItem (hDlg , IDC_ALERT), BM_GETCHECK, 0 , 0 );
41
- g_config.auto_copy = SendMessage (GetDlgItem (hDlg , IDC_AUTOCOPY), BM_GETCHECK, 0 , 0 );
39
+ g_config.trace = SendMessage (GetDlgItem (hwnd , IDC_PREVIOUSCURVE), BM_GETCHECK, 0 , 0 );
40
+ g_config.alert = SendMessage (GetDlgItem (hwnd , IDC_ALERT), BM_GETCHECK, 0 , 0 );
41
+ g_config.auto_copy = SendMessage (GetDlgItem (hwnd , IDC_AUTOCOPY), BM_GETCHECK, 0 , 0 );
42
42
g_config.theme = SendMessage (hCombo, CB_GETCURSEL, 0 , 0 );
43
43
g_fp->exfunc ->ini_save_int (g_fp, " theme" , g_config.theme );
44
44
g_fp->exfunc ->ini_save_int (g_fp, " show_previous_curve" , g_config.trace );
45
45
g_fp->exfunc ->ini_save_int (g_fp, " show_alerts" , g_config.alert );
46
46
g_fp->exfunc ->ini_save_int (g_fp, " auto_copy" , g_config.auto_copy );
47
- EndDialog (hDlg , 1 );
47
+ EndDialog (hwnd , 1 );
48
48
return 0 ;
49
49
50
50
case IDCANCEL:
51
- EndDialog (hDlg , 1 );
51
+ EndDialog (hwnd , 1 );
52
52
return 0 ;
53
53
}
54
54
}
@@ -60,37 +60,37 @@ BOOL CALLBACK wndproc_daialog_settings(HWND hDlg, UINT msg, WPARAM wparam, LPARA
60
60
// ---------------------------------------------------------------------
61
61
// ダイアログプロシージャ(カーブ値の設定)
62
62
// ---------------------------------------------------------------------
63
- BOOL CALLBACK wndproc_daialog_value (HWND hDlg , UINT msg, WPARAM wparam, LPARAM lparam)
63
+ BOOL CALLBACK dialogproc_value (HWND hwnd , UINT msg, WPARAM wparam, LPARAM lparam)
64
64
{
65
65
TCHAR buffer[30 ];
66
66
std::regex re (R"( ^((\d+ *, *)|(\d*\.\d* *, *))((-?\d+ *, *)|(-?\d*\.\d* *, *))((\d+ *, *)|(\d*\.\d* *, *))((-?\d+ *)|(-?\d*\.\d* *))$)" );
67
67
switch (msg) {
68
68
case WM_CLOSE:
69
- EndDialog (hDlg , 1 );
69
+ EndDialog (hwnd , 1 );
70
70
return 0 ;
71
71
case WM_COMMAND:
72
72
switch (LOWORD (wparam)) {
73
73
case IDOK:
74
- GetDlgItemText (hDlg , IDC_EDIT_VALUE, buffer, 30 );
74
+ GetDlgItemText (hwnd , IDC_EDIT_VALUE, buffer, 30 );
75
75
if (std::regex_match (buffer, re)) {
76
76
std::string str = buffer;
77
77
std::vector<std::string> vec = split (buffer, ' ,' );
78
- g_curve_value.ctpt [0 ].x = (int )(std::stod (vec[0 ]) * 1000 );
79
- g_curve_value.ctpt [0 ].x = (int )(std::stod (vec[0 ]) * 1000 );
80
- g_curve_value.ctpt [0 ].y = (int )(std::stod (vec[1 ]) * 1000 );
81
- g_curve_value.ctpt [1 ].x = (int )(std::stod (vec[2 ]) * 1000 );
82
- g_curve_value.ctpt [1 ].y = (int )(std::stod (vec[3 ]) * 1000 );
78
+ g_curve_value.ctpt [0 ].x = (int )(std::stod (vec[0 ]) * CE_GR_RESOLUTION );
79
+ g_curve_value.ctpt [0 ].x = (int )(std::stod (vec[0 ]) * CE_GR_RESOLUTION );
80
+ g_curve_value.ctpt [0 ].y = (int )(std::stod (vec[1 ]) * CE_GR_RESOLUTION );
81
+ g_curve_value.ctpt [1 ].x = (int )(std::stod (vec[2 ]) * CE_GR_RESOLUTION );
82
+ g_curve_value.ctpt [1 ].y = (int )(std::stod (vec[3 ]) * CE_GR_RESOLUTION );
83
83
84
84
for (int i = 0 ; i < 2 ; i++) {
85
- if (g_curve_value.ctpt [i].y > 3730 ) g_curve_value.ctpt [i].y = 3730 ;
86
- else if (g_curve_value.ctpt [i].y < -2730 ) g_curve_value.ctpt [i].y = -2730 ;
85
+ if (g_curve_value.ctpt [i].y > 3.73 * CE_GR_RESOLUTION ) g_curve_value.ctpt [i].y = 3.73 * CE_GR_RESOLUTION ;
86
+ else if (g_curve_value.ctpt [i].y < -2.73 * CE_GR_RESOLUTION ) g_curve_value.ctpt [i].y = -2.73 * CE_GR_RESOLUTION ;
87
87
}
88
- EndDialog (hDlg , 1 );
88
+ EndDialog (hwnd , 1 );
89
89
}
90
- else if (g_config.alert )MessageBox (hDlg , CE_STR_INVALIDINPUT, CE_PLUGIN_NAME, MB_OK | MB_ICONINFORMATION);
90
+ else if (g_config.alert )MessageBox (hwnd , CE_STR_INVALIDINPUT, CE_PLUGIN_NAME, MB_OK | MB_ICONINFORMATION);
91
91
return 0 ;
92
92
case IDCANCEL:
93
- EndDialog (hDlg , 1 );
93
+ EndDialog (hwnd , 1 );
94
94
return 0 ;
95
95
}
96
96
}
@@ -102,7 +102,7 @@ BOOL CALLBACK wndproc_daialog_value(HWND hDlg, UINT msg, WPARAM wparam, LPARAM l
102
102
// ---------------------------------------------------------------------
103
103
// ダイアログプロシージャ(カーブ読み取り)
104
104
// ---------------------------------------------------------------------
105
- BOOL CALLBACK wndproc_daialog_read (HWND hDlg , UINT msg, WPARAM wparam, LPARAM lparam)
105
+ BOOL CALLBACK dialogproc_read (HWND hwnd , UINT msg, WPARAM wparam, LPARAM lparam)
106
106
{
107
107
// エディットコントロール
108
108
HWND edit;
@@ -113,44 +113,44 @@ BOOL CALLBACK wndproc_daialog_read(HWND hDlg, UINT msg, WPARAM wparam, LPARAM lp
113
113
std::string str;
114
114
switch (msg) {
115
115
case WM_INITDIALOG:
116
- edit = GetDlgItem (hDlg , IDC_EDIT_READ);
116
+ edit = GetDlgItem (hwnd , IDC_EDIT_READ);
117
117
SendMessage (edit, EM_SETLIMITTEXT, 11 , 0 );
118
118
return 0 ;
119
119
120
120
case WM_CLOSE:
121
- EndDialog (hDlg , 1 );
121
+ EndDialog (hwnd , 1 );
122
122
return 0 ;
123
123
124
124
case WM_KEYDOWN:
125
125
if (wparam == VK_RETURN)
126
- SendMessage (hDlg , WM_COMMAND, MAKEWPARAM (IDOK, 0 ), 0 );
126
+ SendMessage (hwnd , WM_COMMAND, MAKEWPARAM (IDOK, 0 ), 0 );
127
127
return 0 ;
128
128
129
129
case WM_COMMAND:
130
130
switch (LOWORD (wparam)) {
131
131
case IDOK:
132
- GetDlgItemText (hDlg , IDC_EDIT_READ, buffer, 11 );
132
+ GetDlgItemText (hwnd , IDC_EDIT_READ, buffer, 11 );
133
133
if (std::regex_match (buffer, re)) {
134
134
str = buffer;
135
135
try {
136
136
value = std::stoi (str);
137
137
}
138
138
catch (std::out_of_range& e) {
139
- if (g_config.alert ) MessageBox (hDlg , CE_STR_OUTOFRANGE, CE_PLUGIN_NAME, MB_OK | MB_ICONERROR);
139
+ if (g_config.alert ) MessageBox (hwnd , CE_STR_OUTOFRANGE, CE_PLUGIN_NAME, MB_OK | MB_ICONERROR);
140
140
return 0 ;
141
141
}
142
142
if ((value < -2147483647 || 2122746761 < value) && g_config.alert ) {
143
- MessageBox (hDlg , CE_STR_OUTOFRANGE, CE_PLUGIN_NAME, MB_OK | MB_ICONERROR);
143
+ MessageBox (hwnd , CE_STR_OUTOFRANGE, CE_PLUGIN_NAME, MB_OK | MB_ICONERROR);
144
144
return 0 ;
145
145
}
146
146
g_curve_value.read_value_1d (value);
147
- EndDialog (hDlg , 1 );
147
+ EndDialog (hwnd , 1 );
148
148
}
149
149
else if (g_config.alert )
150
- MessageBox (hDlg , CE_STR_INVALIDINPUT, CE_PLUGIN_NAME, MB_OK | MB_ICONERROR);
150
+ MessageBox (hwnd , CE_STR_INVALIDINPUT, CE_PLUGIN_NAME, MB_OK | MB_ICONERROR);
151
151
return 0 ;
152
152
case IDCANCEL:
153
- EndDialog (hDlg , 1 );
153
+ EndDialog (hwnd , 1 );
154
154
return 0 ;
155
155
}
156
156
}
@@ -162,7 +162,7 @@ BOOL CALLBACK wndproc_daialog_read(HWND hDlg, UINT msg, WPARAM wparam, LPARAM lp
162
162
// ---------------------------------------------------------------------
163
163
// ダイアログプロシージャ(カーブ保存ダイアログ)
164
164
// ---------------------------------------------------------------------
165
- BOOL CALLBACK wndproc_daialog_save (HWND hDlg , UINT msg, WPARAM wparam, LPARAM lparam)
165
+ BOOL CALLBACK dialogproc_save (HWND hwnd , UINT msg, WPARAM wparam, LPARAM lparam)
166
166
{
167
167
// 4次元カーブ!Dを生成
168
168
HDC hdc;
@@ -176,10 +176,10 @@ BOOL CALLBACK wndproc_daialog_save(HWND hDlg, UINT msg, WPARAM wparam, LPARAM lp
176
176
177
177
switch (msg) {
178
178
case WM_CLOSE:
179
- EndDialog (hDlg , 1 );
179
+ EndDialog (hwnd , 1 );
180
180
return 0 ;
181
181
case WM_INITDIALOG:
182
- edit = GetDlgItem (hDlg , IDC_EDIT_SAVE);
182
+ edit = GetDlgItem (hwnd , IDC_EDIT_SAVE);
183
183
SendMessage (edit, EM_SETLIMITTEXT, 64 , 0 );
184
184
return 0 ;
185
185
case WM_PAINT:
@@ -195,28 +195,28 @@ BOOL CALLBACK wndproc_daialog_save(HWND hDlg, UINT msg, WPARAM wparam, LPARAM lp
195
195
0 ,
196
196
NULL
197
197
);
198
- hdc = GetDC (hDlg );
198
+ hdc = GetDC (hwnd );
199
199
SelectObject (hdc, hfValues);
200
200
SetBkMode (hdc, TRANSPARENT);
201
201
TextOut (hdc, 100 , 13 , lpsResult, strlen (lpsResult));
202
202
DeleteObject (hfValues);
203
- ReleaseDC (hDlg , hdc);
203
+ ReleaseDC (hwnd , hdc);
204
204
return 0 ;
205
205
206
206
case WM_COMMAND:
207
207
switch (LOWORD (wparam)) {
208
208
case IDOK:
209
209
ce::Preset_Value additem;
210
- GetDlgItemText (hDlg , IDC_EDIT_SAVE, buffer, 64 );
210
+ GetDlgItemText (hwnd , IDC_EDIT_SAVE, buffer, 64 );
211
211
if (strlen (buffer) < 64 && strlen (buffer) != 0 ) {
212
212
additem = { buffer, g_curve_value.ctpt [0 ].x , g_curve_value.ctpt [0 ].y , g_curve_value.ctpt [1 ].x , g_curve_value.ctpt [1 ].y };
213
213
g_presets_value.emplace_back (additem);
214
- EndDialog (hDlg , 1 );
214
+ EndDialog (hwnd , 1 );
215
215
}
216
- else if (strlen (buffer) == 0 && g_config.alert ) MessageBox (hDlg , CE_STR_INPUTANAME, CE_PLUGIN_NAME, MB_OK | MB_ICONINFORMATION);
216
+ else if (strlen (buffer) == 0 && g_config.alert ) MessageBox (hwnd , CE_STR_INPUTANAME, CE_PLUGIN_NAME, MB_OK | MB_ICONINFORMATION);
217
217
return 0 ;
218
218
case IDCANCEL:
219
- EndDialog (hDlg , 1 );
219
+ EndDialog (hwnd , 1 );
220
220
return 0 ;
221
221
}
222
222
return 0 ;
0 commit comments