X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwgamelist.c;h=31d36ff3af77153460c7583a2e2b6d8d26489259;hb=c948f38c96384998f183aab3298f94833e18f26c;hp=6a0daaa70d0037d20222282b159fb9b753ca7008;hpb=7b4dacf6fe9f8c10b6eb4d6070869a3d933dbeb5;p=xboard.git diff --git a/winboard/wgamelist.c b/winboard/wgamelist.c index 6a0daaa..31d36ff 100644 --- a/winboard/wgamelist.c +++ b/winboard/wgamelist.c @@ -3,6 +3,8 @@ * * Copyright 1995,2009 Free Software Foundation, Inc. * + * Enhancements Copyright 2005 Alessandro Scotti + * * ------------------------------------------------------------------------ * * GNU XBoard is free software: you can redistribute it and/or modify @@ -33,25 +35,16 @@ #include #include "common.h" -#include "winboard.h" #include "frontend.h" #include "backend.h" +#include "winboard.h" #include "wsnap.h" -#include "wgamelist.h" - -extern BoardSize boardSize; /* Module globals */ -HWND gameListDialog = NULL; -BOOLEAN gameListUp = FALSE; -FILE* gameFile; -char* gameFileName = NULL; - -/* Imports from winboard.c */ -extern HINSTANCE hInst; -extern HWND hwndMain; -extern WindowPlacement wpGameList; +static BOOLEAN gameListUp = FALSE; +static FILE* gameFile; +static char* gameFileName = NULL; struct GameListStats { @@ -263,7 +256,9 @@ GameListDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) newSizeX, newSizeY); sizeX = newSizeX; sizeY = newSizeY; - } + } + else + GetActualPlacement( gameListDialog, &wpGameList ); GameListUpdateTitle( hDlg, szDlgTitle, count, ((ListGame *) gameList.tailPred)->number, &stats ); } @@ -418,6 +413,7 @@ GameListDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) CmailLoadGame(gameFile, nItem + 1, gameFileName, TRUE); } else { + SetFocus(hwndMain); // [HGM] automatic focus switch LoadGame(gameFile, nItem + 1, gameFileName, TRUE); } } @@ -444,6 +440,7 @@ VOID GameListPopUp(FILE *fp, char *filename) if (gameListDialog) { SendMessage(gameListDialog, WM_INITDIALOG, 0, 0); if (!gameListUp) ShowWindow(gameListDialog, SW_SHOW); + else SetFocus(gameListDialog); } else { lpProc = MakeProcInstance((FARPROC)GameListDialog, hInst); CreateDialog(hInst, MAKEINTRESOURCE(DLG_GameList), @@ -481,7 +478,8 @@ VOID GameListDestroy() VOID ShowGameListProc() { if (gameListUp) { - GameListPopDown(); + if(gameListDialog) SetFocus(gameListDialog); +// GameListPopDown(); } else { if (gameFileName) { GameListPopUp(gameFile, gameFileName);