Ability to cancel keys input dialog

This commit is contained in:
Alexey 'Cluster' Avdyukhin 2021-06-08 11:07:56 +03:00 committed by zeromus
parent b88be3a9ee
commit 8733067f5b
3 changed files with 1241 additions and 1234 deletions

View File

@ -1148,6 +1148,7 @@ static void ClearExtraMeta(int* key)
static int DWBStarted;
static ButtConfig *DWBButtons;
static ButtConfig DWBButtonsBackup;
static const char *DWBText;
static uint8 DWBFirstPress;
@ -1259,6 +1260,7 @@ static INT_PTR CALLBACK DWBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
key = 0;
DWBFirstPress = 1;
memset(keyonce, 0, sizeof(keyonce));
memcpy(&DWBButtonsBackup, DWBButtons, sizeof(ButtConfig));
SetWindowText(hwndDlg, (char*)DWBText); //mbg merge 7/17/06 added cast
BeginJoyWait(hwndDlg);
KeyboardSetBackgroundAccess(true);
@ -1289,6 +1291,9 @@ static INT_PTR CALLBACK DWBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
free(nstr);
}
break;
case BTN_CANCEL:
memcpy(DWBButtons, &DWBButtonsBackup, sizeof(ButtConfig));
goto gornk;
case BTN_CLOSE:
gornk:
KillTimer(hwndDlg,666);

View File

@ -114,7 +114,8 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "Press a key or a button",LBL_DWBDIALOG_TEXT,7,9,237,8
PUSHBUTTON "Clear",BTN_CLEAR,64,32,50,14
PUSHBUTTON "OK",BTN_CLOSE,188,33,50,14
PUSHBUTTON "Cancel",BTN_CANCEL,126,32,50,14
PUSHBUTTON "OK",BTN_CLOSE,188,32,50,14
END
FKBDIALOG DIALOGEX 13, 72, 402, 194

File diff suppressed because it is too large Load Diff