/*
* dialogs.c -- platform-independent code for dialogs of XBoard
*
- * Copyright 2000, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ * Copyright 2000, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
* ------------------------------------------------------------------------
*
* GNU XBoard is free software: you can redistribute it and/or modify
{ 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.autoComment, "", NULL, CheckBox, N_("Auto-Comment") },
{ 0, 0, 0, NULL, (void*) &appData.autoObserve, "", NULL, CheckBox, N_("Auto-Observe") },
{ 0, 0, 0, NULL, (void*) &appData.autoRaiseBoard, "", NULL, CheckBox, N_("Auto-Raise Board") },
+{ 0, 0, 0, NULL, (void*) &appData.autoCreateLogon, "", NULL, CheckBox, N_("Auto-Create Logon Script") },
{ 0, 0, 0, NULL, (void*) &appData.bgObserve, "", NULL, CheckBox, N_("Background Observe while Playing") },
{ 0, 0, 0, NULL, (void*) &appData.dualBoard, "", NULL, CheckBox, N_("Dual Board for Background-Observed Game") },
{ 0, 0, 0, NULL, (void*) &appData.getMoveList, "", NULL, CheckBox, N_("Get Move List") },
{ 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:") },
//-------------------------------------------- Load Game Options ---------------------------------
-static char *modeNames[] = { N_("Exact position match"), N_("Shown position is subset"), N_("Same material with exactly same Pawn chain"),
+static char *modeNames[] = { N_("Exact position match"), N_("Shown position is subset"), N_("Same material with exactly same Pawn chain"),
N_("Same material"), N_("Material range (top board half optional)"), N_("Material difference (optional stuff balanced)"), NULL };
static char *modeValues[] = { "1", "2", "3", "4", "5", "6" };
static char *searchMode;
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
{
if (histP == histIn) return NULL;
histP = (histP + 1) % HISTORY_SIZE;
- return history[histP];
+ return history[histP];
}
// end of borrowed code
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) {
BoxAutoPopUp (char *buf)
{
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);
ChatOK (int n)
{ // can only be called through <Enter> in chat-partner text-edit, as there is no OK button
char buf[MSG_SIZ];
+
if(!partner || strcmp(partner, chatPartner[activePartner])) {
safeStrCpy(chatPartner[activePartner], partner, MSG_SIZ);
SetWidgetText(&chatOptions[5], "", -1); // clear text if we alter partner
{
errorUp = True;
errorOptions[1].name = label;
- if(dialogError = shellUp[TransientDlg])
+ if(dialogError = shellUp[TransientDlg])
GenericPopUp(errorOptions+1, title, FatalDlg, TransientDlg, MODAL, 0); // pop up as daughter of the transient dialog
else
GenericPopUp(errorOptions+modal, title, modal ? FatalDlg: ErrorDlg, BoardWindow, modal, 0); // kludge: option start address indicates modality
{
void *whiteLogo = first.programLogo, *blackLogo = second.programLogo;
if(appData.autoLogo) {
-
+
switch(gameMode) { // pick logos based on game mode
case IcsObserving:
whiteLogo = second.programLogo; // ICS logo
int w = width - 44 - mainOptions[n].min;
mainOptions[W_TITLE].max = w; // width left behind menu bar
if(w < 0.4*width) // if no reasonable amount of space for title, force small layout
- mainOptions[W_SMALL].type = mainOptions[W_TITLE].type, mainOptions[W_TITLE].type = -1;
+ mainOptions[W_SMALL].type = mainOptions[W_TITLE].type, mainOptions[W_TITLE].type = -1;
}
void
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
{
fileProc = proc; /* I can't see a way not */
fileOpenMode = openMode; /* to use globals here */
-#ifdef TODO_GTK
- { // [HGM] use file-selector dialog stolen from Ghostview
- // int index; // this is not supported yet
- Browse(BoardWindow, label, (def[0] ? def : NULL), filter, False, openMode, &openName, &openFP);
- }
-#else
- FileNamePopUpGTK(label, def, filter, proc, False, openMode, &openName, &openFP);
-#endif
+ FileNamePopUpWrapper(label, def, filter, proc, False, openMode, &openName, &openFP);
}
+void
+ActivateTheme (int col)
+{
+}
+char *
+Col2Text (int n)
+{
+ return NULL;
+}