From 065e70048daa70bbe2db15175441c627782ad11d Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 22 Apr 2018 23:59:28 +0200 Subject: [PATCH] [SYSSETUP] Initialize the property sheet page dialog and implement the Defaults button --- dll/win32/syssetup/proppage.c | 80 +++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/dll/win32/syssetup/proppage.c b/dll/win32/syssetup/proppage.c index 6cab3faab10..d200a841eaf 100644 --- a/dll/win32/syssetup/proppage.c +++ b/dll/win32/syssetup/proppage.c @@ -110,6 +110,81 @@ MouseOnDialogInit( (LPARAM)szBuffer); } + /* Set the input buffer length range: 100-300 */ + SendDlgItemMessageW(hwndDlg, + IDC_PS2MOUSEINPUTUPDN, + UDM_SETRANGE32, + 100, + 300); + + SendDlgItemMessageW(hwndDlg, + IDC_PS2MOUSEINPUTUPDN, + UDM_SETPOS32, + 0, + 100); +} + + +static +VOID +MouseOnCommand( + HWND hwndDlg, + WPARAM wParam, + LPARAM lParam) +{ + switch (LOWORD(wParam)) + { + case IDC_PS2MOUSESAMPLERATE: + case IDC_PS2MOUSEWHEEL: + case IDC_PS2MOUSEINPUTLEN: + case IDC_PS2MOUSEFASTINIT: + if (HIWORD(wParam) == CBN_SELCHANGE || + HIWORD(wParam) == CBN_EDITCHANGE) + { + /* Enable the Apply button */ + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + + case IDC_PS2MOUSEDEFAULTS: + if (HIWORD(wParam) == BN_CLICKED) + { + /* Sample rate: 100 */ + SendDlgItemMessageW(hwndDlg, + IDC_PS2MOUSESAMPLERATE, + CB_SETCURSEL, + 4, + 0); + + /* Wheel detection: Assume wheel present */ + SendDlgItemMessageW(hwndDlg, + IDC_PS2MOUSEWHEEL, + CB_SETCURSEL, + 2, + 0); + + /* Input buffer length: 100 packets */ + SendDlgItemMessageW(hwndDlg, + IDC_PS2MOUSEINPUTUPDN, + UDM_SETPOS32, + 0, + 100); + + /* Fast Initialization: Checked */ + SendDlgItemMessage(hwndDlg, + IDC_PS2MOUSEFASTINIT, + BM_SETCHECK, + (WPARAM)BST_CHECKED, + (LPARAM)0); + + /* Enable the Apply button */ + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + + default: + break; + } } @@ -129,6 +204,11 @@ MouseDlgProc( case WM_INITDIALOG: MouseOnDialogInit(hwndDlg, lParam); return TRUE; + + case WM_COMMAND: + MouseOnCommand(hwndDlg, wParam, lParam); + break; + } return FALSE;