From 12921be07acd4ac78e94a1c5699f1183f76b1c93 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 28 Nov 2010 23:12:14 +0100 Subject: [PATCH] Divorce the Edit and Show Tags/Comment menu items In WinBoard the items in the Edit and View menu for Tags and Comment now have different IDs, so they can be independently controlled. Only the items in the View menu are check-marked. The items still do the same. --- winboard/resource.h | 2 ++ winboard/wedittags.c | 4 ++-- winboard/winboard.c | 8 ++++++-- winboard/winboard.rc | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/winboard/resource.h b/winboard/resource.h index 15835f5..cee0fec 100644 --- a/winboard/resource.h +++ b/winboard/resource.h @@ -51,6 +51,8 @@ #define IDM_AboutGame 167 #define IDM_ShowGameList 170 #define IDM_EditTags 171 +#define IDM_Tags 172 +#define IDM_Comment 173 #define IDM_Debug 174 #define IDM_AnalysisMode 177 #define IDM_AnalyzeFile 178 diff --git a/winboard/wedittags.c b/winboard/wedittags.c index e0ea7ae..0cf3ca3 100644 --- a/winboard/wedittags.c +++ b/winboard/wedittags.c @@ -171,7 +171,7 @@ EditTagsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) VOID TagsPopDown(void) { if (editTagsDialog) ShowWindow(editTagsDialog, SW_HIDE); - CheckMenuItem(GetMenu(hwndMain), IDM_EditTags, MF_UNCHECKED); + CheckMenuItem(GetMenu(hwndMain), IDM_Tags, MF_UNCHECKED); editTagsUp = FALSE; } @@ -201,7 +201,7 @@ VOID EitherTagsPopUp(char *tags, char *msg, BOOLEAN edit) editTagsText = p; canEditTags = edit; - CheckMenuItem(GetMenu(hwndMain), IDM_EditTags, MF_CHECKED); + CheckMenuItem(GetMenu(hwndMain), IDM_Tags, MF_CHECKED); if (editTagsDialog) { SendMessage(editTagsDialog, WM_INITDIALOG, 0, 0); ShowWindow(editTagsDialog, SW_SHOW); diff --git a/winboard/winboard.c b/winboard/winboard.c index f05e680..a0e2284 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -4920,10 +4920,12 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) break; case IDM_EditTags: + case IDM_Tags: EditTagsProc(); break; case IDM_EditComment: + case IDM_Comment: if (commentUp && editComment) { CommentPopDown(); } else { @@ -6323,7 +6325,7 @@ EitherCommentPopUp(int index, char *title, char *str, BOOLEAN edit) FARPROC lpProc; char *p, *q; - CheckMenuItem(GetMenu(hwndMain), IDM_EditComment, edit ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(GetMenu(hwndMain), IDM_Comment, edit ? MF_CHECKED : MF_UNCHECKED); if (str == NULL) str = ""; p = (char *) malloc(2 * strlen(str) + 2); @@ -7809,6 +7811,7 @@ Enables ncpEnables[] = { Enables trainingOnEnables[] = { { IDM_EditComment, MF_BYCOMMAND|MF_GRAYED }, + { IDM_Comment, MF_BYCOMMAND|MF_GRAYED }, { IDM_Pause, MF_BYCOMMAND|MF_GRAYED }, { IDM_Forward, MF_BYCOMMAND|MF_GRAYED }, { IDM_Backward, MF_BYCOMMAND|MF_GRAYED }, @@ -7821,6 +7824,7 @@ Enables trainingOnEnables[] = { Enables trainingOffEnables[] = { { IDM_EditComment, MF_BYCOMMAND|MF_ENABLED }, + { IDM_Comment, MF_BYCOMMAND|MF_ENABLED }, { IDM_Pause, MF_BYCOMMAND|MF_ENABLED }, { IDM_Forward, MF_BYCOMMAND|MF_ENABLED }, { IDM_Backward, MF_BYCOMMAND|MF_ENABLED }, @@ -8518,7 +8522,7 @@ CommentPopUp(char *title, char *str) VOID CommentPopDown(void) { - CheckMenuItem(GetMenu(hwndMain), IDM_EditComment, MF_UNCHECKED); + CheckMenuItem(GetMenu(hwndMain), IDM_Comment, MF_UNCHECKED); if (commentDialog) { ShowWindow(commentDialog, SW_HIDE); } diff --git a/winboard/winboard.rc b/winboard/winboard.rc index 770f58d..235f622 100644 --- a/winboard/winboard.rc +++ b/winboard/winboard.rc @@ -1159,8 +1159,8 @@ BEGIN MENUITEM "Open &New Chat Window", IDM_NewChat MENUITEM "Type In &Move...\tAlt+I", IDM_TypeInMove MENUITEM SEPARATOR - MENUITEM "&Tags", IDM_EditTags - MENUITEM "&Comments", IDM_EditComment + MENUITEM "&Tags", IDM_Tags + MENUITEM "&Comments", IDM_Comment MENUITEM SEPARATOR MENUITEM "&Game List Tags...", IDM_GameListOptions MENUITEM "&Board...", IDM_BoardOptions -- 1.7.0.4