From b9d21ac5e9699a398501917533c3d5c8d2295283 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 23 Jan 2010 21:44:36 +0100 Subject: [PATCH] Accept for changing chat partner A kludge stolen from Alessandro's GameList filter allowed to let the typing of while updating the chat-partner field of the WinBoard chat windows to act as pressing the Change button. Gives focus to the input field of the window afterwards. --- winboard/wchat.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/winboard/wchat.c b/winboard/wchat.c index fbf3e15..2886b42 100644 --- a/winboard/wchat.c +++ b/winboard/wchat.c @@ -137,6 +137,7 @@ LRESULT CALLBACK ChatProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam static SnapData sd; char buf[MSG_SIZ], mess[MSG_SIZ]; int partner = -1, i; + static BOOL filterHasFocus[MAX_CHAT]; for(i=0; i is pressed while editing the filter, it's better to apply + the filter rather than selecting the current game. + */ + if( LOWORD(wParam) == IDC_ChatPartner ) { + switch( HIWORD(wParam) ) { + case EN_SETFOCUS: + filterHasFocus[partner] = TRUE; + break; + case EN_KILLFOCUS: + filterHasFocus[partner] = FALSE; + break; + } + } + + if( filterHasFocus[partner] && (LOWORD(wParam) == IDC_Send) ) { + SetFocus(GetDlgItem(hDlg, OPT_ChatInput)); + wParam = IDC_Change; + } + /* [AS] End command replacement */ + switch (LOWORD(wParam)) { case IDCANCEL: -- 1.7.0.4