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

View File

@ -11,12 +11,12 @@
#define LBL_KEY_COMBO 100
#define LBL_CDLOGGER_CODECOUNT 100
#define CHECK_PALETTE_ENABLED 100
#define LBL_DWBDIALOG_TEXT 100 | WS_TABSTOP
#define GRP_GAMEPAD1 100
#define IDC_TRACER_LOG 100
#define MENU_MV_FILE_SAVE 100
#define IDC_ROMPATCHER_OFFSET_BOX 100
#define IDC_ASSEMBLER_HISTORY 100
#define LBL_DWBDIALOG_TEXT 100
#define MENU_CLOSE_FILE 101
#define CB_DISABLE_SPEED_THROTTLING 101
#define LBL_CDLOGGER_DATACOUNT 101
@ -246,6 +246,7 @@
#define IDI_ICON4 201
#define BTN_OK 201
#define BUTTON_BATTERY 201
#define BTN_CLEAR2 201
#define MENU_EJECT_DISK 202
#define TXT_FAM 202
#define MENU_MV_EDIT_PASTE 202