X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwgamelist.c;h=80ce9b67f23a75e276cbd37c9e80631e50efff10;hb=e9a0808a5551217eb4fd29d949f3c7672545c168;hp=2300fda76ffecf99570d4e03c93a9edf7ca3f5e9;hpb=564d40aef12b1927f48cf1561ec3199462f8e583;p=xboard.git diff --git a/winboard/wgamelist.c b/winboard/wgamelist.c index 2300fda..80ce9b6 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 * @@ -406,9 +406,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); }