break;\r
\r
case IDM_Match: // [HGM] match: flows into next case, after setting Match Mode and nr of Games\r
- if(gameMode != BeginningOfGame) { // allow menu item to remain enabled for better mode highligting\r
- DisplayError(_("You can only start a match from the initial position."), 0); break;\r
- }\r
- appData.matchGames = appData.defaultMatchGames;
MatchEvent(2); // distinguish from command-line-triggered case (matchMode=1)\r
break;\r
\r
{ IDM_MachineWhite, MF_BYCOMMAND|MF_GRAYED },\r
{ IDM_MachineBlack, MF_BYCOMMAND|MF_GRAYED },\r
{ IDM_TwoMachines, MF_BYCOMMAND|MF_GRAYED },\r
- { IDM_Match, MF_BYCOMMAND|MF_GRAYED },\r
+// { IDM_Match, MF_BYCOMMAND|MF_GRAYED },\r
{ IDM_TypeInMove, MF_BYCOMMAND|MF_GRAYED },\r
{ IDM_RetractMove, MF_BYCOMMAND|MF_GRAYED },\r
{ -1, -1 }\r
{ IDM_MachineWhite, MF_BYCOMMAND|MF_ENABLED },\r
{ IDM_MachineBlack, MF_BYCOMMAND|MF_ENABLED },\r
{ IDM_TwoMachines, MF_BYCOMMAND|MF_ENABLED },\r
- { IDM_Match, MF_BYCOMMAND|MF_ENABLED },\r
+// { IDM_Match, MF_BYCOMMAND|MF_ENABLED },\r
{ IDM_TypeInMove, MF_BYCOMMAND|MF_ENABLED },\r
{ IDM_RetractMove, MF_BYCOMMAND|MF_ENABLED },\r
{ -1, -1 }\r
* \r
\*---------------------------------------------------------------------------*/\r
VOID\r
+CheckMark(UINT item, int state)\r
+{\r
+ if(item) CheckMenuItem(GetMenu(hwndMain), item, MF_BYCOMMAND|state);\r
+}\r
+\r
+VOID\r
ModeHighlight()\r
{\r
static UINT prevChecked = 0;\r
nowChecked = IDM_MachineWhite;\r
break;\r
case TwoMachinesPlay:\r
- nowChecked = matchMode ? IDM_Match : IDM_TwoMachines; // [HGM] match\r
+ nowChecked = IDM_TwoMachines;\r
break;\r
case AnalyzeMode:\r
nowChecked = IDM_AnalysisMode;\r
nowChecked = 0;\r
break;\r
}\r
- if (prevChecked != 0)\r
- (void) CheckMenuItem(GetMenu(hwndMain),\r
- prevChecked, MF_BYCOMMAND|MF_UNCHECKED);\r
- if (nowChecked != 0)\r
- (void) CheckMenuItem(GetMenu(hwndMain),\r
- nowChecked, MF_BYCOMMAND|MF_CHECKED);\r
+ CheckMark(prevChecked, MF_UNCHECKED);\r
+ CheckMark(nowChecked, MF_CHECKED);\r
+ CheckMark(IDM_Match, matchMode && matchGame < appData.matchGames ? MF_CHECKED : MF_UNCHECKED);\r
\r
if (nowChecked == IDM_LoadGame || nowChecked == IDM_Training) {\r
(void) EnableMenuItem(GetMenu(hwndMain), IDM_Training, \r
/* [DM] icsEngineAnalyze - Do a sceure check too */\r
if (appData.icsActive) {\r
if (appData.icsEngineAnalyze) {\r
- (void) CheckMenuItem(GetMenu(hwndMain), IDM_AnalysisMode,\r
- MF_BYCOMMAND|MF_CHECKED);\r
+ CheckMark(IDM_AnalysisMode, MF_CHECKED);\r
} else {\r
- (void) CheckMenuItem(GetMenu(hwndMain), IDM_AnalysisMode,\r
- MF_BYCOMMAND|MF_UNCHECKED);\r
+ CheckMark(IDM_AnalysisMode, MF_UNCHECKED);\r
}\r
}\r
DisplayLogos(); // [HGM] logos: mode change could have altered logos\r
{ "menuMode.Machine White", False },
{ "menuMode.Machine Black", False },
{ "menuMode.Two Machines", False },
- { "menuMode.Machine Match", False },
+// { "menuMode.Machine Match", False },
{ "menuEngine.Retract Move", False },
{ NULL, False }
};
{ "menuMode.Machine White", True },
{ "menuMode.Machine Black", True },
{ "menuMode.Two Machines", True },
- { "menuMode.Machine Match", True },
+// { "menuMode.Machine Match", True },
{ "menuEngine.Retract Move", True },
{ NULL, False }
};
XtSetValues(XtNameToWidget(menuBarWidget, wname), args, 1);
}
oldmode = gameMode;
+ XtSetArg(args[0], XtNleftBitmap, matchMode && matchGame < appData.matchGames ? xMarkPixmap : None);
+ XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Machine Match"), args, 1);
/* Maybe all the enables should be handled here, not just this one */
XtSetSensitive(XtNameToWidget(menuBarWidget, "menuMode.Training"),
String *prms;
Cardinal *nprms;
{
- if(gameMode != BeginningOfGame) { DisplayError(_("You can only start a match from the initial position."), 0); return; }
- appData.matchGames = appData.defaultMatchGames;
MatchEvent(2);\r
}