Example #1
0
        private bool EditExistingMsa()
        {
            PopupTree pt = GetPopupTree();

            // Force the PopupTree to Hide() to trigger popupTree_PopupTreeClosed().
            // This will effectively revert the list selection to a previous confirmed state.
            // Whatever happens below, we don't want to actually leave the "Modify ..." node selected!
            // This is at least required if the user selects "Cancel" from the dialog below.
            if (m_sense.MorphoSyntaxAnalysisRA != null)
            {
                pt.SelectObj(m_sense.MorphoSyntaxAnalysisRA.Hvo);
            }
#if __MonoCS__
            // If Popup tree is shown whilest the dialog is shown, the first click on the dialog is consumed by the
            // Popup tree, (and closes it down). On .NET the PopupTree appears to be automatically closed.
            pt.HideForm();
#endif
            SandboxGenericMSA dummyMsa = SandboxGenericMSA.Create(m_sense.MorphoSyntaxAnalysisRA);
            using (MsaCreatorDlg dlg = new MsaCreatorDlg())
            {
                dlg.SetDlgInfo(Cache, m_persistProvider, m_mediator, m_sense.Entry, dummyMsa,
                               m_sense.MorphoSyntaxAnalysisRA.Hvo, true, m_sEditGramFunc);
                if (dlg.ShowDialog(ParentForm) == DialogResult.OK)
                {
                    Cache.DomainDataByFlid.BeginUndoTask(String.Format(LexTextControls.ksUndoSetX, FieldName),
                                                         String.Format(LexTextControls.ksRedoSetX, FieldName));
                    m_sense.SandboxMSA = dlg.SandboxMSA;
                    Cache.DomainDataByFlid.EndUndoTask();
                    LoadPopupTree(m_sense.MorphoSyntaxAnalysisRA.Hvo);
                    return(true);
                }
            }
            return(false);
        }
Example #2
0
        private void ChooseFromMasterCategoryList()
        {
            PopupTree pt = GetPopupTree();

            // Force the PopupTree to Hide() to trigger popupTree_PopupTreeClosed().
            // This will effectively revert the list selection to a previous confirmed state.
            // Whatever happens below, we don't want to actually leave the "More..." node selected!
            // This is at least required if the user selects "Cancel" from the dialog below.
            if (m_sense.MorphoSyntaxAnalysisRA != null)
            {
                pt.SelectObjWithoutTriggeringBeforeAfterSelects(m_sense.MorphoSyntaxAnalysisRA.Hvo);
            }
            // FWR-3542 -- Need this in .Net too, or it eats the first mouse click intended
            // for the dialog we're about to show below.
            pt.HideForm();

            new MasterCategoryListChooserLauncher(ParentForm, m_mediator, m_propertyTable, List, FieldName, m_sense);
        }