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