|
18 | 18 | using SIL.LCModel; |
19 | 19 | using SIL.LCModel.DomainServices; |
20 | 20 | using SIL.LCModel.Infrastructure; |
| 21 | +using Gecko.WebIDL; |
21 | 22 |
|
22 | 23 | namespace SIL.FieldWorks.IText |
23 | 24 | { |
@@ -853,16 +854,35 @@ private void JoinGlossAffixesOfInflVariantTypes(ILexEntryRef entryRef1, int wsPr |
853 | 854 | /// <param name="vwenv"></param> |
854 | 855 | protected virtual void AddWordBundleInternal(int hvo, IVwEnv vwenv) |
855 | 856 | { |
856 | | - SetupAndOpenInnerPile(vwenv); |
857 | 857 | // we assume we're in the context of a segment with analyses here. |
858 | 858 | // we'll need this info down in DisplayAnalysisAndCloseInnerPile() |
859 | 859 | int hvoSeg; |
860 | 860 | int tagDummy; |
861 | 861 | int index; |
862 | 862 | vwenv.GetOuterObject(vwenv.EmbeddingLevel - 1, out hvoSeg, out tagDummy, out index); |
863 | 863 | var analysisOccurrence = new AnalysisOccurrence(m_segRepository.GetObject(hvoSeg), index); |
| 864 | + SetBorderColor(vwenv, analysisOccurrence); |
| 865 | + SetupAndOpenInnerPile(vwenv); |
864 | 866 | DisplayAnalysisAndCloseInnerPile(vwenv, analysisOccurrence, true); |
865 | 867 | } |
| 868 | + private void SetBorderColor(IVwEnv vwenv, AnalysisOccurrence analysisOccurrence) |
| 869 | + { |
| 870 | + var coRepository = m_cache.ServiceLocator.GetInstance<ICmObjectRepository>(); |
| 871 | + var wag = (IAnalysis)coRepository.GetObject(analysisOccurrence.Analysis.Hvo); |
| 872 | + int width = 0; |
| 873 | + int color = (int)ColorUtil.ConvertColorToBGR(Color.Black); |
| 874 | + if (IsParsingDevMode() && wag.ClassID != WfiWordformTags.kClassId && !(wag is IPunctuationForm)) |
| 875 | + { |
| 876 | + // Show how the analysis was approved by setting the border color. |
| 877 | + width = 3000; |
| 878 | + color = GetGuessColor(wag.Analysis); |
| 879 | + } |
| 880 | + vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTop, (int)FwTextPropVar.ktpvMilliPoint, width); |
| 881 | + vwenv.set_IntProperty((int)FwTextPropType.ktptBorderBottom, (int)FwTextPropVar.ktpvMilliPoint, width); |
| 882 | + vwenv.set_IntProperty((int)FwTextPropType.ktptBorderLeading, (int)FwTextPropVar.ktpvMilliPoint, width); |
| 883 | + vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTrailing, (int)FwTextPropVar.ktpvMilliPoint, width); |
| 884 | + vwenv.set_IntProperty((int)FwTextPropType.ktptBorderColor, (int)FwTextPropVar.ktpvDefault, color); |
| 885 | + } |
866 | 886 |
|
867 | 887 | /// <summary> |
868 | 888 | /// Displays Analysis using DisplayWordBundleMethod and closes the views Inner Pile. |
|
0 commit comments