X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwgamelist.c;h=2fa15333af1f05a20ca6358c7026409a49a8e30d;hb=45f6f7e592a1e99a5dfa301e2ab8a52b39a4fd8a;hp=e1bf9782534996d63e2513e2fdd9d2cb27f94975;hpb=0efdc4c5ef60cf4c15e9dddf3658d2115e4d5d93;p=xboard.git diff --git a/winboard/wgamelist.c b/winboard/wgamelist.c index e1bf978..2fa1533 100644 --- a/winboard/wgamelist.c +++ b/winboard/wgamelist.c @@ -1,25 +1,28 @@ /* * wgamelist.c -- Game list window for WinBoard - * $Id: wgamelist.c,v 2.1 2003/10/27 19:21:02 mann Exp $ * - * Copyright 1995 Free Software Foundation, Inc. + * Copyright 1995,2009 Free Software Foundation, Inc. + * + * Enhancements Copyright 2005 Alessandro Scotti * * ------------------------------------------------------------------------ - * This program is free software; you can redistribute it and/or modify + * + * GNU XBoard is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU XBoard is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * ------------------------------------------------------------------------ - */ + * along with this program. If not, see http://www.gnu.org/licenses/. * + * + *------------------------------------------------------------------------ + ** See the file ChangeLog for a revision history. */ + #include "config.h" #include /* required for all Windows applications */ @@ -37,17 +40,20 @@ #include "backend.h" #include "wsnap.h" +#include "wgamelist.h" + +extern BoardSize boardSize; /* Module globals */ HWND gameListDialog = NULL; BOOLEAN gameListUp = FALSE; FILE* gameFile; char* gameFileName = NULL; -int gameListX, gameListY, gameListW, gameListH; /* Imports from winboard.c */ extern HINSTANCE hInst; extern HWND hwndMain; +extern WindowPlacement wpGameList; struct GameListStats { @@ -221,6 +227,9 @@ GameListDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) /* Initialize the dialog items */ hwndText = GetDlgItem(hDlg, OPT_TagsText); + /* Set font */ + SendDlgItemMessage( hDlg, OPT_GameListText, WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, MAKELPARAM(TRUE, 0 )); + count = GameListToListBox( hDlg, gameListDialog ? TRUE : FALSE, NULL, &stats ); SendDlgItemMessage( hDlg, IDC_GameListFilter, WM_SETTEXT, 0, (LPARAM) "" ); @@ -235,18 +244,18 @@ GameListDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) GetClientRect(hDlg, &rect); sizeX = rect.right; sizeY = rect.bottom; - if (gameListX != CW_USEDEFAULT && gameListY != CW_USEDEFAULT && - gameListW != CW_USEDEFAULT && gameListH != CW_USEDEFAULT) { + if (wpGameList.x != CW_USEDEFAULT && wpGameList.y != CW_USEDEFAULT && + wpGameList.width != CW_USEDEFAULT && wpGameList.height != CW_USEDEFAULT) { WINDOWPLACEMENT wp; - EnsureOnScreen(&gameListX, &gameListY); + EnsureOnScreen(&wpGameList.x, &wpGameList.y, 0, 0); wp.length = sizeof(WINDOWPLACEMENT); wp.flags = 0; wp.showCmd = SW_SHOW; wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0; - wp.rcNormalPosition.left = gameListX; - wp.rcNormalPosition.right = gameListX + gameListW; - wp.rcNormalPosition.top = gameListY; - wp.rcNormalPosition.bottom = gameListY + gameListH; + wp.rcNormalPosition.left = wpGameList.x; + wp.rcNormalPosition.right = wpGameList.x + wpGameList.width; + wp.rcNormalPosition.top = wpGameList.y; + wp.rcNormalPosition.bottom = wpGameList.y + wpGameList.height; SetWindowPlacement(hDlg, &wp); GetClientRect(hDlg, &rect);