#include <dlgs.h>\r
\r
#include "common.h"\r
-#include "winboard.h"\r
#include "frontend.h"\r
#include "backend.h"\r
+#include "winboard.h"\r
\r
#include "wsnap.h"\r
-#include "wgamelist.h"\r
-\r
-extern BoardSize boardSize;\r
\r
/* Module globals */\r
-HWND gameListDialog = NULL;\r
-BOOLEAN gameListUp = FALSE;\r
-FILE* gameFile;\r
-char* gameFileName = NULL;\r
-\r
-/* Imports from winboard.c */\r
-extern HINSTANCE hInst;\r
-extern HWND hwndMain;\r
-extern WindowPlacement wpGameList;\r
+static BOOLEAN gameListUp = FALSE;\r
+static FILE* gameFile;\r
+static char* gameFileName = NULL;\r
\r
struct GameListStats\r
{\r
newSizeX, newSizeY);\r
sizeX = newSizeX;\r
sizeY = newSizeY;\r
- }\r
+ } \r
+ else \r
+ GetActualPlacement( gameListDialog, &wpGameList );\r
\r
GameListUpdateTitle( hDlg, szDlgTitle, count, ((ListGame *) gameList.tailPred)->number, &stats );\r
}\r
CmailLoadGame(gameFile, nItem + 1, gameFileName, TRUE);\r
}\r
else {\r
+ SetFocus(hwndMain); // [HGM] automatic focus switch\r
LoadGame(gameFile, nItem + 1, gameFileName, TRUE);\r
}\r
}\r
if (gameListDialog) {\r
SendMessage(gameListDialog, WM_INITDIALOG, 0, 0);\r
if (!gameListUp) ShowWindow(gameListDialog, SW_SHOW);\r
+ else SetFocus(gameListDialog);\r
} else {\r
lpProc = MakeProcInstance((FARPROC)GameListDialog, hInst);\r
CreateDialog(hInst, MAKEINTRESOURCE(DLG_GameList),\r
VOID ShowGameListProc()\r
{\r
if (gameListUp) {\r
- GameListPopDown();\r
+ if(gameListDialog) SetFocus(gameListDialog);\r
+// GameListPopDown();\r
} else {\r
if (gameFileName) {\r
GameListPopUp(gameFile, gameFileName);\r