コード例 #1
0
        /// <summary>
        /// Make a rootbox. When changing this, give careful consideration to changing Reuse().
        /// </summary>
        public override void MakeRoot()
        {
            CheckDisposed();

            m_rootb = null;
            base.MakeRoot();

            if (m_fdoCache == null || DesignMode)
            {
                return;
            }

            m_rgws = WritingSystemOptions;

            int wsUser = m_fdoCache.WritingSystemFactory.UserWs;

            m_vc = new InnerLabeledMultiStringViewVc(m_flid, m_rgws, wsUser, m_editable, m_fdoCache.TsStrFactory, this);

            // Review JohnT: why doesn't the base class do this??
            m_rootb = VwRootBoxClass.Create();
            m_rootb.SetSite(this);

            // And maybe this too, at least by default?
            m_rootb.DataAccess = m_fdoCache.DomainDataByFlid;

            // arg3 is a meaningless initial fragment, since this VC only displays one thing.
            // arg4 could be used to supply a stylesheet.
            m_rootb.SetRootObject(m_hvoObj, m_vc, 1, m_styleSheet);

            if (SetupOtherControls != null)
            {
                SetupOtherControls(this, new EventArgs());
            }
        }
コード例 #2
0
        public override void MakeRoot()
        {
            CheckDisposed();
            base.MakeRoot();

            if (m_fdoCache == null || DesignMode)
            {
                return;
            }

            m_PhoneEnvReferenceVc           = new PhoneEnvReferenceVc(m_fdoCache);
            m_vwCache                       = VwUndoDaClass.Create();
            m_silCache                      = (ISilDataAccess)m_vwCache;
            m_silCache.WritingSystemFactory = m_fdoCache.LanguageWritingSystemFactoryAccessor;
            IActionHandler handler = ActionHandlerClass.Create();

            m_silCache.SetActionHandler(handler);

            // Populate m_vwCache with data.
            ResynchListToDatabase();

            m_rootb = VwRootBoxClass.Create();
            m_rootb.SetSite(this);
            m_rootb.DataAccess = m_silCache;
            m_rootb.SetRootObject(m_rootObj.Hvo, m_PhoneEnvReferenceVc, kFragEnvironments,
                                  null);
            m_heightView = m_rootb.Height;
        }
コード例 #3
0
ファイル: InterlinRibbon.cs プロジェクト: vkarthim/FieldWorks
        public override void MakeRoot()
        {
            CheckDisposed();

            m_rootb = VwRootBoxClass.Create();
            m_rootb.SetSite(this);

            m_vc = new RibbonVc(this);

            if (LineChoices == null)
            {
                // fall-back (mainly for testing).
                LineChoices = new InterlinLineChoices(Cache.LangProject, Cache.DefaultVernWs, Cache.DefaultAnalWs);
                LineChoices.Add(InterlinLineChoices.kflidWord);
                LineChoices.Add(InterlinLineChoices.kflidWordGloss);
            }
            m_vc.LineChoices = LineChoices;

            m_rootb.DataAccess = Decorator;
            m_rootb.SetRootObject(HvoRoot, m_vc, kfragRibbonWordforms, this.StyleSheet);

            base.MakeRoot();
            m_rootb.Activate(VwSelectionState.vssOutOfFocus);             // Makes selection visible even before ever got focus.\
            MakeInitialSelection();
        }
コード例 #4
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Make the root box.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public override void MakeRoot()
        {
            CheckDisposed();

            if (m_fdoCache == null || DesignMode)
            {
                return;
            }

            // Check for non-existing rootbox before creating a new one. By doing that we
            // can mock the rootbox in our tests. However, this might cause problems in our
            // real code - altough I think MakeRoot() should be called only once.
            if (m_rootb == null)
            {
                m_rootb = VwRootBoxClass.Create();
            }

            m_rootb.SetSite(this);

            // Set up a new view constructor.
            m_diffFootnoteVc = new DiffFootnoteVc(m_Differences, m_fRev, m_fdoCache);

            m_rootb.DataAccess = m_fdoCache.MainCacheAccessor;

            m_rootb.SetRootObject(m_scrBook.Hvo, m_diffFootnoteVc, (int)FootnoteFrags.kfrBook,
                                  m_styleSheet);

            base.MakeRoot();
            m_dxdLayoutWidth = kForceLayout;             // Don't try to draw until we get OnSize and do layout.

            Synchronize(m_rootb);
        }
コード例 #5
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Override this method in your subclass.
        /// It should make a root box and initialize it with appropriate data and
        /// view constructor, etc.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public override void MakeRoot()
        {
            CheckDisposed();

            base.MakeRoot();

            if (m_fdoCache == null || DesignMode)
            {
                return;
            }

            IVwRootBox rootb = VwRootBoxClass.Create();

            rootb.SetSite(this);

            Debug.Assert(m_layoutName != null, "No layout name.");
            m_xmlVc = new XmlVc(StringTbl, m_layoutName, m_fEditable, this);
            m_xmlVc.LoadFlexLayouts = m_fLoadFlexLayouts;               // set before setting Cache.
            m_xmlVc.Cache           = m_fdoCache;

            rootb.DataAccess = m_fdoCache.MainCacheAccessor;
            //if (this.EditingHelper != null)
            //    this.EditingHelper.Editable = m_fEditable;
            m_rootb       = rootb;
            RootObjectHvo = m_hvoRoot;
        }
コード例 #6
0
ファイル: StVcTests.cs プロジェクト: vkarthim/FieldWorks
            /// ------------------------------------------------------------------------------------
            /// <summary>
            /// Makes a root box and initializes it with appropriate data
            /// </summary>
            /// ------------------------------------------------------------------------------------
            public override void MakeRoot()
            {
                CheckDisposed();

                if (m_fdoCache == null || DesignMode)
                {
                    return;
                }

                base.MakeRoot();

                m_rootb = VwRootBoxClass.Create();
                m_rootb.SetSite(this);

                // Set up a new view constructor.
                m_footnoteVc = new DummyFootnoteVc(m_fdoCache);
                m_footnoteVc.DisplayTranslation = m_displayTranslation;

                m_rootb.DataAccess = Cache.DomainDataByFlid;
                m_rootb.SetRootObject(Cache.LanguageProject.TranslatedScriptureOA.Hvo,
                                      m_footnoteVc, (int)FootnoteFrags.kfrScripture, m_styleSheet);

                m_fRootboxMade   = true;
                m_dxdLayoutWidth = kForceLayout;                 // Don't try to draw until we get OnSize and do layout.

                try
                {
                    m_rootb.MakeSimpleSel(true, false, false, true);
                }
                catch (COMException)
                {
                    // We ignore failures since the text window may be empty, in which case making a
                    // selection is impossible.
                }
            }
コード例 #7
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Make the root box.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public override void MakeRoot()
        {
            CheckDisposed();

            if (m_fdoCache == null || DesignMode || m_hvoRoot == 0)
            {
                return;
            }

            m_rootb = VwRootBoxClass.Create();
            m_rootb.SetSite(this);

            int wsFirstPara = GetWsOfFirstWordOfFirstTextPara();

            m_vc = new RawTextVc(m_rootb, m_fdoCache, wsFirstPara);
            SetupVc();

            m_showSpaceDa            = new ShowSpaceDecorator((ISilDataAccessManaged)m_fdoCache.MainCacheAccessor);
            m_showSpaceDa.ShowSpaces = ShowInvisibleSpaces;
            m_rootb.DataAccess       = m_showSpaceDa;

            m_rootb.SetRootObject(m_hvoRoot, m_vc, (int)StTextFrags.kfrText, m_styleSheet);

            base.MakeRoot();
        }
コード例 #8
0
            public override void MakeRoot()
            {
                CheckDisposed();

                base.MakeRoot();

                if (DesignMode)
                {
                    return;
                }

                // Review JohnT: why doesn't the base class do this??
                m_rootb = VwRootBoxClass.Create();
                m_rootb.SetSite(this);



                m_sda = new GhostDaDecorator(m_fdoCache.DomainDataByFlid as ISilDataAccessManaged, m_fdoCache.TsStrFactory.EmptyString(m_wsToCreate), (int)m_clidDst);

                m_rootb.DataAccess = m_sda;

                m_vc = new GhostStringSliceVc();

                // arg1 is a meaningless root HVO, since this VC only displays one dummy property and gets it from the ghostDA,
                // which ignores the HVO.
                // arg3 is a meaningless initial fragment, since this VC only displays one thing.
                m_rootb.SetRootObject(GhostStringSlice.khvoFake, m_vc, 1, m_styleSheet);
            }
コード例 #9
0
        protected virtual void MakeRootInternal()
        {
            m_rootb = VwRootBoxClass.Create();
            m_rootb.SetSite(this);
            // Setting this result too low can result in moving a cursor from an editable field
            // to a non-editable field (e.g. with Control-Right and Control-Left cursor
            // commands).  Normally we could set this to only a few (e.g. 4). but in
            // Interlinearizer we may want to jump from one sentence annotation to the next over
            // several read-only paragraphs  contained in a word bundle.  Make sure that
            // procedures that use this limit do not move the cursor from an editable to a
            // non-editable field.
            m_rootb.MaxParasToScan = 2000;

            EnsureVc();

            // We want to get notified when anything changes.
            m_sda = m_fdoCache.MainCacheAccessor;
            m_sda.AddNotification(this);

            m_vc.ShowMorphBundles = m_mediator.PropertyTable.GetBoolProperty("ShowMorphBundles", true);
            m_vc.LineChoices      = LineChoices;
            m_vc.ShowDefaultSense = true;

            m_rootb.DataAccess = m_fdoCache.MainCacheAccessor;
            m_rootb.SetRootObject(m_hvoRoot, m_vc, InterlinVc.kfragStText, m_styleSheet);
            m_objRepo = m_fdoCache.ServiceLocator.GetInstance <ICmObjectRepository>();
        }
コード例 #10
0
ファイル: InterlinRibbon.cs プロジェクト: sillsdev/WorldPad
        public override void MakeRoot()
        {
            CheckDisposed();

            m_rootb = VwRootBoxClass.Create();
            m_rootb.SetSite(this);

            m_vc = new RibbonVc(this);

            if (m_lineChoices == null)
            {
                // fall-back (mainly for testing).
                m_lineChoices = new InterlinLineChoices(0, m_cache.DefaultAnalWs, m_cache.LangProject);
                m_lineChoices.Add(InterlinLineChoices.kflidWord);
                m_lineChoices.Add(InterlinLineChoices.kflidWordGloss);
            }
            m_vc.LineChoices = m_lineChoices;
            // may be needed..normally happens when the VC displays a top-level paragraph.
            //SetupRealVernWsForDisplay(m_cache.LangProject.ActualWs(LangProject.kwsVernInParagraph,
            //    hvo, (int)StText.StTextTags.kflidParagraphs));

            m_rootb.DataAccess = m_cache.MainCacheAccessor;
            m_rootb.SetRootObject(HvoRoot, m_vc, kfragRibbonAnnotations, this.StyleSheet);

            base.MakeRoot();
            m_rootb.Activate(VwSelectionState.vssOutOfFocus);             // Makes selection visible even before ever got focus.\
            MakeInitialSelection();
        }
コード例 #11
0
        /// <summary></summary>
        public override void MakeRoot()
        {
            CheckDisposed();

            if (DesignMode)
            {
                return;
            }

            m_rootb = VwRootBoxClass.Create();
            m_rootb.SetSite(this);
            m_rootb.DataAccess = m_sda;

            int wsUser = m_realCache.ServiceLocator.WritingSystemManager.UserWs;
            int wsEn   = m_realCache.ServiceLocator.WritingSystemManager.GetWsFromStr("en");

            m_vc = new LabeledMultiStringVc(kflid, WritingSystems, wsUser, true, wsEn, m_realCache.TsStrFactory);

            // arg3 is a meaningless initial fragment, since this VC only displays one thing.
            m_rootb.SetRootObject(khvoRoot, m_vc, 1, m_styleSheet);
            m_dxdLayoutWidth = kForceLayout;             // Don't try to draw until we get OnSize and do layout.
            // The simple root site won't lay out properly until this is done.
            // It needs to be done before base.MakeRoot or it won't lay out at all ever!
            WritingSystemFactory = m_realCache.WritingSystemFactory;
            base.MakeRoot();
        }
コード例 #12
0
ファイル: PatternView.cs プロジェクト: vkarthim/FieldWorks
        public override void MakeRoot()
        {
            CheckDisposed();
            base.MakeRoot();

            if (m_fdoCache == null || DesignMode)
            {
                return;
            }

            m_rootb = VwRootBoxClass.Create();
            // the default value of 4 for MaxParasToScan isn't high enough when using the arrow keys to move
            // the cursor between items in a rule when the number of lines in the rule is high, since there might
            // be a large number of non-editable empty lines in a pile
            m_rootb.MaxParasToScan = 10;
            m_rootb.SetSite(this);
            m_rootb.DataAccess = m_sda;
            // JohnT: this notification removal was introduced by Damien in change list 25875, along with removing
            // several IgnorePropChanged wrappers in RuleFormulaControl. I don't know why we ever wanted to not see
            // (some) PropChanged messages, but ignoring them all prevents us from removing inserted items from the
            // view in Undo. (see FWR-3501)
            //m_fdoCache.MainCacheAccessor.RemoveNotification(m_rootb);
            if (m_hvo != 0)
            {
                m_rootb.SetRootObject(m_hvo, m_vc, m_rootFrag, FontHeightAdjuster.StyleSheetFromMediator(m_mediator));
            }
        }
コード例 #13
0
ファイル: SummarySlice.cs プロジェクト: vkarthim/FieldWorks
        public override void MakeRoot()
        {
            CheckDisposed();
            base.MakeRoot();

            if (m_fdoCache == null || DesignMode)
            {
                return;
            }

            IVwRootBox rootb = VwRootBoxClass.Create();

            rootb.SetSite(this);

            m_vc = new LiteralLabelVc(m_text, m_fdoCache.WritingSystemFactory.UserWs);

            rootb.DataAccess = m_fdoCache.DomainDataByFlid;

            // Since the VC just displays a literal, both the root HVO and the root frag are arbitrary.
            rootb.SetRootObject(1, m_vc, 2, StyleSheet);
            m_rootb = rootb;
            // pathologically (mainly during Refresh, it seems) the slice width may get set before
            // the root box is created, and no further size adjustment may take place, in which case,
            // when we have made the root, we need to adjust the width it occupies in the parent slice.
            m_slice.AdjustMainViewWidth();
        }
コード例 #14
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public override void MakeRoot()
        {
            CheckDisposed();

            if (m_sda == null || DesignMode)
            {
                return;
            }

            if (m_rootb == null)
            {
                m_rootb = VwRootBoxClass.Create();
            }

            m_rootb.SetSite(this);
            HorizMargin = 5;

            // Set up a new view constructor.
            m_vc               = new StVc(CurrentWs);
            m_vc.Editable      = true;
            m_vc.BackColor     = BackColor;
            m_rootb.DataAccess = m_sda;
            m_rootb.SetRootObject(kMemTextHvo, m_vc, (int)StTextFrags.kfrText, m_styleSheet);

            base.MakeRoot();
            m_dxdLayoutWidth = kForceLayout;
        }
コード例 #15
0
ファイル: PrintRootSite.cs プロジェクト: sillsdev/WorldPad
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        /// ------------------------------------------------------------------------------------
        private void Init(PrintPageEventArgs e)
        {
#if false
            long x1 = System.DateTime.Now.Ticks;
#endif
            // Set these now because the Graphics object will be locked below.
            m_rcDst         = m_rcSrc = new Rect(0, 0, (int)e.Graphics.DpiX, (int)e.Graphics.DpiY);
            m_dxpAvailWidth = PixelsFrom100ths(e.MarginBounds.Width, (int)e.Graphics.DpiX);

            // Create and initialize a print context.
            m_vwPrintContext = VwPrintContextWin32Class.Create();

            // TODO: When we provide a way for the user to specify the nFirstPageNo (i.e. the
            // first argument to SetPagePrintInfo), then change the arguments to
            // SetPagePrintInfo.
            m_vwPrintContext.SetPagePrintInfo(1, 1, 65535, 1, false);
            SetMargins(e);

            IVwGraphics vwGraphics = VwGraphicsWin32Class.Create();
            IntPtr      hdc        = IntPtr.Zero;
            try
            {
                // Get the printer's hdc and use it to initialize other stuff.
                hdc = e.Graphics.GetHdc();
                ((IVwGraphicsWin32)vwGraphics).Initialize(hdc);
                m_vwPrintContext.SetGraphics(vwGraphics);

                // Make a rootbox for printing and initialize it.
                m_rootb = VwRootBoxClass.Create();
                m_rootb.SetSite(this);
                m_rootb.DataAccess = m_sda;
                m_rootb.SetRootObject(m_hvo, m_vc, m_frags, m_styleSheet);
                m_rootb.InitializePrinting(m_vwPrintContext);
                m_totalNumberOfPages = m_rootb.GetTotalPrintPages(m_vwPrintContext, null);
                m_psettings          = e.PageSettings.PrinterSettings;
                SetPrintRange();
            }
            catch
            {
                m_rootb = null;
                string errorMsg =
                    ResourceHelper.GetResourceString("kstidErrorCreatingPrintRootSite");

                // TODO: Add the help file and url when we have a help file.
                MessageBox.Show(errorMsg, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (hdc != IntPtr.Zero)
                {
                    vwGraphics.ReleaseDC();
                    e.Graphics.ReleaseHdc(hdc);
                }
            }
#if false
            long x2 = System.DateTime.Now.Ticks;
            Debug.WriteLine("PrintRootSite.Init() took " + DeltaTime(x1, x2) + " seconds.");
#endif
        }
コード例 #16
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Override this method in your subclass.
        /// It should make a root box and initialize it with appropriate data and
        /// view constructor, etc.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public override void MakeRoot()
        {
            CheckDisposed();

            base.MakeRoot();

            if (m_fdoCache == null || DesignMode)
            {
                return;
            }

            IVwRootBox rootb = VwRootBoxClass.Create();

            rootb.SetSite(this);

            bool   fEditable = XmlUtils.GetOptionalBooleanAttributeValue(m_xnSpec, "editable", true);
            string toolName  = m_mediator.PropertyTable.GetStringProperty("currentContentControl", null);

            m_fShowFailingItems = m_mediator.PropertyTable.GetBoolProperty("ShowFailingItems-" + toolName, false);
            //m_xmlVc = new XmlVc(m_xnSpec, StringTbl); // possibly reinstate for old approach?
            // Note: we want to keep this logic similar to RecordDocView.GetLayoutName(), except that here
            // we do NOT want to use the layoutSuffix, though it may be specified so that it can be
            // used when the configure dialog handles a shared view.
            string sLayout = null;
            string sProp   = XmlUtils.GetOptionalAttributeValue(m_xnSpec, "layoutProperty", null);

            if (!String.IsNullOrEmpty(sProp))
            {
                sLayout = m_mediator.PropertyTable.GetStringProperty(sProp, null);
            }
            if (String.IsNullOrEmpty(sLayout))
            {
                sLayout = XmlUtils.GetManditoryAttributeValue(m_xnSpec, "layout");
            }
            ISilDataAccess sda = GetSda();

            m_xmlVc = new XmlVc(StringTbl, sLayout, fEditable, this, m_app,
                                m_fShowFailingItems ? null : ItemDisplayCondition, sda)
            {
                IdentifySource = true
            };
            ReadOnlyView = !fEditable;
            if (!fEditable)
            {
                rootb.MaxParasToScan = 0;
            }
            m_xmlVc.Cache       = m_fdoCache;
            m_xmlVc.MainSeqFlid = m_mainFlid;

            rootb.DataAccess   = sda;
            m_xmlVc.DataAccess = sda;

            rootb.SetRootObject(m_hvoRoot, m_xmlVc, RootFrag, m_styleSheet);
            m_rootb = rootb;
        }
コード例 #17
0
        public override void MakeRoot()
        {
            base.MakeRoot();

            Vc      = new TestVc(m_cache);
            m_rootb = VwRootBoxClass.Create();
            m_rootb.SetSite(this);
            m_rootb.DataAccess = m_cache.DomainDataByFlid;

            m_rootb.SetRootObject(m_hvoRoot, Vc, 1, null);
        }
コード例 #18
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Create the root box and initialize it. We want this one to work even in design mode,
        /// and since we supply the cache and data ourselves, that's possible.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public override void MakeRoot()
        {
            CheckDisposed();

            //if (DesignMode)
            //    return;
            m_rootb = VwRootBoxClass.Create();
            m_rootb.SetSite(this);
            m_rootb.DataAccess = m_DataAccess;
            m_rootb.SetRootObject(khvoRoot, m_vc, kfragRoot, null);
            base.MakeRoot();
        }
コード例 #19
0
ファイル: FootnoteView.cs プロジェクト: sillsdev/WorldPad
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Make the root box.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public override void MakeRoot()
        {
            CheckDisposed();

            if (m_fdoCache == null || DesignMode)
            {
                return;
            }

            if (FwEditingHelper.ApplicableStyleContexts != null)
            {
                FwEditingHelper.ApplicableStyleContexts = new List <ContextValues>(2);
                FwEditingHelper.ApplicableStyleContexts.Add(ContextValues.Note);
                FwEditingHelper.ApplicableStyleContexts.Add(ContextValues.General);
            }

            // This is muy importante. If a spurious rootbox got made already and we just replace
            // it with a new one, the old one will fire an assertion in its destructor.
            // REVIEW: Is this okay? Is there any way to prevent early creation of rootboxes?
            if (m_rootb == null)
            {
                m_rootb = VwRootBoxClass.Create();
            }

            m_rootb.SetSite(this);

            // Set up a new view constructor.
            m_FootnoteVc = new FootnoteVc(m_filterInstance, TeStVc.LayoutViewTarget.targetDraft,
                                          m_isBackTranslation ? m_btWs : m_fdoCache.DefaultVernWs);
            m_FootnoteVc.ContentType = this.ContentType;

            m_FootnoteVc.Cache           = m_fdoCache;
            m_FootnoteVc.HeightEstimator = Group as IHeightEstimator;
            m_FootnoteVc.Editable        = EditingHelper.Editable;
            m_bookFilter = FilteredScrBooks.GetFilterInstance(m_fdoCache, m_filterInstance);

            m_FootnoteVc.Cache = m_fdoCache;

            m_rootb.DataAccess = m_fdoCache.MainCacheAccessor;
            //EditingHelper.RootObjects = new int[]{ScriptureObj.Hvo};
            m_rootb.SetRootObject(ScriptureObj.Hvo, m_FootnoteVc,
                                  (int)FootnoteFrags.kfrScripture, m_styleSheet);

            base.MakeRoot();
            m_dxdLayoutWidth = kForceLayout;             // Don't try to draw until we get OnSize and do layout.

            //TODO:
            //ptmw->RegisterRootBox(qrootb);

            Synchronize(m_rootb);
        }
コード例 #20
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Override this method in your subclass.
        /// It should make a root box and initialize it with appropriate data and
        /// view constructor, etc.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public override void MakeRoot()
        {
            CheckDisposed();

            base.MakeRoot();

            if (m_fdoCache == null || DesignMode)
            {
                return;
            }

            IVwRootBox rootb = VwRootBoxClass.Create();

            rootb.SetSite(this);

            bool   fEditable = XmlUtils.GetOptionalBooleanAttributeValue(m_xnSpec, "editable", true);
            string toolName  = m_mediator.PropertyTable.GetStringProperty("currentContentControl", null);

            m_fShowFailingItems = m_mediator.PropertyTable.GetBoolProperty("ShowFailingItems-" + toolName, false);
            //m_xmlVc = new XmlVc(m_xnSpec, StringTbl); // possibly reinstate for old approach?
            string sLayout = null;
            string sProp   = XmlUtils.GetOptionalAttributeValue(m_xnSpec, "layoutProperty", null);

            if (!String.IsNullOrEmpty(sProp))
            {
                sLayout = m_mediator.PropertyTable.GetStringProperty(sProp, null);
            }
            if (String.IsNullOrEmpty(sLayout))
            {
                sLayout = XmlUtils.GetManditoryAttributeValue(m_xnSpec, "layout");
            }
            m_xmlVc = new XmlVc(StringTbl, sLayout,
                                fEditable, this, m_fShowFailingItems ? null : ItemDisplayCondition);
            this.ReadOnlyView = !fEditable;
            if (!fEditable)
            {
                rootb.MaxParasToScan = 0;
            }
            m_xmlVc.Cache       = m_fdoCache;
            m_xmlVc.MainSeqFlid = m_mainFlid;

            ISilDataAccess sda = GetSda();

            rootb.DataAccess   = sda;
            m_xmlVc.DataAccess = sda;

            rootb.SetRootObject(m_hvoRoot, m_xmlVc, RootFrag, m_styleSheet);
            m_rootb = rootb;
        }
コード例 #21
0
        public override void MakeRoot()
        {
            base.MakeRoot();

            if (m_fdoCache == null || DesignMode)
            {
                return;
            }

            m_rootb = VwRootBoxClass.Create();
            m_rootb.SetSite(this);
            m_rootb.DataAccess = m_fdoCache.DomainDataByFlid;
            m_rootb.SetRootObject(m_msa.Hvo, Vc,
                                  (int)VcFrags.kfragFullMSAInterlinearname, m_rootb.Stylesheet);
        }
コード例 #22
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Make the root box.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public override void MakeRoot()
        {
            CheckDisposed();

            if (m_fdoCache == null || DesignMode)
            {
                return;
            }

            Debug.Assert(Group != null && Group.ScrollingController != null);

            bool fSiblingEditable = ((DraftViewBase)Group.ScrollingController).InitialEditableState;

            BackColor = fSiblingEditable ? SystemColors.Window : TeResourceHelper.NonEditableColor;

            // This is muy importante. If a spurious rootbox got made already and we just replace
            // it with a new one, the old one will fire an assertion in its destructor.
            // REVIEW: Is this okay? Is there any way to prevent early creation of rootboxes?
            Debug.Assert(m_rootb == null, "Rootbox should be null");
            if (m_rootb == null)
            {
                m_rootb = VwRootBoxClass.Create();
            }

            m_rootb.SetSite(this);

            // Set up a new view constructor.
            m_styleBarVc = new DraftStyleBarVc(FilterInstance, m_displayForFootnotes);
            // Stylenames
            m_styleBarVc.DefaultWs       = m_fdoCache.LanguageWritingSystemFactoryAccessor.GetWsFromStr("en");
            m_styleBarVc.Cache           = m_fdoCache;
            m_styleBarVc.BackColor       = BackColor;
            m_styleBarVc.HeightEstimator = Group as IHeightEstimator;

            m_rootb.DataAccess = new ScrBookFilterDecorator(m_fdoCache, m_filterInstance);
            m_rootb.SetRootObject(m_fdoCache.LangProject.TranslatedScriptureOA.Hvo,
                                  m_styleBarVc,
                                  m_displayForFootnotes ? (int)FootnoteFrags.kfrScripture : (int)ScrFrags.kfrScripture,
                                  null);

            //TODO:
            //ptmw->RegisterRootBox(qrootb);

            base.MakeRoot();
            m_dxdLayoutWidth = kForceLayout;             // Don't try to draw until we get OnSize and do layout.

            Synchronize(m_rootb);
        }
コード例 #23
0
        public override void MakeRoot()
        {
            CheckDisposed();

            if (m_fdoCache == null || DesignMode || m_slice.ContainingDataTree == null)
            {
                return;
            }

            m_rootb = VwRootBoxClass.Create();
            m_rootb.SetSite(this);
            if (m_ws == 0)
            {
                m_ws = m_fdoCache.DefaultAnalWs;
            }

            m_hvoStText = m_fdoCache.GetObjProperty(m_hvoOwner, m_flid);
            // If we don't already have an StText in this field, make one now.
            if (m_hvoStText == 0)
            {
                ISilDataAccess sda = m_fdoCache.MainCacheAccessor;
                // Create one and initialize it. Don't use the FdoCache method, because it's important NOT to notify
                // our own data tree of the change...if we do, it could start a new regenerate in the middle of an
                // existing one with bad consequences.
                m_hvoStText = sda.MakeNewObject(StText.kclsidStText, m_hvoOwner, m_flid, -2);
                int           hvoStTxtPara = sda.MakeNewObject(StTxtPara.kclsidStTxtPara, m_hvoStText, (int)StText.StTextTags.kflidParagraphs, 0);
                ITsStrFactory tsf          = TsStrFactoryClass.Create();
                sda.SetString(hvoStTxtPara, (int)StTxtPara.StTxtParaTags.kflidContents, tsf.MakeString("", m_ws));
                // Notify change on the main property. The other properties we changed are part of the new object, and nothing
                // can know their previous state and need to see the change.
                sda.PropChanged(m_slice.ContainingDataTree, (int)PropChangeType.kpctNotifyAllButMe, m_hvoOwner, m_flid, 0, 1, 0);
            }

            m_vc          = new StVc("Normal", m_ws);
            m_vc.Cache    = m_fdoCache;
            m_vc.Editable = true;

            m_rootb.DataAccess = m_fdoCache.MainCacheAccessor;

            m_rootb.SetRootObject(m_hvoStText, m_vc, (int)StTextFrags.kfrText,
                                  m_styleSheet);

            base.MakeRoot();
            m_dxdLayoutWidth = kForceLayout;             // Don't try to draw until we get OnSize and do layout.

            //TODO:
            //ptmw->RegisterRootBox(qrootb);
        }
コード例 #24
0
ファイル: TsStringBox.cs プロジェクト: sillsdev/WorldPad
            /// ------------------------------------------------------------------------------------
            /// <summary>
            /// Create the root box and initialize it. We want this one to work even in design mode, and since
            /// we supply the cache and data ourselves, that's possible.
            /// </summary>
            /// ------------------------------------------------------------------------------------
            public override void MakeRoot()
            {
                CheckDisposed();

                if (DesignMode)
                {
                    return;
                }

                m_rootb = VwRootBoxClass.Create();
                m_rootb.SetSite(this);
                m_rootb.DataAccess = m_DataAccess;
                m_rootb.SetRootObject(khvoRoot, m_vc, kfragRoot, StyleSheet);
                m_dxdLayoutWidth = kForceLayout;                 // Don't try to draw until we get OnSize and do layout.
                base.MakeRoot();
            }
コード例 #25
0
        public override void MakeRoot()
        {
            CheckDisposed();
            base.MakeRoot();

            if (m_fdoCache == null || DesignMode)
            {
                return;
            }

            SetReferenceVc();
            m_rootb = VwRootBoxClass.Create();
            m_rootb.SetSite(this);
            m_rootb.DataAccess = m_fdoCache.MainCacheAccessor;
            SetRootBoxObj();
        }
コード例 #26
0
        public override void MakeRoot()
        {
            CheckDisposed();
            base.MakeRoot();

            if (m_fdoCache == null || DesignMode)
            {
                return;
            }

            m_VectorReferenceVc = CreateVectorReferenceVc();
            m_rootb             = VwRootBoxClass.Create();
            m_rootb.SetSite(this);
            m_rootb.DataAccess = GetDataAccess();
            SetupRoot();
        }
コード例 #27
0
        public override void MakeRoot()
        {
            CheckDisposed();
            base.MakeRoot();

            if (m_fdoCache == null || DesignMode)
            {
                return;
            }

            m_VectorReferenceVc = CreateVectorReferenceVc();
            m_rootb             = VwRootBoxClass.Create();
            m_rootb.SetSite(this);
            m_rootb.DataAccess = m_fdoCache.MainCacheAccessor;
            m_rootb.SetRootObject(m_rootObj.Hvo, m_VectorReferenceVc, kfragTargetVector, null);
        }
コード例 #28
0
        public override void MakeRoot()
        {
            base.MakeRoot();

            if (m_fdoCache == null || DesignMode)
            {
                return;
            }

            MoMorphSynAnalysisUi msaUi = new MoMorphSynAnalysisUi(m_msa);

            m_rootb = VwRootBoxClass.Create();
            m_rootb.SetSite(this);
            m_rootb.DataAccess = m_fdoCache.MainCacheAccessor;
            m_vc = msaUi.Vc as MoMorphSynAnalysisUi.MsaVc;
            m_rootb.SetRootObject(m_msa.Hvo, m_vc,
                                  (int)VcFrags.kfragFullMSAInterlinearname, m_rootb.Stylesheet);
        }
コード例 #29
0
        /// <summary>
        /// Make the root box and initialize it.
        /// </summary>
        public override void MakeRoot()
        {
            CheckDisposed();

            base.MakeRoot();

            IVwRootBox rootb = VwRootBoxClass.Create();

            rootb.SetSite(this);

            m_vc = new RelatedWordsVc(m_wsUser, m_headword);

            rootb.DataAccess = m_sda;

            m_rootb = rootb;
            m_rootb.SetRootObject(m_hvoRoot, m_vc, RelatedWordsVc.kfragRoot, m_styleSheet);
            m_fRootboxMade = true;
        }
コード例 #30
0
            public override void MakeRoot()
            {
                CheckDisposed();
                base.MakeRoot();

                if (m_fdoCache == null || DesignMode)
                {
                    return;
                }
                m_vc = new AtomicRefTypeAheadVc(m_flid, m_fdoCache);

                m_rootb = VwRootBoxClass.Create();
                m_rootb.SetSite(this);
                m_rootb.DataAccess = m_fdoCache.DomainDataByFlid;

                // arg3 is a meaningless initial fragment, since this VC only displays one thing.
                m_rootb.SetRootObject(m_hvoObj, m_vc, 1, m_styleSheet);
            }