*\r
* Author: H.G.Muller (August 2009)\r
*\r
+ * Copyright 2009, 2010 Free Software Foundation, Inc.\r
+ *\r
* ------------------------------------------------------------------------\r
*\r
* GNU XBoard is free software: you can redistribute it and/or modify\r
#include <dlgs.h>\r
\r
#include "common.h"\r
-#include "winboard.h"\r
#include "frontend.h"\r
+#include "winboard.h"\r
#include "backend.h"\r
\r
#include "wsnap.h"\r
int clientHeight;\r
int maxControlWidth;\r
int buttonWidth, buttonHeight;\r
-#if 0\r
-}\r
-#else\r
+\r
/* Initialize variables */\r
GetClientRect( hDlg, &rc );\r
\r
// InvalidateRect( GetDlgItem(hDlg,IDC_EngineMemo1), NULL, FALSE );\r
// InvalidateRect( GetDlgItem(hDlg,IDC_EngineMemo2), NULL, FALSE );\r
}\r
-#endif\r
\r
// front end. Actual printing of PV lines into the output field\r
static void InsertIntoMemo( HANDLE hDlg, char * text )\r
static SnapData sd;\r
char buf[MSG_SIZ], mess[MSG_SIZ];\r
int partner = -1, i;\r
+ static BOOL filterHasFocus[MAX_CHAT];\r
\r
for(i=0; i<MAX_CHAT; i++) if(hDlg == chatHandle[i]) { partner = i; break; }\r
\r
SetWindowText(hDlg, buf);\r
}\r
chatPartner[partner][0] = 0;\r
+ filterHasFocus[partner] = FALSE;\r
\r
return FALSE;\r
\r
case WM_COMMAND:\r
+ /* \r
+ [AS]\r
+ If <Enter> is pressed while editing the filter, it's better to apply\r
+ the filter rather than selecting the current game.\r
+ */\r
+ if( LOWORD(wParam) == IDC_ChatPartner ) {\r
+ switch( HIWORD(wParam) ) {\r
+ case EN_SETFOCUS:\r
+ filterHasFocus[partner] = TRUE;\r
+ break;\r
+ case EN_KILLFOCUS:\r
+ filterHasFocus[partner] = FALSE;\r
+ break;\r
+ }\r
+ }\r
+\r
+ if( filterHasFocus[partner] && (LOWORD(wParam) == IDC_Send) ) {\r
+ SetFocus(GetDlgItem(hDlg, OPT_ChatInput));\r
+ wParam = IDC_Change;\r
+ }\r
+ /* [AS] End command replacement */\r
+\r
switch (LOWORD(wParam)) {\r
\r
case IDCANCEL:\r
GetDlgItemText(hDlg, OPT_ChatInput, mess, MSG_SIZ);\r
SetDlgItemText(hDlg, OPT_ChatInput, "");\r
// from here on it could be back-end\r
- if(strcmp("WHISPER", chatPartner[partner])) {\r
- sprintf(buf, "> %s\n", mess); // echo only tells, not whispers\r
+ if(!strcmp("WHISPER", chatPartner[partner]))\r
+ sprintf(buf, "whisper %s\n", mess); // WHISPER box uses "whisper" to send\r
+ else {\r
+ if(!atoi(chatPartner[partner])) {\r
+ sprintf(buf, "> %s\n", mess); // echo only tells to handle, not channel\r
InsertIntoMemo(hDlg, buf);\r
+ sprintf(buf, "xtell %s %s\n", chatPartner[partner], mess);\r
+ } else\r
sprintf(buf, "tell %s %s\n", chatPartner[partner], mess);\r
- } else sprintf(buf, "whisper %s\n", mess); // SAY box uses "say" to send\r
+ }\r
SendToICS(buf);\r
break;\r
\r