From 6256f7e127a42d71c5e99a0bf70eee0a599c5839 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 363bebd..48d555a 100644 --- a/winboard/wchat.c +++ b/winboard/wchat.c @@ -136,6 +136,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