X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwgamelist.c;h=a496359176d9fd70deb7cc16da59668343c919f0;hb=71c3de687d33523d83dec50208b0e44815fd7d20;hp=e13bcf0e42bf1aae0c4dd4b4d452c1647c66aff8;hpb=e80c98c04e951e5026a24531cd6316be962636b9;p=xboard.git diff --git a/winboard/wgamelist.c b/winboard/wgamelist.c index e13bcf0..a496359 100644 --- a/winboard/wgamelist.c +++ b/winboard/wgamelist.c @@ -1,7 +1,7 @@ /* * wgamelist.c -- Game list window for WinBoard * - * Copyright 1995, 2009, 2010 Free Software Foundation, Inc. + * Copyright 1995, 2009, 2010, 2011 Free Software Foundation, Inc. * * Enhancements Copyright 2005 Alessandro Scotti * @@ -208,6 +208,7 @@ GameListDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) } GameListUpdateTitle( hDlg, _("Game List"), count, ((ListGame *) gameList.tailPred)->number, &stats ); // [HGM] always update title + GameListHighlight(lastLoadGameNumber); return FALSE; case WM_SIZE: @@ -359,8 +360,8 @@ 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); + SetFocus(hwndMain); // [HGM] automatic focus switch } } @@ -406,9 +407,15 @@ VOID GameListPopDown(void) VOID GameListHighlight(int index) { + char buf[MSG_SIZ]; + int i, res = 0; if (gameListDialog == NULL) return; + for(i=0; res != LB_ERR; i++) { + res = SendDlgItemMessage( gameListDialog, OPT_GameListText, LB_GETTEXT, i, (LPARAM)buf ); + if(index <= atoi( buf )) break; + } SendDlgItemMessage(gameListDialog, OPT_GameListText, - LB_SETCURSEL, index - 1, 0); + LB_SETCURSEL, i, 0); }