From b93dd47e73e5f93510763d99c1d2fffe4e9c38a1 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 26 Aug 2011 12:44:08 +0200 Subject: [PATCH] Put 'Load Next' button back in WB Game List The '>' button for loading the next (filtered) game is re-instated in the WinBoard GameList. The main window has now accelerator keys Ctrl+Up and Ctrl+Down for loading the previous and next filtered game. --- winboard/resource.h | 1 + winboard/wgamelist.c | 4 ++-- winboard/winboard.c | 5 +++++ winboard/winboard.rc | 5 ++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/winboard/resource.h b/winboard/resource.h index 36822ef..d59e60a 100644 --- a/winboard/resource.h +++ b/winboard/resource.h @@ -624,6 +624,7 @@ #define OPT_MessageFont8 1978 #define OPT_SamplePieceFont 1979 #define OPT_ChoosePieceFont 1980 +#define OPT_GameListFind 1981 // Next default values for new objects diff --git a/winboard/wgamelist.c b/winboard/wgamelist.c index 382f061..06c0684 100644 --- a/winboard/wgamelist.c +++ b/winboard/wgamelist.c @@ -301,7 +301,7 @@ GameListDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) SendDlgItemMessage(hDlg, OPT_GameListText, LB_SETCURSEL, nItem, 0); break; /* load the game*/ -// case OPT_GameListPrev: + case OPT_GameListPrev: nItem = SendDlgItemMessage(hDlg, OPT_GameListText, LB_GETCURSEL, 0, 0); nItem--; if (nItem < 0) { @@ -313,7 +313,7 @@ GameListDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) break; /* load the game*/ /* [AS] */ - case OPT_GameListPrev: + case OPT_GameListFind: case IDC_GameListDoFilter: { char filter[MAX_FILTER_LENGTH+1]; diff --git a/winboard/winboard.c b/winboard/winboard.c index 54a93fe..7a5860a 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -5063,6 +5063,11 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) SetFocus(hwndMain); break; + case OPT_GameListNext: // [HGM] forward these two accelerators to Game List + case OPT_GameListPrev: + if(gameListDialog) SendMessage(gameListDialog, WM_COMMAND, wmId, 0); + break; + case IDM_Revert: RevertEvent(FALSE); break; diff --git a/winboard/winboard.rc b/winboard/winboard.rc index ebb77b8..5713678 100644 --- a/winboard/winboard.rc +++ b/winboard/winboard.rc @@ -267,8 +267,9 @@ BEGIN LISTBOX OPT_GameListText,2,2,254,130,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP PUSHBUTTON "&Thresholds",OPT_GameListLoad,2,136,40,15 - PUSHBUTTON "&Find Position",OPT_GameListPrev,45,136,48,15 + PUSHBUTTON "&Find Position",OPT_GameListFind,45,136,48,15 PUSHBUTTON "&Close",OPT_GameListClose,96,136,30,15 + PUSHBUTTON ">",OPT_GameListNext,129,136,17,15 PUSHBUTTON "&Filter",IDC_GameListDoFilter,149,136,25,14 EDITTEXT IDC_GameListFilter,178,136,78,14,ES_AUTOHSCROLL END @@ -1530,6 +1531,8 @@ BEGIN VK_RIGHT, IDM_Forward, VIRTKEY, NOINVERT VK_DOWN, IDM_ToEnd, VIRTKEY, NOINVERT VK_UP, IDM_ToStart, VIRTKEY, NOINVERT + VK_DOWN, OPT_GameListNext, VIRTKEY, CONTROL, NOINVERT + VK_UP, OPT_GameListPrev, VIRTKEY, CONTROL, NOINVERT #endif END -- 1.7.0.4