{ 0, 0, 275, NULL, NULL, NULL, NULL, Label, warning },
{ 0, 0, 275, NULL, NULL, NULL, NULL, Label, "Variants marked with * can only be played\nwith legality testing off"},
{ 0, SAME_ROW, 0, NULL, NULL, NULL, NULL, Break, ""},
-{ VariantFairy, 0, 135, NULL, (void*) &Pick, "#BFBFBF", NULL, Button, N_("fairy")},
+{ VariantASEAN, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_("ASEAN")},
{ VariantGreat, SAME_ROW, 135, NULL, (void*) &Pick, "#BFBFFF", NULL, Button, N_("Great Shatranj (10x8)")},
{ VariantSChess, 0, 135, NULL, (void*) &Pick, "#FFBFBF", NULL, Button, N_("Seirawan")},
{ VariantFalcon, SAME_ROW, 135, NULL, (void*) &Pick, "#BFBFFF", NULL, Button, N_("falcon (10x8)")},
{ VariantShogi, SAME_ROW, 135, NULL, (void*) &Pick, "#BFFFFF", NULL, Button, N_("shogi (9x9)")},
{ VariantSpartan, 0, 135, NULL, (void*) &Pick, "#FF0000", NULL, Button, N_("Spartan")},
{ VariantXiangqi, SAME_ROW,135, NULL, (void*) &Pick, "#BFFFFF", NULL, Button, N_("xiangqi (9x10)")},
-{ VariantNormal, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_(" ")}, // dummy, to have good alignment
+{ VariantFairy, 0, 135, NULL, (void*) &Pick, "#BFBFBF", NULL, Button, N_("fairy")},
+//{ VariantNormal, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_(" ")}, // dummy, to have good alignment
{ VariantCourier, SAME_ROW,135, NULL, (void*) &Pick, "#BFFFBF", NULL, Button, N_("courier (12x8)")},
{ 0, NO_OK, 0, NULL, NULL, "", NULL, EndMark , "" }
};
appData.pieceToCharTable = NULL;
appData.pieceNickNames = "";
appData.colorNickNames = "";
- Reset(True, True);
PopDown(TransientDlg);
+ Reset(True, True);
return;
}
{ 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.quitNext, "", NULL, CheckBox, N_("Quit after game") },
{ 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);
}
static int
NewTagsCallback (int n)
{
- ReplaceTags(tagsText, &gameInfo);
+ if(!bookUp) ReplaceTags(tagsText, &gameInfo);
return 1;
}
changeTags (int n)
{
GenericReadout(tagsOptions, 1);
- if(bookUp) SaveToBook(tagsText); else
+ if(bookUp) SaveToBook(tagsText), DisplayBook(currentMove); else
ReplaceTags(tagsText, &gameInfo);
}
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
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(!appData.autoBox) return;
if(DialogExists(InputBoxDlg)) { // box already exists: append to current contents
char *p, newText[MSG_SIZ];
GetWidgetText(&boxOptions[0], &p);
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;
}
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
{
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);