Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Src/LexText/Interlinear/ChooseAnalysisHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,17 @@ internal static ITsString MakeAnalysisStringRep(IWfiAnalysis wa, LcmCache fdoCac
lim = -1;
increment = -1;
}

if (wa?.Cache?.LanguageProject != null)
{
Opinions uao = wa.GetAgentOpinion(wa.Cache.LangProject.DefaultUserAgent);
Opinions pao = wa.GetAgentOpinion(wa.Cache.LangProject.DefaultParserAgent);
AddOpinion(tsb, uao, InterlinVc.ApprovedGuessColor);
AddOpinion(tsb, pao, InterlinVc.MachineGuessColor);
tsb.Replace(tsb.Length, tsb.Length, " ", null);
tsb.SetProperties(tsb.Length - 1, tsb.Length, formTextProperties);
}

for (int i = start; i != lim; i += increment)
{
var mb = wa.MorphBundlesOS[i];
Expand Down Expand Up @@ -457,6 +468,27 @@ internal static ITsString MakeAnalysisStringRep(IWfiAnalysis wa, LcmCache fdoCac
return tsb.GetString();
}

private static void AddOpinion(ITsStrBldr tsb, Opinions opinion, int backColor)
{
int foreColor = (int)CmObjectUi.RGB(Color.Black);
if (opinion == Opinions.approves)
tsb.Replace(tsb.Length, tsb.Length, "\u2714", null); // bold check mark
else if (opinion == Opinions.noopinion)
{
// Use same foreground and background color to create a blank of the same width as a check mark.
tsb.Replace(tsb.Length, tsb.Length, "\u2714", null);
foreColor = backColor;
}
else if (opinion == Opinions.disapproves)
{
tsb.Replace(tsb.Length, tsb.Length, "X", null);
foreColor = (int)CmObjectUi.RGB(Color.Red);
}
tsb.SetStrPropValue(tsb.Length - 1, tsb.Length, (int)FwTextPropType.ktptFontFamily, "Segoe UI Symbol");
tsb.SetIntPropValues(tsb.Length - 1, tsb.Length, (int)FwTextPropType.ktptForeColor, (int)FwTextPropVar.ktpvDefault, foreColor);
tsb.SetIntPropValues(tsb.Length - 1, tsb.Length, (int)FwTextPropType.ktptBackColor, (int)FwTextPropVar.ktpvDefault, backColor);
}

/// <summary>
///
/// </summary>
Expand Down
Loading