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
22 changes: 21 additions & 1 deletion Src/LexText/Interlinear/InterlinVc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using SIL.LCModel;
using SIL.LCModel.DomainServices;
using SIL.LCModel.Infrastructure;
using Gecko.WebIDL;

namespace SIL.FieldWorks.IText
{
Expand Down Expand Up @@ -853,16 +854,35 @@ private void JoinGlossAffixesOfInflVariantTypes(ILexEntryRef entryRef1, int wsPr
/// <param name="vwenv"></param>
protected virtual void AddWordBundleInternal(int hvo, IVwEnv vwenv)
{
SetupAndOpenInnerPile(vwenv);
// we assume we're in the context of a segment with analyses here.
// we'll need this info down in DisplayAnalysisAndCloseInnerPile()
int hvoSeg;
int tagDummy;
int index;
vwenv.GetOuterObject(vwenv.EmbeddingLevel - 1, out hvoSeg, out tagDummy, out index);
var analysisOccurrence = new AnalysisOccurrence(m_segRepository.GetObject(hvoSeg), index);
SetBorderColor(vwenv, analysisOccurrence);
SetupAndOpenInnerPile(vwenv);
DisplayAnalysisAndCloseInnerPile(vwenv, analysisOccurrence, true);
}
private void SetBorderColor(IVwEnv vwenv, AnalysisOccurrence analysisOccurrence)
{
var coRepository = m_cache.ServiceLocator.GetInstance<ICmObjectRepository>();
var wag = (IAnalysis)coRepository.GetObject(analysisOccurrence.Analysis.Hvo);
int width = 0;
int color = (int)ColorUtil.ConvertColorToBGR(Color.Black);
if (IsParsingDevMode() && wag.ClassID != WfiWordformTags.kClassId && !(wag is IPunctuationForm))
{
// Show how the analysis was approved by setting the border color.
width = 3000;
color = GetGuessColor(wag.Analysis);
}
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTop, (int)FwTextPropVar.ktpvMilliPoint, width);
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderBottom, (int)FwTextPropVar.ktpvMilliPoint, width);
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderLeading, (int)FwTextPropVar.ktpvMilliPoint, width);
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTrailing, (int)FwTextPropVar.ktpvMilliPoint, width);
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderColor, (int)FwTextPropVar.ktpvDefault, color);
}

/// <summary>
/// Displays Analysis using DisplayWordBundleMethod and closes the views Inner Pile.
Expand Down
Loading