{ 0, 0, 0, NULL, (void*) &appData.autoFlipView, "", NULL, CheckBox, N_("Auto Flip View") },
{ 0, 0, 0, NULL, (void*) &appData.blindfold, "", NULL, CheckBox, N_("Blindfold") },
{ 0, 0, 0, NULL, (void*) &appData.dropMenu, "", NULL, CheckBox, N_("Drop Menu") },
+{ 0, 0, 0, NULL, (void*) &appData.variations, "", NULL, CheckBox, N_("Enable Variation Trees") },
{ 0, 0, 0, NULL, (void*) &appData.hideThinkingFromHuman, "", NULL, CheckBox, N_("Hide Thinking from Human") },
{ 0, 0, 0, NULL, (void*) &appData.highlightLastMove, "", NULL, CheckBox, N_("Highlight Last Move") },
{ 0, 0, 0, NULL, (void*) &appData.highlightMoveWithArrow, "", NULL, CheckBox, N_("Highlight with Arrow") },
-{ 0, 0, 0, NULL, (void*) &appData.ringBellAfterMoves, "", NULL, CheckBox, N_("Move Sound") },
{ 0, 0, 0, NULL, (void*) &appData.oneClick, "", NULL, CheckBox, N_("One-Click Moving") },
{ 0, 0, 0, NULL, (void*) &appData.periodicUpdates, "", NULL, CheckBox, N_("Periodic Updates (in Analysis Mode)") },
{ 0, SAME_ROW, 0, NULL, NULL, NULL, NULL, Break, "" },
+{ 0, 0, 0, NULL, (void*) &appData.autoExtend, "", NULL, CheckBox, N_("Play Move(s) of Clicked PV (Analysis)") },
{ 0, 0, 0, NULL, (void*) &appData.ponderNextMove, "", NULL, CheckBox, N_("Ponder Next Move") },
{ 0, 0, 0, NULL, (void*) &appData.popupExitMessage, "", NULL, CheckBox, N_("Popup Exit Messages") },
{ 0, 0, 0, NULL, (void*) &appData.popupMoveErrors, "", NULL, CheckBox, N_("Popup Move Errors") },
appData.pieceToCharTable = NULL;
appData.pieceNickNames = "";
appData.colorNickNames = "";
- Reset(True, True);
PopDown(TransientDlg);
+ Reset(True, True);
return;
}
{ 0, 0, 0, NULL, (void*) &appData.quietPlay, "", NULL, CheckBox, N_("Quiet Play") },
{ 0, 0, 0, NULL, (void*) &appData.seekGraph, "", NULL, CheckBox, N_("Seek Graph") },
{ 0, 0, 0, NULL, (void*) &appData.autoRefresh, "", NULL, CheckBox, N_("Auto-Refresh Seek Graph") },
+{ 0, 0, 0, NULL, (void*) &appData.autoBox, "", NULL, CheckBox, N_("Auto-InputBox PopUp") },
{ 0, 0, 0, NULL, (void*) &appData.premove, "", NULL, CheckBox, N_("Premove") },
{ 0, 0, 0, NULL, (void*) &appData.premoveWhite, "", NULL, CheckBox, N_("Premove for White") },
{ 0, 0, 0, NULL, (void*) &appData.premoveWhiteText, "", NULL, TextBox, N_("First White Move:") },
static Option saveOptions[] = {
{ 0, 0, 0, NULL, (void*) &appData.autoSaveGames, "", NULL, CheckBox, N_("Auto-Save Games") },
+{ 0, 0, 0, NULL, (void*) &appData.onlyOwn, "", NULL, CheckBox, N_("Own Games Only") },
{ 0, 0, 0, NULL, (void*) &appData.saveGameFile, ".pgn", NULL, FileName, N_("Save Games on File:") },
{ 0, 0, 0, NULL, (void*) &appData.savePositionFile, ".fen", NULL, FileName, N_("Save Final Positions on File:") },
{ 0, 0, 0, NULL, (void*) &appData.pgnEventHeader, "", NULL, TextBox, N_("PGN Event Header:") },
textOptions[i].target = NULL;
textOptions[i].min = 2;
MarkMenu("View.ICStextmenu", TextMenuDlg);
- GenericPopUp(textOptions, _("ICS text menu"), TextMenuDlg, BoardWindow, NONMODAL, 1);
+ GenericPopUp(textOptions, _("ICS text menu"), TextMenuDlg, BoardWindow, NONMODAL, appData.topLevel);
}
//---------------------------------------------------- Edit Comment -----------------------------------
if(commentText) free(commentText); commentText = strdup(text);
commentIndex = index;
MarkMenu("View.Comments", CommentDlg);
- if(GenericPopUp(commentOptions, title, CommentDlg, BoardWindow, NONMODAL, 1))
+ if(GenericPopUp(commentOptions, title, CommentDlg, BoardWindow, NONMODAL, appData.topLevel))
AddHandler(&commentOptions[0], CommentDlg, 1);
}
if(tagsText) free(tagsText); tagsText = strdup(text);
tagsOptions[0].name = msg;
MarkMenu("View.Tags", TagsDlg);
- GenericPopUp(tagsOptions, title, TagsDlg, BoardWindow, NONMODAL, 1);
+ GenericPopUp(tagsOptions, title, TagsDlg, BoardWindow, NONMODAL, appData.topLevel);
}
void
void
IcsKey (int n)
{ // [HGM] input: let up-arrow recall previous line from history
- char *val;
+ char *val = NULL; // to suppress spurious warning
if (!shellUp[InputBoxDlg]) return;
switch(n) {
case -1:
val = NextInHistory();
}
- SetWidgetText(&boxOptions[0], val ? val : "", InputBoxDlg);
+ SetWidgetText(&boxOptions[0], val = val ? val : "", InputBoxDlg);
+ SetInsertPos(&boxOptions[0], strlen(val));
}
static void
void
BoxAutoPopUp (char *buf)
{
+ if(!appData.autoBox) return;
if(appData.icsActive) { // text typed to board in ICS mode: divert to ICS input box
if(DialogExists(InputBoxDlg)) { // box already exists: append to current contents
char *p, newText[MSG_SIZ];
}
static Option shuffleOptions[] = {
- { 0, 0, 50, NULL, (void*) &shuffleOpenings, NULL, NULL, CheckBox, N_("shuffle") },
+ { 0, 0, 0, NULL, (void*) &shuffleOpenings, NULL, NULL, CheckBox, N_("shuffle") },
{ 0,-1,2000000000, NULL, (void*) &appData.defaultFrcPosition, "", NULL, Spin, N_("Start-position number:") },
{ 0, 0, 0, NULL, (void*) &SetRandom, NULL, NULL, Button, N_("randomize") },
{ 0, SAME_ROW, 0, NULL, (void*) &SetRandom, NULL, NULL, Button, N_("pick fixed") },
void
ChatProc ()
{
- if(GenericPopUp(chatOptions, _("Chat box"), ChatDlg, BoardWindow, NONMODAL, 0))
+ if(GenericPopUp(chatOptions, _("Chat box"), ChatDlg, BoardWindow, NONMODAL, appData.topLevel))
AddHandler(&chatOptions[0], ChatDlg, 2), AddHandler(&chatOptions[6], ChatDlg, 2); // treats return as OK
MarkMenu("View.OpenChatWindow", ChatDlg);
}
{
fromX = fromY = -1;
ClearHighlights();
- DrawPosition(FALSE, NULL);
+ DrawPosition(TRUE, NULL); // selective redraw would miss the from-square of the rejected move, displayed empty after drag, but not marked damaged!
if (appData.debugMode || appData.matchMode) {
fprintf(stderr, "%s: %s\n", programName, message);
}
if(!appData.showButtonBar) for(i=W_BUTTON; i<W_BOARD; i++) mainOptions[i].type = -1;
for(i=0; i<8; i++) mainOptions[i+1].choice = (char**) menuBar[i].mi;
AppendEnginesToMenu(appData.recentEngineList);
- GenericPopUp(mainOptions, "XBoard", BoardWindow, BoardWindow, NONMODAL, 1);
+ GenericPopUp(mainOptions, "XBoard", BoardWindow, BoardWindow, NONMODAL, 1); // allways top-level
return mainOptions;
}
Option dualOptions[] = { // auxiliary board window
{ 0, L2L|T2T, 198, NULL, NULL, NULL, NULL, Label, "White" }, // white clock
{ 0, R2R|T2T|SAME_ROW, 198, NULL, NULL, NULL, NULL, Label, "Black" }, // black clock
-{ 0, LR|T2T|BORDER, 401, NULL, NULL, NULL, NULL, Label, "message" }, // message field
+{ 0, LR|T2T|BORDER, 401, NULL, NULL, NULL, NULL, Label, "This feature is experimental" }, // message field
{ 401, LR|TT, 401, NULL, (char*) &SlaveExp, NULL, NULL, Graph, "shadow board" }, // board
{ 0, NO_OK, 0, NULL, NULL, "", NULL, EndMark , "" }
};
dualOptions[3].value = BOARD_HEIGHT*(squareSize + lineGap) + lineGap;
dualOptions[3].max = dualOptions[2].max = size; // board width
dualOptions[0].max = dualOptions[1].max = size/2 - 3; // clock width
- GenericPopUp(dualOptions, "XBoard", DummyDlg, BoardWindow, NONMODAL, 1);
+ GenericPopUp(dualOptions, "XBoard", DummyDlg, BoardWindow, NONMODAL, appData.topLevel);
+ SlaveResize(dualOptions+3);
}
void
ASSIGN(fileList[filePtr], s); filePtr++;
}
}
- if(filePtr == MAXFILES-2) { ASSIGN(fileList[filePtr], _("\177 next page")); filePtr++; }
+ if(filePtr == MAXFILES-2) { ASSIGN(fileList[filePtr], _(" next page")); filePtr++; }
FREE(folderList[folderPtr]); folderList[folderPtr] = NULL;
FREE(fileList[filePtr]); fileList[filePtr] = NULL;
closedir(dir);
extFlag = 0; qsort((void*)folderList, folderPtr, sizeof(char*), &Comp);
- extFlag = byExtension; qsort((void*)fileList, filePtr, sizeof(char*), &Comp);
+ extFlag = byExtension; qsort((void*)fileList, filePtr < MAXFILES-2 ? filePtr : MAXFILES-2, sizeof(char*), &Comp);
}
void
SetWidgetLabel(&browseOptions[0], title);
}
+static char msg1[] = N_("FIRST TYPE DIRECTORY NAME HERE");
+static char msg2[] = N_("TRY ANOTHER NAME");
+
void
CreateDir (int n)
{
char *name, *errmsg = "";
GetWidgetText(&browseOptions[n-1], &name);
- if(!name[0]) errmsg = _("FIRST TYPE DIRECTORY NAME HERE"); else
- if(mkdir(name, 0755)) errmsg = _("TRY ANOTHER NAME");
+ if(!strcmp(name, msg1) || !strcmp(name, msg2)) return;
+ if(!name[0]) errmsg = _(msg1); else
+ if(mkdir(name, 0755)) errmsg = _(msg2);
else {
chdir(name);
Refresh(-1);
{
if(byExtension == (n == 4)) return;
extFlag = byExtension = (n == 4);
- qsort((void*)fileList, filePtr, sizeof(char*), &Comp);
+ qsort((void*)fileList, filePtr < MAXFILES-2 ? filePtr : MAXFILES-2, sizeof(char*), &Comp);
LoadListBox(&browseOptions[6], "", -1, -1);
}
void
FileSelProc (int n, int sel)
{
- if(sel<0) return;
+ if(sel < 0 || fileList[sel] == NULL) return;
if(sel == MAXFILES-2) { pageStart = cnt; Refresh(-1); return; }
ASSIGN(fileName, fileList[sel]);
if(BrowseOK(0)) PopDown(BrowserDlg);