* Massachusetts. \r
*\r
* Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,\r
- * 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.\r
+ * 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.\r
*\r
* Enhancements Copyright 2005 Alessandro Scotti\r
*\r
OPT_ChooseTellColor, OPT_ChooseChallengeColor, OPT_ChooseRequestColor,\r
OPT_ChooseSeekColor, OPT_ChooseNormalColor, OPT_ChooseBackgroundColor,\r
OPT_DefaultColors, OPT_DontColorize, IDC_Boxes, GPB_Colors, GPB_Premove,\r
- GPB_General, GPB_Alarm }, \r
+ GPB_General, GPB_Alarm, OPT_AutoCreate }, \r
{ DLG_BoardOptions, IDOK, IDCANCEL, OPT_SizeTiny, OPT_SizeTeeny, OPT_SizeDinky,\r
OPT_SizePetite, OPT_SizeSlim, OPT_SizeSmall, OPT_SizeMediocre, OPT_SizeMiddling,\r
OPT_SizeAverage, OPT_SizeModerate, OPT_SizeMedium, OPT_SizeBulky, OPT_SizeLarge,\r
backTextureSquareSize = 0; // kludge to force recalculation of texturemode\r
\r
if( appData.liteBackTextureFile && appData.liteBackTextureFile[0] != NULLCHAR && appData.liteBackTextureFile[0] != '*' ) {\r
+ if(liteBackTexture) DeleteObject(liteBackTexture);\r
liteBackTexture = LoadImage( 0, appData.liteBackTextureFile, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );\r
liteBackTextureMode = appData.liteBackTextureMode;\r
\r
}\r
\r
if( appData.darkBackTextureFile && appData.darkBackTextureFile[0] != NULLCHAR && appData.darkBackTextureFile[0] != '*' ) {\r
+ if(darkBackTexture) DeleteObject(darkBackTexture);\r
darkBackTexture = LoadImage( 0, appData.darkBackTextureFile, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );\r
darkBackTextureMode = appData.darkBackTextureMode;\r
\r
\r
if (SearchPath(NULL, "WinBoard.exe", NULL, MSG_SIZ, installDir, &filepart)) {\r
*filepart = NULLCHAR;\r
+ SetCurrentDirectory(installDir);\r
} else {\r
GetCurrentDirectory(MSG_SIZ, installDir);\r
}\r
p = q + 1;\r
} else {\r
q = mfp->faceName;\r
+\r
while (*p && !isdigit(*p)) {\r
*q++ = *p++;\r
if (q - mfp->faceName >= sizeof(mfp->faceName))\r
HDC tmphdc;\r
HBITMAP hbm;\r
static char oldBorder[MSG_SIZ];\r
- int w = 600, h = 600;\r
+ int w = 600, h = 600, mode;\r
\r
if(strcmp(appData.border, oldBorder)) { // load new one when old one no longer valid\r
strncpy(oldBorder, appData.border, MSG_SIZ-1);\r
w = bi.bmWidth;\r
h = bi.bmHeight;\r
}\r
+ mode = SetStretchBltMode(hdc, COLORONCOLOR);\r
StretchBlt(hdc, boardRect.left, boardRect.top, boardRect.right - boardRect.left, \r
boardRect.bottom - boardRect.top, tmphdc, 0, 0, w, h, SRCCOPY);\r
+ SetStretchBltMode(hdc, mode);\r
SelectObject(tmphdc, hbm);\r
DeleteDC(tmphdc);\r
}\r
FILE *f;\r
UINT number;\r
char fileTitle[MSG_SIZ];\r
- char buf[MSG_SIZ];\r
static SnapData sd;\r
static int peek=0;\r
\r
}\r
break;\r
\r
+ case IDM_CreateBook:\r
+ CreateBookEvent();\r
+ break;\r
+\r
case IDM_CopyGame:\r
CopyGameToClipboard();\r
break;\r
BoardOptionsPopup(hwnd);\r
break;\r
\r
+ case IDM_ThemeOptions:\r
+ ThemeOptionsPopup(hwnd);\r
+ break;\r
+\r
case IDM_EnginePlayOptions:\r
EnginePlayOptionsPopup(hwnd);\r
break;\r
/* see wedittags.c for Edit Tags functions */\r
\r
\r
-VOID\r
+int\r
ICSInitScript()\r
{\r
FILE *f;\r
if (f != NULL) {\r
ProcessICSInitScript(f);\r
fclose(f);\r
+ return TRUE;\r
}\r
}\r
+ return FALSE;\r
}\r
\r
\r
}\r
return 0;\r
}\r
+\r
+char *\r
+Col2Text (int n)\r
+{\r
+ static int i=0;\r
+ static char col[8][20];\r
+ COLORREF color = *(COLORREF *) colorVariable[n];\r
+ i = i+1 & 7;\r
+ snprintf(col[i], 20, "#%02lx%02lx%02lx", color&0xff, (color>>8)&0xff, (color>>16)&0xff);\r
+ return col[i];\r
+}\r
+\r
+void\r
+ActivateTheme (int new)\r
+{ // Redo initialization of features depending on options that can occur in themes\r
+ InitTextures();\r
+ if(new) InitDrawingColors();\r
+ fontBitmapSquareSize = 0; // request creation of new font pieces\r
+ InitDrawingSizes(-2, 0);\r
+ InvalidateRect(hwndMain, NULL, TRUE);\r
+}\r