From: H.G. Muller Date: Sat, 23 Jan 2010 20:44:36 +0000 (+0100) Subject: Accept for changing chat partner X-Git-Tag: v4.4.3.20100220~23 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=b9d21ac5e9699a398501917533c3d5c8d2295283;p=xboard.git 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. --- 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: