ChangeLog for XBoard/WinBoard
+* 11/5/2003: When a chess engine sends a "telluser" command (including
+the cases where "tellall" or "tellopponent" acts like telluser), the
+information now goes into a nonmodel popup that is automatically
+dismissed when the user clicks anywhere on the board. This fix is
+more significant on WinBoard, where formerly you got a fully modal
+dialog that had to be dismissed by clicking on OK before anything else
+could happen. The bug was issue #406 in the ToDo file.
+
* 11/1/2003: Removed email addresses from this file to reduce spam
load, as it gets linked to from the Web.
402. Internationalization. It probably isn't practical to retrofit
this into the current code base.
-****406. "telluser" needs to be made nonmodal in winboard.
-
409. One user requested a way to put a time delay in the middle of
sending zippyGameEnd commands. This would (for example) let the
computer do a seek only if its opponent doesn't accept a rematch
clock is not the master. I was going to do it in time for the July
2002 WCCC. Oops.
-***540. Pick up GNU Chess 5.07! (or whatever is newest)
-
541. Related to #327, John Iverson says, "It would be nice to have the
coordinates shown outside of the board along the edges, rather than in
the squares where they are hard to see and give a cluttered
- make sure ChangeLog is complete
- test changes
-*** up to date with mail received through 25 Oct 2003, except
+*** up to date with mail received through 5 Nov 2003, except
for the "protover 3" discussions on the chess-engines mailing list ***
* Look for communication commands
*/
if (!strncmp(message, "telluser ", 9)) {
- DisplayInformation(message + 9);
+ DisplayNote(message + 9);
return;
}
if (!strncmp(message, "tellusererror ", 14)) {
SendToICS(buf1);
}
} else {
- DisplayInformation(message + 13);
+ DisplayNote(message + 13);
}
return;
}
SendToICS(buf1);
}
} else {
- DisplayInformation(message + 8);
+ DisplayNote(message + 8);
}
return;
}
BOOLEAN analysisDialogUp = FALSE;\r
static int analysisX, analysisY, analysisH, analysisW;\r
\r
+char errorTitle[MSG_SIZ];\r
char errorMessage[2*MSG_SIZ];\r
HWND errorDialog = NULL;\r
BOOLEAN moveErrorMessageUp = FALSE;\r
\*---------------------------------------------------------------------------*/\r
\r
/* Nonmodal error box */\r
+LRESULT CALLBACK ErrorDialog(HWND hDlg, UINT message,\r
+ WPARAM wParam, LPARAM lParam);\r
+\r
+VOID\r
+ErrorPopUp(char *title, char *content)\r
+{\r
+ FARPROC lpProc;\r
+ char *p, *q;\r
+ BOOLEAN modal = hwndMain == NULL;\r
+\r
+ p = content;\r
+ q = errorMessage;\r
+ while (*p) {\r
+ if (*p == '\n') {\r
+ if (modal) {\r
+ *q++ = ' ';\r
+ p++;\r
+ } else {\r
+ *q++ = '\r';\r
+ *q++ = *p++;\r
+ }\r
+ } else {\r
+ *q++ = *p++;\r
+ }\r
+ }\r
+ *q = NULLCHAR;\r
+ strncpy(errorTitle, title, sizeof(errorTitle));\r
+ errorTitle[sizeof(errorTitle) - 1] = '\0';\r
+ \r
+ if (modal) {\r
+ MessageBox(NULL, errorMessage, errorTitle, MB_OK|MB_ICONEXCLAMATION);\r
+ } else {\r
+ lpProc = MakeProcInstance((FARPROC)ErrorDialog, hInst);\r
+ CreateDialog(hInst, MAKEINTRESOURCE(DLG_Error),\r
+ hwndMain, (DLGPROC)lpProc);\r
+ FreeProcInstance(lpProc);\r
+ }\r
+}\r
+\r
VOID\r
ErrorPopDown()\r
{\r
rChild.top + boardRect.top - (rChild.bottom - rChild.top), \r
0, 0, SWP_NOZORDER|SWP_NOSIZE);\r
errorDialog = hDlg;\r
+ SetWindowText(hDlg, errorTitle);\r
hwndText = GetDlgItem(hDlg, OPT_ErrorText);\r
SetDlgItemText(hDlg, OPT_ErrorText, errorMessage);\r
return FALSE;\r
}\r
}\r
}\r
- p = buf;\r
- q = errorMessage;\r
- while (*p) {\r
- if (*p == '\n') {\r
- if (hwndMain != NULL /*!!?*/) {\r
- *q++ = '\r';\r
- *q++ = *p++;\r
- } else {\r
- *q++ = ' ';\r
- p++;\r
- }\r
- } else {\r
- *q++ = *p++;\r
- }\r
- }\r
- *q = NULLCHAR;\r
\r
- if (hwndMain == NULL) {\r
- MessageBox(NULL, errorMessage, "Error", MB_OK|MB_ICONEXCLAMATION);\r
- } else {\r
- lpProc = MakeProcInstance((FARPROC)ErrorDialog, hInst);\r
- CreateDialog(hInst, MAKEINTRESOURCE(DLG_Error),\r
- hwndMain, (DLGPROC)lpProc);\r
- FreeProcInstance(lpProc);\r
- }\r
+ ErrorPopUp("Error", buf);\r
}\r
\r
\r
ClearHighlights();\r
DrawPosition(FALSE, NULL);\r
if (appData.popupMoveErrors) {\r
- DisplayError(str, 0);\r
+ ErrorPopUp("Error", str);\r
} else {\r
DisplayMessage(str, "");\r
moveErrorMessageUp = TRUE;\r
}\r
\r
\r
+VOID\r
+DisplayNote(char *str)\r
+{\r
+ ErrorPopUp("Note", str);\r
+}\r
+\r
+\r
typedef struct {\r
char *title, *question, *replyPrefix;\r
ProcRef pr;\r