X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwgamelist.c;h=2fa15333af1f05a20ca6358c7026409a49a8e30d;hb=bb1c4f8ed2489e4891fe044532a35107d33174d2;hp=ee9759b0dea2d4e1c5e7bf869cb27c9515ed15d2;hpb=91d8e5853ca580769cc130aa6ea004869118d171;p=xboard.git diff --git a/winboard/wgamelist.c b/winboard/wgamelist.c index ee9759b..2fa1533 100644 --- a/winboard/wgamelist.c +++ b/winboard/wgamelist.c @@ -1,9 +1,10 @@ /* * wgamelist.c -- Game list window for WinBoard - * $Id: wgamelist.c,v 2.1 2003/10/27 19:21:02 mann Exp $ * * Copyright 1995,2009 Free Software Foundation, Inc. * + * Enhancements Copyright 2005 Alessandro Scotti + * * ------------------------------------------------------------------------ * * GNU XBoard is free software: you can redistribute it and/or modify @@ -39,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 { @@ -223,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) "" ); @@ -237,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);