X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwchat.c;h=93e5ee1aa635b28ccddaafaa44c8e0d8e9ab9984;hb=d29830c7ae5d6dd1f92e5ccd9c8eb8b75acfbf5c;hp=a2b0825f53b521a01408fd0fc4b0cec9c91f8fd7;hpb=39c2aae6b7aa87dafe4ed42ecab530bc082bd314;p=xboard.git diff --git a/winboard/wchat.c b/winboard/wchat.c index a2b0825..93e5ee1 100644 --- a/winboard/wchat.c +++ b/winboard/wchat.c @@ -3,6 +3,8 @@ * * Author: H.G.Muller (August 2009) * + * Copyright 2009, 2010 Free Software Foundation, Inc. + * * ------------------------------------------------------------------------ * * GNU XBoard is free software: you can redistribute it and/or modify @@ -32,8 +34,8 @@ #include #include "common.h" -#include "winboard.h" #include "frontend.h" +#include "winboard.h" #include "backend.h" #include "wsnap.h" @@ -137,6 +139,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: @@ -180,8 +206,9 @@ LRESULT CALLBACK ChatProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam if(!atoi(chatPartner[partner])) { sprintf(buf, "> %s\n", mess); // echo only tells to handle, not channel InsertIntoMemo(hDlg, buf); - } sprintf(buf, "xtell %s %s\n", chatPartner[partner], mess); + } else + sprintf(buf, "tell %s %s\n", chatPartner[partner], mess); } SendToICS(buf); break;