@@ -23,12 +23,12 @@ struct BobWindow
23
23
24
24
enum class Ctrl : int
25
25
{
26
- Id1 = 1 ,
27
- Id2 = 2 ,
28
- Id3 = 3 ,
29
- Id4 = 4 ,
30
- Id5 = 5 ,
31
- Id6 = 6
26
+ Btn1 = 1 ,
27
+ Btn2 = 2 ,
28
+ TxtDbl1 = 3 ,
29
+ TxtDbl2 = 4 ,
30
+ BtnConverge = 5 ,
31
+ TxtEpsilon = 6
32
32
};
33
33
34
34
int msg_box (HWND hWnd, LPCWSTR msg, LPCWSTR title, UINT btns = MB_OK)
@@ -134,7 +134,7 @@ void btn2_click(HWND hWnd)
134
134
show_file_open (hWnd);
135
135
}
136
136
137
- void btn5_click (HWND hWnd){
137
+ void btnConverge_click (HWND hWnd){
138
138
converged (hWnd);
139
139
}
140
140
@@ -220,35 +220,35 @@ LRESULT CALLBACK window_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
220
220
auto id {(Ctrl)LOWORD (wParam)};
221
221
switch (id)
222
222
{
223
- case Ctrl::Id1 :
223
+ case Ctrl::Btn1 :
224
224
{
225
225
btn1_click (hwnd);
226
226
break ;
227
227
}
228
- case Ctrl::Id2 :
228
+ case Ctrl::Btn2 :
229
229
{
230
230
btn2_click (hwnd);
231
231
break ;
232
232
}
233
- case Ctrl::Id5 :
233
+ case Ctrl::BtnConverge :
234
234
{
235
- btn5_click (hwnd);
235
+ btnConverge_click (hwnd);
236
236
}
237
237
}
238
- // ignore 3 and 4, which are textboxes
238
+ // ignore textboxes for now
239
239
return 0 ;
240
240
}
241
241
case WM_CREATE:
242
242
{
243
243
CREATESTRUCT *pCreate {reinterpret_cast <CREATESTRUCT *>(lParam)};
244
244
BobWindow *pData = static_cast <BobWindow *>(pCreate->lpCreateParams );
245
245
LONG_PTR result {SetWindowLongPtr (hwnd, GWLP_USERDATA, (LONG_PTR)pData)};
246
- pData->txt1 = create_txtbox ((LPCWSTR)L" 1.01" , Ctrl::Id3 , 115 , 100 , 100 , 25 , hwnd);
247
- pData->txt2 = create_txtbox ((LPCWSTR)L" 1.02" , Ctrl::Id4 , 315 , 100 , 100 , 25 , hwnd);
248
- pData->txtEpsilon = create_txtbox ((LPCWSTR)L" .001" , Ctrl::Id6 , 505 , 100 , 100 , 25 , hwnd);
249
- create_button ((LPCWSTR)L" button1" , Ctrl::Id1 , 50 , 200 , 100 , 25 , hwnd);
250
- create_button ((LPCWSTR)L" button2" , Ctrl::Id2 , 200 , 200 , 100 , 25 , hwnd);
251
- create_button ((LPCWSTR)L" converge" , Ctrl::Id5 , 350 , 200 , 100 , 25 , hwnd);
246
+ pData->txt1 = create_txtbox ((LPCWSTR)L" 1.01" , Ctrl::TxtDbl1 , 115 , 100 , 100 , 25 , hwnd);
247
+ pData->txt2 = create_txtbox ((LPCWSTR)L" 1.02" , Ctrl::TxtDbl2 , 315 , 100 , 100 , 25 , hwnd);
248
+ pData->txtEpsilon = create_txtbox ((LPCWSTR)L" .001" , Ctrl::TxtEpsilon , 505 , 100 , 100 , 25 , hwnd);
249
+ create_button ((LPCWSTR)L" button1" , Ctrl::Btn1 , 50 , 200 , 100 , 25 , hwnd);
250
+ create_button ((LPCWSTR)L" button2" , Ctrl::Btn2 , 200 , 200 , 100 , 25 , hwnd);
251
+ create_button ((LPCWSTR)L" converge" , Ctrl::BtnConverge , 350 , 200 , 100 , 25 , hwnd);
252
252
return 0 ;
253
253
}
254
254
case WM_DESTROY:
0 commit comments