this was already in Winboard, copied it to xboard and removed unused code.
first.analyzing = TRUE;
/*first.maybeThinking = TRUE;*/
first.maybeThinking = FALSE; /* avoid killing GNU Chess */
- AnalysisPopUp(_("Analysis"),
- _("Starting analysis mode...\nIf this message stays up, your chess program does not support analysis."));
+ EngineOutputPopUp();
}
if (!appData.icsEngineAnalyze) gameMode = AnalyzeMode;
pausing = FALSE;
first.analyzing = TRUE;
/*first.maybeThinking = TRUE;*/
first.maybeThinking = FALSE; /* avoid killing GNU Chess */
- AnalysisPopUp(_("Analysis"),
- _("Starting analysis mode...\nIf this message stays up, your chess program does not support analysis."));
+ EngineOutputPopUp();
}
gameMode = AnalyzeFile;
pausing = FALSE;
SendToProgram("exit\n", &first);
first.analyzing = FALSE;
}
- AnalysisPopDown();
+ EngineOutputPopDown();
thinkOutput[0] = NULLCHAR;
}
DisplayAnalysisText(text)
char *text;
{
- char buf[MSG_SIZ];
-
- if (gameMode == AnalyzeMode || gameMode == AnalyzeFile
- || appData.icsEngineAnalyze) {
- sprintf(buf, "Analysis (%s)", first.tidy);
- AnalysisPopUp(buf, text);
+ if (gameMode == AnalyzeMode || gameMode == AnalyzeFile
+ || appData.icsEngineAnalyze)
+ {
+ EngineOutputPopUp();
}
}
void ICSInitScript P((void));
void StartAnalysisClock P((void));
-void AnalysisPopUp P((char *title, char *label));
-void AnalysisPopDown P((void));
void SetHighlights P((int fromX, int fromY, int toX, int toY));
void ClearHighlights P((void));
switch (wmId) {\r
case IDM_NewGame:\r
ResetGameEvent();\r
- AnalysisPopDown();\r
SAY("new game enter a move to play against the computer with white");\r
break;\r
\r
case IDM_NewGameFRC:\r
if( NewGameFRC() == 0 ) {\r
ResetGameEvent();\r
- AnalysisPopDown();\r
}\r
break;\r
\r
}\r
\r
VOID\r
-AnalysisPopUp(char* title, char* str)\r
-{\r
- FARPROC lpProc;\r
- char *p, *q;\r
-\r
- /* [AS] */\r
- EngineOutputPopUp();\r
- return;\r
-\r
- if (str == NULL) str = "";\r
- p = (char *) malloc(2 * strlen(str) + 2);\r
- q = p;\r
- while (*str) {\r
- if (*str == '\n') *q++ = '\r';\r
- *q++ = *str++;\r
- }\r
- *q = NULLCHAR;\r
- if (analysisText != NULL) free(analysisText);\r
- analysisText = p;\r
-\r
- if (analysisDialog) {\r
- SetWindowText(analysisDialog, title);\r
- SetDlgItemText(analysisDialog, OPT_AnalysisText, analysisText);\r
- ShowWindow(analysisDialog, SW_SHOW);\r
- } else {\r
- analysisTitle = title;\r
- lpProc = MakeProcInstance((FARPROC)AnalysisDialog, hInst);\r
- CreateDialog(hInst, MAKEINTRESOURCE(DLG_Analysis),\r
- hwndMain, (DLGPROC)lpProc);\r
- FreeProcInstance(lpProc);\r
- }\r
- analysisDialogUp = TRUE; \r
-}\r
-\r
-VOID\r
-AnalysisPopDown()\r
-{\r
- if (analysisDialog) {\r
- ShowWindow(analysisDialog, SW_HIDE);\r
- }\r
- analysisDialogUp = FALSE; \r
-}\r
-\r
-\r
-VOID\r
SetHighlights(int fromX, int fromY, int toX, int toY)\r
{\r
highlightInfo.sq[0].x = fromX;\r
{ "TagsPopDown", (XtActionProc) TagsPopDown },
{ "ErrorPopDown", (XtActionProc) ErrorPopDown },
{ "ICSInputBoxPopDown", (XtActionProc) ICSInputBoxPopDown },
- { "AnalysisPopDown", (XtActionProc) AnalysisPopDown },
+ { "EngineOutputPopDown", (XtActionProc) EngineOutputPopDown },
{ "FileNamePopDown", (XtActionProc) FileNamePopDown },
{ "AskQuestionPopDown", (XtActionProc) AskQuestionPopDown },
{ "GameListPopDown", (XtActionProc) GameListPopDown },
commentUp = True;
}
-void AnalysisPopUp(title, text)
- char *title, *text;
-{
- Arg args[16];
- int j;
- Widget edit;
-
- if (analysisShell == NULL) {
- analysisShell = MiscCreate(title, text, False, NULL, 4);
- XtRealizeWidget(analysisShell);
- CatchDeleteWindow(analysisShell, "AnalysisPopDown");
-
- } else {
- edit = XtNameToWidget(analysisShell, "*form.text");
- j = 0;
- XtSetArg(args[j], XtNstring, text); j++;
- XtSetValues(edit, args, j);
- j = 0;
- XtSetArg(args[j], XtNiconName, (XtArgVal) title); j++;
- XtSetArg(args[j], XtNtitle, (XtArgVal) title); j++;
- XtSetValues(analysisShell, args, j);
- }
-
- if (!analysisUp) {
- XtPopup(analysisShell, XtGrabNone);
- }
- XSync(xDisplay, False);
-
- analysisUp = True;
-}
-
void CommentCallback(w, client_data, call_data)
Widget w;
XtPointer client_data, call_data;
commentUp = False;
}
-void AnalysisPopDown()
-{
- if (!analysisUp) return;
- XtPopdown(analysisShell);
- XSync(xDisplay, False);
- analysisUp = False;
- if (appData.icsEngineAnalyze) ExitAnalyzeMode(); /* [DM] icsEngineAnalyze */
-}
-
-
void FileNamePopUp(label, def, proc, openMode)
char *label;
char *def;
Cardinal *nprms;
{
ResetGameEvent();
- AnalysisPopDown();
+ EngineOutputPopDown();
}
int LoadGamePopUp(f, gameNumber, title)
ShufflePopDown();
shuffleOpenings = False; // [HGM] should be moved to New Variant menu, once we have it!
ResetGameEvent();
- AnalysisPopDown();
+ EngineOutputPopDown();
return;
}
if (strcmp(name, _("random")) == 0) {
shuffleOpenings = True;
ShufflePopDown();
ResetGameEvent();
- AnalysisPopDown();
+ EngineOutputPopDown();
return;
}
}