diff --git a/DistFiles/Language Explorer/Configuration/Main.xml b/DistFiles/Language Explorer/Configuration/Main.xml index 99b6ae229f..480b8bc6dc 100644 --- a/DistFiles/Language Explorer/Configuration/Main.xml +++ b/DistFiles/Language Explorer/Configuration/Main.xml @@ -967,9 +967,6 @@ I (RandyR) brought them into this file, just to keep track of them for the time - - @@ -315,7 +314,6 @@ - diff --git a/Src/LexText/Discourse/InterlinRibbon.cs b/Src/LexText/Discourse/InterlinRibbon.cs index 13f638a465..918706ba31 100644 --- a/Src/LexText/Discourse/InterlinRibbon.cs +++ b/Src/LexText/Discourse/InterlinRibbon.cs @@ -371,7 +371,7 @@ public override void Display(IVwEnv vwenv, int hvo, int frag) vwenv.OpenDiv(); vwenv.OpenParagraph(); - AddLabelPile(vwenv, m_cache, true, ShowMorphBundles); + AddLabelPile(vwenv, m_cache); vwenv.AddObjVecItems(m_ribbon.OccurenceListId, this, InterlinVc.kfragBundle); vwenv.CloseParagraph(); vwenv.CloseDiv(); diff --git a/Src/LexText/Interlinear/FocusBoxController.cs b/Src/LexText/Interlinear/FocusBoxController.cs index ce7df2fecd..c6de63898d 100644 --- a/Src/LexText/Interlinear/FocusBoxController.cs +++ b/Src/LexText/Interlinear/FocusBoxController.cs @@ -168,7 +168,6 @@ internal virtual IAnalysisControlInternal CreateNewSandbox(AnalysisOccurrence se m_lineChoices, selected, this); sandbox.SizeToContent = true; // Layout will ignore size. //sandbox.Mediator = Mediator; - sandbox.ShowMorphBundles = true; sandbox.StyleSheet = m_stylesheet; panelSandbox.Controls.Add(sandbox); // Makes it real and may give it a root box. // Note: adding sandbox to Controls doesn't always MakeRoot(), because OnHandleCreated happens diff --git a/Src/LexText/Interlinear/InterlinDocRootSiteBase.cs b/Src/LexText/Interlinear/InterlinDocRootSiteBase.cs index 2a84aa5cb0..fad14f22c5 100644 --- a/Src/LexText/Interlinear/InterlinDocRootSiteBase.cs +++ b/Src/LexText/Interlinear/InterlinDocRootSiteBase.cs @@ -104,8 +104,6 @@ protected virtual void MakeRootInternal() m_sda = m_cache.MainCacheAccessor; m_sda.AddNotification(this); - // PropertyTable can be null when the root site exists inside a dialog (LT-20412) - Vc.ShowMorphBundles = m_propertyTable?.GetBoolProperty("ShowMorphBundles", true) ?? true; Vc.LineChoices = LineChoices; Vc.ShowDefaultSense = true; diff --git a/Src/LexText/Interlinear/InterlinMaster.cs b/Src/LexText/Interlinear/InterlinMaster.cs index 668c64740d..d37d420fe2 100644 --- a/Src/LexText/Interlinear/InterlinMaster.cs +++ b/Src/LexText/Interlinear/InterlinMaster.cs @@ -484,10 +484,6 @@ public void OnPropertyChanged(string name) if (m_tabCtrl.SelectedIndex != (int)InterlinearTab) ShowTabView(); break; - case "ShowMorphBundles": - // This helps make sure the notification gets through even if the pane isn't - // in focus (maybe the Sandbox or TC pane is) and so isn't an xCore target. - break; } } diff --git a/Src/LexText/Interlinear/InterlinVc.cs b/Src/LexText/Interlinear/InterlinVc.cs index 1db1ccd835..9533c912ac 100644 --- a/Src/LexText/Interlinear/InterlinVc.cs +++ b/Src/LexText/Interlinear/InterlinVc.cs @@ -136,7 +136,6 @@ public class InterlinVc : FwBaseVc, IDisposable private ITsString m_tssCommaSpace; private ITsString m_tssPendingGlossAffix; // LexGloss line GlossAppend or GlossPrepend private int m_mpBundleHeight; // millipoint height of interlinear bundle. - private bool m_fShowMorphBundles = true; private bool m_fRtl; private readonly IDictionary m_mapWsDirTss = new Dictionary(); // AnnotationDefns we need @@ -475,21 +474,6 @@ private set } } - // Controls whether to display the morpheme bundles. - public bool ShowMorphBundles - { - get - { - CheckDisposed(); - return m_fShowMorphBundles; - } - set - { - CheckDisposed(); - m_fShowMorphBundles = value; - } - } - // Controls whether to display the default sense (true), or the normal '***' row. public bool ShowDefaultSense { @@ -666,7 +650,7 @@ public override void Display(IVwEnv vwenv, int hvo, int frag) (int)SpellingModes.ksmDoNotCheck); vwenv.OpenParagraph(); AddSegmentReference(vwenv, hvo); // Calculate and display the segment reference. - AddLabelPile(vwenv, m_cache, true, m_fShowMorphBundles); + AddLabelPile(vwenv, m_cache); vwenv.AddObjVecItems(SegmentTags.kflidAnalyses, this, kfragBundle); // JohnT, 1 Feb 2008. Took this out as I can see no reason for it; AddObjVecItems handles // the dependency already. Adding it just means that any change to the forms list @@ -701,8 +685,7 @@ public override void Display(IVwEnv vwenv, int hvo, int frag) { var wa = m_analRepository.GetObject(hvo); vwenv.AddObj(wa.Owner.Hvo, this, kfragWordformForm); - if (m_fShowMorphBundles) - vwenv.AddObj(hvo, this, kfragAnalysisMorphs); + vwenv.AddObj(hvo, this, kfragAnalysisMorphs); int chvoGlosses = wa.MeaningsOC.Count; for (int i = 0; i < m_WsList.AnalysisWsIds.Length; ++i) @@ -1168,7 +1151,7 @@ private void DisplaySingleInterlinearAnalysisWithLabels(IVwEnv vwenv, int hvo) } vwenv.OpenParagraph(); m_fHaveOpenedParagraph = true; - AddLabelPile(vwenv, m_cache, true, m_fShowMorphBundles); + AddLabelPile(vwenv, m_cache); try { // We use this rather than AddObj(hvo) so we can easily identify this object and select @@ -1657,7 +1640,7 @@ internal bool DisplayLexGlossWithInflType(IVwEnv vwenv, ILexEntry possibleVarian /// /// Add the pile of labels used to identify the lines in interlinear text. /// - public void AddLabelPile(IVwEnv vwenv, LcmCache cache, bool fWantMultipleSenseGloss, bool fShowMorphemes) + public void AddLabelPile(IVwEnv vwenv, LcmCache cache) { CheckDisposed(); @@ -1866,33 +1849,26 @@ private void DisplayMorphemes() { case WfiWordformTags.kClassId: case WfiAnalysisTags.kClassId: - if (m_this.m_fShowMorphBundles) + // Display the morpheme bundles. + if (m_hvoDefault != m_hvoWordBundleAnalysis) { - // Display the morpheme bundles. - if (m_hvoDefault != m_hvoWordBundleAnalysis) - { - m_this.SetGuessing(m_vwenv, m_this.GetGuessColor(m_defaultObj)); - // Let the exporter know that this is a guessed analysis. - m_vwenv.set_StringProperty(ktagAnalysisStatus, "guess"); - } - m_vwenv.AddObj(m_hvoDefault, m_this, kfragAnalysisMorphs); + m_this.SetGuessing(m_vwenv, m_this.GetGuessColor(m_defaultObj)); + // Let the exporter know that this is a guessed analysis. + m_vwenv.set_StringProperty(ktagAnalysisStatus, "guess"); } + m_vwenv.AddObj(m_hvoDefault, m_this, kfragAnalysisMorphs); break; case WfiGlossTags.kClassId: - - if (m_this.m_fShowMorphBundles) + m_hvoWfiAnalysis = m_defaultObj.Owner.Hvo; + // Display all the morpheme stuff. + if (m_hvoWordBundleAnalysis == m_hvoWordform) { - m_hvoWfiAnalysis = m_defaultObj.Owner.Hvo; - // Display all the morpheme stuff. - if (m_hvoWordBundleAnalysis == m_hvoWordform) - { - // Real analysis is just word, one we're displaying is a default - m_this.SetGuessing(m_vwenv, m_this.GetGuessColor(m_defaultObj)); - // Let the exporter know that this is a guessed analysis. - m_vwenv.set_StringProperty(ktagAnalysisStatus, "guess"); - } - m_vwenv.AddObj(m_hvoWfiAnalysis, m_this, kfragAnalysisMorphs); + // Real analysis is just word, one we're displaying is a default + m_this.SetGuessing(m_vwenv, m_this.GetGuessColor(m_defaultObj)); + // Let the exporter know that this is a guessed analysis. + m_vwenv.set_StringProperty(ktagAnalysisStatus, "guess"); } + m_vwenv.AddObj(m_hvoWfiAnalysis, m_this, kfragAnalysisMorphs); break; default: throw new Exception("Invalid type found in Segment analysis"); diff --git a/Src/LexText/Interlinear/SandboxBase.SandboxVc.cs b/Src/LexText/Interlinear/SandboxBase.SandboxVc.cs index e47b321aa4..292501a557 100644 --- a/Src/LexText/Interlinear/SandboxBase.SandboxVc.cs +++ b/Src/LexText/Interlinear/SandboxBase.SandboxVc.cs @@ -63,7 +63,6 @@ public class SandboxVc : FwBaseVc, IDisposable // width in millipoints of the arrow picture. int m_dxmpArrowPicWidth; bool m_fIconsForAnalysisChoices; - bool m_fShowMorphBundles = true; bool m_fIconForWordGloss = false; bool m_fIsMorphemeFormEditable = true; bool m_fRtl = false; @@ -245,20 +244,6 @@ internal bool RightToLeft m_sandbox.RootBox.Reconstruct(); } } - // Controls whether to display the morpheme bundles. - public bool ShowMorphBundles - { - get - { - CheckDisposed(); - return m_fShowMorphBundles; - } - set - { - CheckDisposed(); - m_fShowMorphBundles = value; - } - } public bool ShowWordGlossIcon { @@ -652,25 +637,22 @@ private static void SetBGColor(IVwEnv vwenv, int guessColor) private void DisplayMorphBundles(IVwEnv vwenv, int hvo) { - if (m_fShowMorphBundles) + // Don't allow direct editing of the morph bundle lines. + MakeNextFlowObjectReadOnly(vwenv); + if (vwenv.DataAccess.get_VecSize(hvo, ktagSbWordMorphs) == 0) { - // Don't allow direct editing of the morph bundle lines. - MakeNextFlowObjectReadOnly(vwenv); - if (vwenv.DataAccess.get_VecSize(hvo, ktagSbWordMorphs) == 0) - { - SetColor(vwenv, m_choices.LabelRGBForEnabled(m_choices.IndexInEnabled(InterlinLineChoices.kflidMorphemes))); - vwenv.AddProp(ktagMissingMorphs, this, kfragMissingMorphs); - // Blank lines to fill up the gap; LexEntry line - vwenv.AddString(m_tssEmptyVern); - vwenv.AddString(m_tssEmptyAnalysis); // LexGloss line - vwenv.AddString(m_tssEmptyAnalysis); // LexPos line - } - else - { - vwenv.OpenParagraph(); - vwenv.AddObjVec(ktagSbWordMorphs, this, kfragMorph); - vwenv.CloseParagraph(); - } + SetColor(vwenv, m_choices.LabelRGBForEnabled(m_choices.IndexInEnabled(InterlinLineChoices.kflidMorphemes))); + vwenv.AddProp(ktagMissingMorphs, this, kfragMissingMorphs); + // Blank lines to fill up the gap; LexEntry line + vwenv.AddString(m_tssEmptyVern); + vwenv.AddString(m_tssEmptyAnalysis); // LexGloss line + vwenv.AddString(m_tssEmptyAnalysis); // LexPos line + } + else + { + vwenv.OpenParagraph(); + vwenv.AddObjVec(ktagSbWordMorphs, this, kfragMorph); + vwenv.CloseParagraph(); } } diff --git a/Src/LexText/Interlinear/SandboxBase.cs b/Src/LexText/Interlinear/SandboxBase.cs index 9eea95131b..c4c583089c 100644 --- a/Src/LexText/Interlinear/SandboxBase.cs +++ b/Src/LexText/Interlinear/SandboxBase.cs @@ -190,8 +190,6 @@ public partial class SandboxBase : RootSite private bool m_fLockCombo = false; // True to lay out with infinite width, expecting to be fully visible. private bool m_fSizeToContent; - // We'd like to just use the VC's copy, but it may not get made in time. - private bool m_fShowMorphBundles = true; // Flag used to prevent mouse move events from entering CallMouseMoveDrag multiple // times before prior ones have exited. Otherwise we get lines displayed multiple @@ -418,8 +416,6 @@ protected bool IsMorphFormLineEmpty int cmorphs = MorphCount; if (cmorphs == 0) { - //Debug.Assert(!ShowMorphBundles); // if showing should always have one. - // JohnT: except when the user turned on morphology while the Sandbox was active... return true; } if (MorphCount == 1) @@ -578,24 +574,6 @@ public bool RightToLeftWritingSystem } } - // Controls whether to display the morpheme bundles. - public bool ShowMorphBundles - { - get - { - CheckDisposed(); - return m_fShowMorphBundles; - } - set - { - CheckDisposed(); - - m_fShowMorphBundles = value; - if (m_vc != null) - m_vc.ShowMorphBundles = value; - } - } - /// /// Finds the interlinDoc that this Sandbox is embedded in. /// @@ -1263,215 +1241,210 @@ private bool LoadRealDataIntoSec1(int hvoSbWord, bool fLookForDefaults, bool fAd cda.CacheObjProp(hvoSbWord, ktagSbWordPos, hvoWordPos); cda.CacheIntProp(hvoWordPos, ktagSbNamedObjGuess, fGuessing); } - if (this.ShowMorphBundles) + + bool hasMf = false; + var bldrError = new StringBuilder(); + foreach (var mb in analysis.MorphBundlesOS) { - bool hasMf = false; - var bldrError = new StringBuilder(); - foreach (var mb in analysis.MorphBundlesOS) + // Create the corresponding SbMorph. + int hvoMbSec = m_caches.DataAccess.MakeNewObject(kclsidSbMorph, hvoSbWord, + ktagSbWordMorphs, mb.IndexInOwner); + m_caches.Map(hvoMbSec, mb.Hvo); + + // Get the real MoForm, if any. + var mf = mb.MorphRA; + // Get the text we will display on the first line of the morpheme bundle. + // Taken from the MoForm if any, otherwise the form of the MB. + int hvoMorphForm; + string sPrefix = null; + string sPostfix = null; + if (mf == null) { - // Create the corresponding SbMorph. - int hvoMbSec = m_caches.DataAccess.MakeNewObject(kclsidSbMorph, hvoSbWord, - ktagSbWordMorphs, mb.IndexInOwner); - m_caches.Map(hvoMbSec, mb.Hvo); - - // Get the real MoForm, if any. - var mf = mb.MorphRA; - // Get the text we will display on the first line of the morpheme bundle. - // Taken from the MoForm if any, otherwise the form of the MB. - int hvoMorphForm; - string sPrefix = null; - string sPostfix = null; - if (mf == null) + // Create the secondary object corresponding to the MoForm. We create one + // even though there isn't a real MoForm. It doesn't correspond to anything + // in the real database. + hvoMorphForm = m_caches.DataAccess.MakeNewObject(kclsidSbNamedObj, mb.Hvo, + ktagSbMorphForm, -2); // -2 for atomic + CopyStringsToSecondary(InterlinLineChoices.kflidMorphemes, sdaMain, mb.Hvo, + WfiMorphBundleTags.kflidForm, cda, hvoMorphForm, ktagSbNamedObjName); + // We will slightly adjust the form we display in the default vernacular WS. + InterlinLineSpec specMorphemes = m_choices.GetPrimarySpec(InterlinLineChoices.kflidMorphemes); + int wsForm; + if (specMorphemes == null || !mb.Form.TryWs(specMorphemes.WritingSystem, out wsForm)) + wsForm = RawWordformWs; + ITsString tssForm = sdaMain.get_MultiStringAlt(mb.Hvo, + WfiMorphBundleTags.kflidForm, + wsForm); + string realForm = tssForm.Text; + // currently (unfortunately) Text returns 'null' from COM for empty strings. + if (realForm == null) + realForm = string.Empty; + + // if it's not an empty string, then we can find its form type, and separate the + // morpheme markers into separate properties. + if (realForm != string.Empty) { - // Create the secondary object corresponding to the MoForm. We create one - // even though there isn't a real MoForm. It doesn't correspond to anything - // in the real database. - hvoMorphForm = m_caches.DataAccess.MakeNewObject(kclsidSbNamedObj, mb.Hvo, - ktagSbMorphForm, -2); // -2 for atomic - CopyStringsToSecondary(InterlinLineChoices.kflidMorphemes, sdaMain, mb.Hvo, - WfiMorphBundleTags.kflidForm, cda, hvoMorphForm, ktagSbNamedObjName); - // We will slightly adjust the form we display in the default vernacular WS. - InterlinLineSpec specMorphemes = m_choices.GetPrimarySpec(InterlinLineChoices.kflidMorphemes); - int wsForm; - if (specMorphemes == null || !mb.Form.TryWs(specMorphemes.WritingSystem, out wsForm)) - wsForm = RawWordformWs; - ITsString tssForm = sdaMain.get_MultiStringAlt(mb.Hvo, - WfiMorphBundleTags.kflidForm, - wsForm); - string realForm = tssForm.Text; - // currently (unfortunately) Text returns 'null' from COM for empty strings. - if (realForm == null) - realForm = string.Empty; - - // if it's not an empty string, then we can find its form type, and separate the - // morpheme markers into separate properties. - if (realForm != string.Empty) + IMoMorphType mmt = null; + try { - IMoMorphType mmt = null; - try - { - int clsidForm; - mmt = MorphServices.FindMorphType(m_caches.MainCache, ref realForm, out clsidForm); - sPrefix = mmt.Prefix; - sPostfix = mmt.Postfix; - } - catch (Exception e) - { - bldrError.AppendLine(e.Message); - } + int clsidForm; + mmt = MorphServices.FindMorphType(m_caches.MainCache, ref realForm, out clsidForm); + sPrefix = mmt.Prefix; + sPostfix = mmt.Postfix; + } + catch (Exception e) + { + bldrError.AppendLine(e.Message); } - tssForm = TsStringUtils.MakeString(realForm, RawWordformWs); - cda.CacheStringAlt(hvoMorphForm, ktagSbNamedObjName, wsVern, tssForm); } + tssForm = TsStringUtils.MakeString(realForm, RawWordformWs); + cda.CacheStringAlt(hvoMorphForm, ktagSbNamedObjName, wsVern, tssForm); + } + else + { + hvoMorphForm = m_caches.FindOrCreateSec(mf.Hvo, kclsidSbNamedObj, hvoSbWord, ktagSbWordDummy); + if (IsLexicalPattern(mf.Form)) + // If mf.Form is a lexical pattern then mb.Form is the guessed root. + CopyStringsToSecondary(InterlinLineChoices.kflidMorphemes, sdaMain, mb.Hvo, + WfiMorphBundleTags.kflidForm, cda, hvoMorphForm, ktagSbNamedObjName); else + CopyStringsToSecondary(InterlinLineChoices.kflidMorphemes, sdaMain, mf.Hvo, + MoFormTags.kflidForm, cda, hvoMorphForm, ktagSbNamedObjName); + // Store the prefix and postfix markers from the MoMorphType object. + int hvoMorphType = sdaMain.get_ObjectProp(mf.Hvo, + MoFormTags.kflidMorphType); + if (hvoMorphType != 0) { - hvoMorphForm = m_caches.FindOrCreateSec(mf.Hvo, kclsidSbNamedObj, hvoSbWord, ktagSbWordDummy); - if (IsLexicalPattern(mf.Form)) - // If mf.Form is a lexical pattern then mb.Form is the guessed root. - CopyStringsToSecondary(InterlinLineChoices.kflidMorphemes, sdaMain, mb.Hvo, - WfiMorphBundleTags.kflidForm, cda, hvoMorphForm, ktagSbNamedObjName); - else - CopyStringsToSecondary(InterlinLineChoices.kflidMorphemes, sdaMain, mf.Hvo, - MoFormTags.kflidForm, cda, hvoMorphForm, ktagSbNamedObjName); - // Store the prefix and postfix markers from the MoMorphType object. - int hvoMorphType = sdaMain.get_ObjectProp(mf.Hvo, - MoFormTags.kflidMorphType); - if (hvoMorphType != 0) - { - sPrefix = sdaMain.get_UnicodeProp(hvoMorphType, - MoMorphTypeTags.kflidPrefix); - sPostfix = sdaMain.get_UnicodeProp(hvoMorphType, - MoMorphTypeTags.kflidPostfix); - } + sPrefix = sdaMain.get_UnicodeProp(hvoMorphType, + MoMorphTypeTags.kflidPrefix); + sPostfix = sdaMain.get_UnicodeProp(hvoMorphType, + MoMorphTypeTags.kflidPostfix); } - if (!String.IsNullOrEmpty(sPrefix)) - cda.CacheStringProp(hvoMbSec, ktagSbMorphPrefix, - TsStringUtils.MakeString(sPrefix, wsVern)); - if (!String.IsNullOrEmpty(sPostfix)) - cda.CacheStringProp(hvoMbSec, ktagSbMorphPostfix, - TsStringUtils.MakeString(sPostfix, wsVern)); - - // Link the SbMorph to its form object, noting if it is a guess. - cda.CacheObjProp(hvoMbSec, ktagSbMorphForm, hvoMorphForm); - cda.CacheIntProp(hvoMorphForm, ktagSbNamedObjGuess, fGuessing); - - // Get the real Sense that supplies the gloss, if any. - var senseReal = mb.SenseRA; - if (senseReal == null && fGuessing != 0) + } + if (!String.IsNullOrEmpty(sPrefix)) + cda.CacheStringProp(hvoMbSec, ktagSbMorphPrefix, + TsStringUtils.MakeString(sPrefix, wsVern)); + if (!String.IsNullOrEmpty(sPostfix)) + cda.CacheStringProp(hvoMbSec, ktagSbMorphPostfix, + TsStringUtils.MakeString(sPostfix, wsVern)); + + // Link the SbMorph to its form object, noting if it is a guess. + cda.CacheObjProp(hvoMbSec, ktagSbMorphForm, hvoMorphForm); + cda.CacheIntProp(hvoMorphForm, ktagSbNamedObjGuess, fGuessing); + + // Get the real Sense that supplies the gloss, if any. + var senseReal = mb.SenseRA; + if (senseReal == null && fGuessing != 0) + { + // Guess a default + senseReal = mb.DefaultSense; + } + if (senseReal != null) // either all-the-way real, or default. + { + // Create the corresponding dummy. + int hvoLexSenseSec; + // Add any irregularly inflected form type info to the LexGloss. + ILexEntryRef lerTest; + ILexEntry possibleVariant = null; + if (mf != null) + possibleVariant = mf.Owner as ILexEntry; + if (possibleVariant != null && possibleVariant.IsVariantOfSenseOrOwnerEntry(senseReal, out lerTest)) { - // Guess a default - senseReal = mb.DefaultSense; + hvoLexSenseSec = m_caches.FindOrCreateSec(senseReal.Hvo, kclsidSbNamedObj, hvoSbWord, ktagSbWordDummy); + CacheLexGlossWithInflTypeForAllCurrentWs(possibleVariant, hvoLexSenseSec, wsVern, cda, mb.InflTypeRA); } - if (senseReal != null) // either all-the-way real, or default. + else { - // Create the corresponding dummy. - int hvoLexSenseSec; - // Add any irregularly inflected form type info to the LexGloss. - ILexEntryRef lerTest; - ILexEntry possibleVariant = null; - if (mf != null) - possibleVariant = mf.Owner as ILexEntry; - if (possibleVariant != null && possibleVariant.IsVariantOfSenseOrOwnerEntry(senseReal, out lerTest)) - { - hvoLexSenseSec = m_caches.FindOrCreateSec(senseReal.Hvo, kclsidSbNamedObj, hvoSbWord, ktagSbWordDummy); - CacheLexGlossWithInflTypeForAllCurrentWs(possibleVariant, hvoLexSenseSec, wsVern, cda, mb.InflTypeRA); - } - else - { - // add normal LexGloss without variant info - hvoLexSenseSec = CreateSecondaryAndCopyStrings(InterlinLineChoices.kflidLexGloss, senseReal.Hvo, - LexSenseTags.kflidGloss, hvoSbWord, sdaMain, cda); - } - cda.CacheObjProp(hvoMbSec, ktagSbMorphGloss, hvoLexSenseSec); - cda.CacheIntProp(hvoLexSenseSec, ktagSbNamedObjGuess, fGuessing); - - int hvoInflType = 0; - if (mb.InflTypeRA != null) - { - hvoInflType = m_caches.FindOrCreateSec(mb.InflTypeRA.Hvo, - kclsidSbNamedObj, hvoSbWord, ktagSbWordDummy); - } - cda.CacheObjProp(hvoMbSec, ktagSbNamedObjInflType, hvoInflType); + // add normal LexGloss without variant info + hvoLexSenseSec = CreateSecondaryAndCopyStrings(InterlinLineChoices.kflidLexGloss, senseReal.Hvo, + LexSenseTags.kflidGloss, hvoSbWord, sdaMain, cda); } + cda.CacheObjProp(hvoMbSec, ktagSbMorphGloss, hvoLexSenseSec); + cda.CacheIntProp(hvoLexSenseSec, ktagSbNamedObjGuess, fGuessing); - // Get the MSA, if any. - var msaReal = mb.MsaRA; - if (msaReal != null) + int hvoInflType = 0; + if (mb.InflTypeRA != null) { - int hvoPos = m_caches.FindOrCreateSec(msaReal.Hvo, - kclsidSbNamedObj, hvoSbWord, ktagSbWordDummy); - - foreach (int ws in m_choices.EnabledWritingSystemsForFlid(InterlinLineChoices.kflidLexPos, true)) - { - // Since ws maybe ksFirstAnal/ksFirstVern, we need to get what is actually - // used in order to retrieve the data in Vc.Display(). See LT_7976. - // Use InterlinAbbrTss to get an appropriate different name for each ws - ITsString tssLexPos = msaReal.InterlinAbbrTSS(ws); - int wsActual = TsStringUtils.GetWsAtOffset(tssLexPos, 0); - cda.CacheStringAlt(hvoPos, ktagSbNamedObjName, wsActual, tssLexPos); - } - cda.CacheObjProp(hvoMbSec, ktagSbMorphPos, hvoPos); - cda.CacheIntProp(hvoPos, ktagSbNamedObjGuess, fGuessing); + hvoInflType = m_caches.FindOrCreateSec(mb.InflTypeRA.Hvo, + kclsidSbNamedObj, hvoSbWord, ktagSbWordDummy); } + cda.CacheObjProp(hvoMbSec, ktagSbNamedObjInflType, hvoInflType); + } - // If we have a form, we can get its owner and set the info for the Entry - // line. - // Enhance JohnT: attempt a guess if we have a form but no entry. - if (mf != null) + // Get the MSA, if any. + var msaReal = mb.MsaRA; + if (msaReal != null) + { + int hvoPos = m_caches.FindOrCreateSec(msaReal.Hvo, + kclsidSbNamedObj, hvoSbWord, ktagSbWordDummy); + + foreach (int ws in m_choices.EnabledWritingSystemsForFlid(InterlinLineChoices.kflidLexPos, true)) { - var entryReal = mf.Owner as ILexEntry; - // We can assume the owner is a LexEntry as that is the only type of object - // that can own MoForms. We don't actually create the LexEntry, to - // improve performance. All the relevant data should already have - // been loaded while creating the main interlinear view. - LoadSecDataForEntry(entryReal, senseReal, hvoSbWord, cda, wsVern, hvoMbSec, fGuessing, sdaMain); - hasMf = true; + // Since ws maybe ksFirstAnal/ksFirstVern, we need to get what is actually + // used in order to retrieve the data in Vc.Display(). See LT_7976. + // Use InterlinAbbrTss to get an appropriate different name for each ws + ITsString tssLexPos = msaReal.InterlinAbbrTSS(ws); + int wsActual = TsStringUtils.GetWsAtOffset(tssLexPos, 0); + cda.CacheStringAlt(hvoPos, ktagSbNamedObjName, wsActual, tssLexPos); } + cda.CacheObjProp(hvoMbSec, ktagSbMorphPos, hvoPos); + cda.CacheIntProp(hvoPos, ktagSbNamedObjGuess, fGuessing); } - if (hasMf) - // Wait until all of the morphemes have been loaded (cf. LT-22235). - CopyLexEntryInfoToMonomorphemicWordGlossAndPos(); - if (bldrError.Length > 0) + + // If we have a form, we can get its owner and set the info for the Entry + // line. + // Enhance JohnT: attempt a guess if we have a form but no entry. + if (mf != null) { - var msg = bldrError.ToString().Trim(); - var wnd = FindForm() ?? m_propertyTable.GetValue("window"); - MessageBox.Show(wnd, msg, ITextStrings.ksWarning, MessageBoxButtons.OK, MessageBoxIcon.Warning); + var entryReal = mf.Owner as ILexEntry; + // We can assume the owner is a LexEntry as that is the only type of object + // that can own MoForms. We don't actually create the LexEntry, to + // improve performance. All the relevant data should already have + // been loaded while creating the main interlinear view. + LoadSecDataForEntry(entryReal, senseReal, hvoSbWord, cda, wsVern, hvoMbSec, fGuessing, sdaMain); + hasMf = true; } } + if (hasMf) + // Wait until all of the morphemes have been loaded (cf. LT-22235). + CopyLexEntryInfoToMonomorphemicWordGlossAndPos(); + if (bldrError.Length > 0) + { + var msg = bldrError.ToString().Trim(); + var wnd = FindForm() ?? m_propertyTable.GetValue("window"); + MessageBox.Show(wnd, msg, ITextStrings.ksWarning, MessageBoxButtons.OK, MessageBoxIcon.Warning); + } } else { // No analysis, default or otherwise. We immediately, however, fill in a single // dummy morpheme, if showing morphology. fGuessing = 0; // distinguish between a 'guess' (defaults) and courtesy filler info (cf. LT-5858). - if (ShowMorphBundles) + int hvoMbSec = m_caches.DataAccess.MakeNewObject(kclsidSbMorph, hvoSbWord, + ktagSbWordMorphs, 0); + ITsString tssForm = m_caches.DataAccess.get_MultiStringAlt(hvoSbWord, ktagSbWordForm, this.RawWordformWs); + // Possibly adjust case of tssForm. + if (fAdjustCase && CaseStatus == StringCaseStatus.title && + tssForm != null && tssForm.Length > 0) { - int hvoMbSec = m_caches.DataAccess.MakeNewObject(kclsidSbMorph, hvoSbWord, - ktagSbWordMorphs, 0); - ITsString tssForm = m_caches.DataAccess.get_MultiStringAlt(hvoSbWord, ktagSbWordForm, this.RawWordformWs); - // Possibly adjust case of tssForm. - if (fAdjustCase && CaseStatus == StringCaseStatus.title && - tssForm != null && tssForm.Length > 0) - { - tssForm = TsStringUtils.MakeString(cf.ToLower(tssForm.Text), this.RawWordformWs); - m_tssWordform = tssForm; // need this to be set in case hvoWordformRef set to zero. - // If we adjust the case of the form, we must adjust the hvo as well, - // or any analyses created will go to the wrong WfiWordform. - CurrentAnalysisTree.Analysis = GetWordform(tssForm); - if (CurrentAnalysisTree.Wordform != null) - m_fShowAnalysisCombo = CurrentAnalysisTree.Wordform.AnalysesOC.Count > 0; - } - else - { - // just use the wfi wordform form for our dummy morph form. - tssForm = CurrentAnalysisTree.Wordform.Form.get_String(this.RawWordformWs); - } - int hvoMorphForm = m_caches.FindOrCreateSec(0, kclsidSbNamedObj, - hvoSbWord, ktagSbWordDummy); - cda.CacheStringAlt(hvoMorphForm, ktagSbNamedObjName, wsVern, tssForm); - cda.CacheObjProp(hvoMbSec, ktagSbMorphForm, hvoMorphForm); - cda.CacheIntProp(hvoMorphForm, ktagSbNamedObjGuess, fGuessing); + tssForm = TsStringUtils.MakeString(cf.ToLower(tssForm.Text), this.RawWordformWs); + m_tssWordform = tssForm; // need this to be set in case hvoWordformRef set to zero. + // If we adjust the case of the form, we must adjust the hvo as well, + // or any analyses created will go to the wrong WfiWordform. + CurrentAnalysisTree.Analysis = GetWordform(tssForm); + if (CurrentAnalysisTree.Wordform != null) + m_fShowAnalysisCombo = CurrentAnalysisTree.Wordform.AnalysesOC.Count > 0; + } + else + { + // just use the wfi wordform form for our dummy morph form. + tssForm = CurrentAnalysisTree.Wordform.Form.get_String(this.RawWordformWs); } + int hvoMorphForm = m_caches.FindOrCreateSec(0, kclsidSbNamedObj, + hvoSbWord, ktagSbWordDummy); + cda.CacheStringAlt(hvoMorphForm, ktagSbNamedObjName, wsVern, tssForm); + cda.CacheObjProp(hvoMbSec, ktagSbMorphForm, hvoMorphForm); + cda.CacheIntProp(hvoMorphForm, ktagSbNamedObjGuess, fGuessing); } return fGuessing != 0; } @@ -4087,7 +4060,6 @@ public override void MakeRoot() base.MakeRoot(); m_vc = new SandboxVc(m_caches, m_choices, IconsForAnalysisChoices, this); - m_vc.ShowMorphBundles = m_fShowMorphBundles; m_vc.MultipleOptionBGColor = MultipleAnalysisColor; m_vc.BackColor = (int)CmObjectUi.RGB(this.BackColor); m_vc.IsMorphemeFormEditable = IsMorphemeFormEditable; // Pass through value to VC. diff --git a/Src/LexText/Morphology/AnalysisInterlinearRS.cs b/Src/LexText/Morphology/AnalysisInterlinearRS.cs index d2c895accd..15af065a22 100644 --- a/Src/LexText/Morphology/AnalysisInterlinearRS.cs +++ b/Src/LexText/Morphology/AnalysisInterlinearRS.cs @@ -134,7 +134,6 @@ public override void MakeRoot() // Theory has it that the slices that have 'true' in this attribute will allow the sandbox to be used. // We'll see how the theory goes, when I get to the point of wanting to see the sandbox. var isEditable = IsEditable; - m_vc.ShowMorphBundles = true; m_vc.ShowDefaultSense = true; if ((m_wfiAnalysis.GetAgentOpinion(m_cache.LanguageProject.DefaultParserAgent) == Opinions.approves) && (m_wfiAnalysis.GetAgentOpinion(m_cache.LanguageProject.DefaultUserAgent) != Opinions.approves)) diff --git a/Src/LexText/ParserUI/TryAWordRootSite.cs b/Src/LexText/ParserUI/TryAWordRootSite.cs index c2c59d9e19..989bf780d4 100644 --- a/Src/LexText/ParserUI/TryAWordRootSite.cs +++ b/Src/LexText/ParserUI/TryAWordRootSite.cs @@ -106,9 +106,6 @@ public override void MakeRoot() base.MakeRoot(); m_vc = new InterlinVc(m_cache); - // Theory has it that the slices that have 'true' in this attribute will allow the sandbox to be used. - // We'll see how the theory goes, when I get to the point of wanting to see the sandbox. - m_vc.ShowMorphBundles = true; m_vc.ShowDefaultSense = true; m_vc.LineChoices = new EditableInterlinLineChoices(m_cache.LanguageProject, WritingSystemServices.kwsFirstVern,