mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[ACCESS] Improve IDC_RESET_COMBO selection (#5893)
Based on KRosUser's access.patch. CORE-19303
This commit is contained in:
parent
0a7a2824cf
commit
416d63026e
1 changed files with 6 additions and 3 deletions
|
@ -12,6 +12,7 @@
|
||||||
#define BAUDTICKS 6
|
#define BAUDTICKS 6
|
||||||
static UINT nBaudArray[BAUDTICKS] = {300, 1200, 2400, 4800, 9600, 19200};
|
static UINT nBaudArray[BAUDTICKS] = {300, 1200, 2400, 4800, 9600, 19200};
|
||||||
|
|
||||||
|
#define FIVE_MINS_IN_MS (5 * 60 * 1000)
|
||||||
|
|
||||||
INT_PTR CALLBACK
|
INT_PTR CALLBACK
|
||||||
SerialKeysDlgProc(HWND hwndDlg,
|
SerialKeysDlgProc(HWND hwndDlg,
|
||||||
|
@ -177,6 +178,7 @@ GeneralPageProc(HWND hwndDlg,
|
||||||
{
|
{
|
||||||
PGLOBAL_DATA pGlobalData;
|
PGLOBAL_DATA pGlobalData;
|
||||||
LPPSHNOTIFY lppsn;
|
LPPSHNOTIFY lppsn;
|
||||||
|
INT iCurSel;
|
||||||
|
|
||||||
pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
|
pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
|
||||||
|
|
||||||
|
@ -194,8 +196,9 @@ GeneralPageProc(HWND hwndDlg,
|
||||||
IDC_RESET_BOX,
|
IDC_RESET_BOX,
|
||||||
pGlobalData->accessTimeout.dwFlags & ATF_TIMEOUTON ? BST_CHECKED : BST_UNCHECKED);
|
pGlobalData->accessTimeout.dwFlags & ATF_TIMEOUTON ? BST_CHECKED : BST_UNCHECKED);
|
||||||
FillResetComboBox(GetDlgItem(hwndDlg, IDC_RESET_COMBO));
|
FillResetComboBox(GetDlgItem(hwndDlg, IDC_RESET_COMBO));
|
||||||
SendDlgItemMessage(hwndDlg, IDC_RESET_COMBO, CB_SETCURSEL,
|
pGlobalData->accessTimeout.iTimeOutMSec = max(FIVE_MINS_IN_MS, pGlobalData->accessTimeout.iTimeOutMSec);
|
||||||
(pGlobalData->accessTimeout.iTimeOutMSec / 300000) - 1, 0);
|
iCurSel = (pGlobalData->accessTimeout.iTimeOutMSec / FIVE_MINS_IN_MS) - 1;
|
||||||
|
SendDlgItemMessage(hwndDlg, IDC_RESET_COMBO, CB_SETCURSEL, iCurSel, 0);
|
||||||
EnableWindow(GetDlgItem(hwndDlg, IDC_RESET_COMBO),
|
EnableWindow(GetDlgItem(hwndDlg, IDC_RESET_COMBO),
|
||||||
pGlobalData->accessTimeout.dwFlags & ATF_TIMEOUTON ? TRUE : FALSE);
|
pGlobalData->accessTimeout.dwFlags & ATF_TIMEOUTON ? TRUE : FALSE);
|
||||||
|
|
||||||
|
@ -233,7 +236,7 @@ GeneralPageProc(HWND hwndDlg,
|
||||||
{
|
{
|
||||||
INT nSel;
|
INT nSel;
|
||||||
nSel = SendDlgItemMessage(hwndDlg, IDC_RESET_COMBO, CB_GETCURSEL, 0, 0);
|
nSel = SendDlgItemMessage(hwndDlg, IDC_RESET_COMBO, CB_GETCURSEL, 0, 0);
|
||||||
pGlobalData->accessTimeout.iTimeOutMSec = (ULONG)((nSel + 1) * 300000);
|
pGlobalData->accessTimeout.iTimeOutMSec = (DWORD)((nSel + 1) * FIVE_MINS_IN_MS);
|
||||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue