win: fix confusion with LPT checkboxes/comboboxes

This commit is contained in:
David Hrdlička
2020-04-10 15:14:34 +02:00
parent f29f6de245
commit 908ee7d046

View File

@@ -1438,6 +1438,9 @@ win_settings_ports_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
h=GetDlgItem(hdlg, IDC_CHECK_PARALLEL1 + i);
SendMessage(h, BM_SETCHECK, temp_lpt[i], 0);
h = GetDlgItem(hdlg, IDC_COMBO_LPT1 + i);
EnableWindow(h, temp_lpt[i] ? TRUE : FALSE);
}
for (i = 0; i < 2; i++) {
@@ -1449,6 +1452,27 @@ win_settings_ports_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_CHECK_PARALLEL1:
case IDC_CHECK_PARALLEL2:
case IDC_CHECK_PARALLEL3:
i = LOWORD(wParam) - IDC_CHECK_PARALLEL1;
h = GetDlgItem(hdlg, IDC_CHECK_PARALLEL1 + i);
if (SendMessage(h, BM_GETCHECK, 0, 0) == BST_CHECKED)
{
h = GetDlgItem(hdlg, IDC_COMBO_LPT1 + i);
EnableWindow(h, TRUE);
}
else
{
h = GetDlgItem(hdlg, IDC_COMBO_LPT1 + i);
EnableWindow(h, FALSE);
}
break;
}
break;
case WM_SAVESETTINGS:
for (i = 0; i < 3; i++) {
h = GetDlgItem(hdlg, IDC_COMBO_LPT1 + i);