static void DefColor P((int n));
static void AdjustColor P((int i));
+static char oldPieceDir[MSG_SIZ];
+
static int
BoardOptionsOK (int n)
{
if(appData.overrideLineGap >= 0) lineGap = appData.overrideLineGap; else lineGap = defaultLineGap;
- useImages = useImageSqs = 0;
- InitDrawingParams();
+ InitDrawingParams(strcmp(oldPieceDir, appData.pieceDirectory));
InitDrawingSizes(-1, 0);
DrawPosition(True, NULL);
return 1;
{ 0, 0, 0, NULL, (void*) &appData.useBitmaps, "", NULL, CheckBox, N_("Use Board Textures") },
{ 0, 0, 0, NULL, (void*) &appData.liteBackTextureFile, ".xpm", NULL, FileName, N_("Light-Squares Texture File:") },
{ 0, 0, 0, NULL, (void*) &appData.darkBackTextureFile, ".xpm", NULL, FileName, N_("Dark-Squares Texture File:") },
-{ 0, 0, 0, NULL, (void*) &appData.bitmapDirectory, "", NULL, PathName, N_("Directory with Bitmap Pieces:") },
-{ 0, 0, 0, NULL, (void*) &appData.pixmapDirectory, "", NULL, PathName, N_("Directory with Pixmap Pieces:") },
+{ 0, 0, 0, NULL, (void*) &appData.trueColors, "", NULL, CheckBox, N_("Use external piece bitmaps with their own colors") },
+{ 0, 0, 0, NULL, (void*) &appData.pieceDirectory, "", NULL, PathName, N_("Directory with Pieces Images:") },
{ 0, 0, 0, NULL, (void*) &BoardOptionsOK, "", NULL, EndMark , "" }
};
void
BoardOptionsProc ()
{
+ strncpy(oldPieceDir, appData.pieceDirectory, MSG_SIZ-1); // to see if it changed
GenericPopUp(boardOptions, _("Board Options"), TransientDlg, BoardWindow, MODAL, 0);
}
snprintf(buf, sizeof(buf), "%s: %s", message, strerror(error));
message = buf;
}
- if (appData.popupExitMessage && boardWidget && XtIsRealized(boardWidget)) {
- ErrorPopUp(status ? _("Fatal Error") : _("Exiting"), message, TRUE);
- } else {
- ExitEvent(status);
+ if(mainOptions[W_BOARD].handle) {
+ if (appData.popupExitMessage) {
+ ErrorPopUp(status ? _("Fatal Error") : _("Exiting"), message, TRUE);
+ } else {
+ ExitEvent(status);
+ }
}
}
void *userLogo;
void
-DisplayLogos (void *w1, void *w2)
+DisplayLogos (Option *w1, Option *w2)
{
void *whiteLogo = first.programLogo, *blackLogo = second.programLogo;
if(appData.autoLogo) {
Option *
LogoW (int n, int x, int y)
{
- if(n == 10) DisplayLogos(mainOptions[W_WHITE-1].handle, NULL);
+ if(n == 10) DisplayLogos(&mainOptions[W_WHITE-1], NULL);
return NULL;
}
Option *
LogoB (int n, int x, int y)
{
- if(n == 10) DisplayLogos(NULL, mainOptions[W_BLACK+1].handle);
+ if(n == 10) DisplayLogos(NULL, &mainOptions[W_BLACK+1]);
return NULL;
}
static Option *
Exp (int n, int x, int y)
{
- static int but1, but3;
- int menuNr = -3;
+ static int but1, but3, oldW, oldH;
+ int menuNr = -3, sizing;
if(n == 0) { // motion
if(SeekGraphClick(Press, x, y, 1)) return NULL;
case -2: shiftKey = !shiftKey;
case -3: menuNr = RightClick(Release, x, y, &pmFromX, &pmFromY), but3 = 0; break;
case 10:
+ sizing = (oldW != x || oldH != y);
+ oldW = x; oldH = y;
+ InitDrawingHandle(mainOptions + W_BOARD);
+ if(sizing) return NULL; // don't redraw while sizing
DrawPosition(True, NULL);
default:
return NULL;
mainOptions[W_BOARD].max = mainOptions[W_SMALL].max = size; // board size
mainOptions[W_SMALL].max = size - 2; // board title (subtract border!)
mainOptions[W_BLACK].max = mainOptions[W_WHITE].max = size/2-3; // clock width
- mainOptions[W_MESSG].max = appData.showButtonBar ? size-130 : size-2; // message
+ mainOptions[W_MESSG].max = appData.showButtonBar ? size-135 : size-2; // message
mainOptions[W_MENU].max = size-40; // menu bar
mainOptions[W_TITLE].type = appData.titleInWindow ? Label : -1 ;
if(logo && logo <= size/4) { // Activate logos
}
if(!fileName[0]) return FALSE; // refuse OK when no file
if(!savMode[0]) { // browsing for name only (dialog Browse button)
- snprintf(title, MSG_SIZ, "%s/%s", curDir, fileName);
+ if(fileName[0] == '/') // We already had a path name
+ snprintf(title, MSG_SIZ, "%s", fileName);
+ else
+ snprintf(title, MSG_SIZ, "%s/%s", curDir, fileName);
SetWidgetText((Option*) savFP, title, TransientDlg);
currentCps = savCps; // could return to Engine Settings dialog!
return TRUE;