Initialize() public method

Initialize the control.
public Initialize ( SIL.FieldWorks.FDO.FdoCache cache, XCore.Mediator mediator, Control ctrlAssistant, Form parentForm ) : void
cache SIL.FieldWorks.FDO.FdoCache
mediator XCore.Mediator
ctrlAssistant System.Windows.Forms.Control
parentForm System.Windows.Forms.Form
return void
Ejemplo n.º 1
0
        /// <summary>
        /// This sets the original citation form into the dialog.
        /// </summary>
        /// <param name="sWord"></param>
        /// <param name="sMorphs"></param>
        public void SetDlgInfo(ITsString tssCitationForm, ILexEntry le, Mediator mediator)
        {
            CheckDisposed();

            Debug.Assert(tssCitationForm != null);
            Debug.Assert(le != null);

            m_le       = le;
            m_cache    = le.Cache;
            m_mediator = mediator;

            m_fwtbCitationForm.Font =
                new Font(m_cache.LangProject.DefaultVernacularWritingSystemFont, 10);
            m_fwtbGloss.Font = new Font(m_cache.LangProject.DefaultAnalysisWritingSystemFont, 10);

            IVwStylesheet stylesheet = FontHeightAdjuster.StyleSheetFromMediator(mediator);

            // Set writing system factory and code for the two edit boxes.
            m_fwtbCitationForm.WritingSystemFactory = m_cache.LanguageWritingSystemFactoryAccessor;
            m_fwtbCitationForm.WritingSystemCode    =
                m_cache.LangProject.DefaultVernacularWritingSystem;
            m_fwtbCitationForm.StyleSheet         = stylesheet;
            m_fwtbCitationForm.AdjustStringHeight = false;
            m_fwtbGloss.WritingSystemFactory      = m_cache.LanguageWritingSystemFactoryAccessor;
            m_fwtbGloss.WritingSystemCode         = m_cache.LangProject.DefaultAnalysisWritingSystem;
            m_fwtbGloss.StyleSheet         = stylesheet;
            m_fwtbGloss.AdjustStringHeight = false;
            m_fwtbCitationForm.Tss         = tssCitationForm;
            m_fwtbGloss.Text             = String.Empty;
            m_fwtbCitationForm.HasBorder = false;

            m_msaGroupBox.Initialize(m_cache, mediator, this, new DummyGenericMSA());

            // get the current morph type from the lexical entry.
            IMoMorphType mmt = null;

            foreach (IMoForm mf in le.AlternateFormsOS)
            {
                mmt = mf.MorphTypeRA;
                if (mmt != null)
                {
                    m_msaGroupBox.MorphTypePreference = mmt;
                    break;                     // Assume the first allomorph's type is good enough.
                }
            }

            m_skipCheck        = true;
            m_cbIsStem.Checked = (m_msaGroupBox.MSAType == MsaType.kRoot || m_msaGroupBox.MSAType == MsaType.kStem);
            m_skipCheck        = false;

            // Adjust sizes of the two FwTextBoxes if needed, and adjust the locations for the
            // controls below them.  Do the same for the MSAGroupBox.
            AdjustHeightAndPositions(m_fwtbCitationForm);
            AdjustHeightAndPositions(m_fwtbGloss);
            AdjustHeightAndPositions(m_msaGroupBox);
        }