예제 #1
0
        /// -----------------------------------------------------------------------------------
        /// <summary>
        /// Creates a dummy draft view in the main window.
        /// </summary>
        /// -----------------------------------------------------------------------------------
        public void CreateDraftView()
        {
            // Check for verse bridge
            if (m_dummyDraftView != null)
            {
                m_dummyDraftView.Dispose();
            }
            m_dummyDraftView      = new DummyDraftView(Cache, false, Handle.ToInt32());
            m_dummyDraftView.Name = "dummyDraftView";

            m_dummyDraftView.Visible    = true;
            m_dummyDraftView.StyleSheet = StyleSheet;
            m_dummyDraftView.Anchor     = AnchorStyles.Top | AnchorStyles.Left |
                                          AnchorStyles.Right | AnchorStyles.Bottom;
            m_dummyDraftView.Dock = DockStyle.Fill;
            Controls.Add(m_dummyDraftView);
            m_rgClientViews.Add(m_dummyDraftView.GetType().Name, m_dummyDraftView);
            m_dummyDraftView.MakeRoot();             // JT needed to add this to get tests to pass.
            m_dummyDraftView.ActivateView();
            // m_dummyDraftView.TeEditingHelper.InTestMode = true;
        }
예제 #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Creates the dummy draft view.
        /// </summary>
        /// <param name="fForBT"><c>true</c> if the draft view is supposed to represent a BT
        /// </param>
        /// <param name="fMakeRoot"><c>true</c> if the root should be constructed; <c>false</c>
        /// if the caller will be responsible for making the rootbox later.</param>
        /// <returns></returns>
        /// ------------------------------------------------------------------------------------
        private DummyDraftView CreateDummyDraftView(bool fForBT, bool fMakeRoot)
        {
            DummyDraftView draftView = new DummyDraftView(Cache, fForBT, Handle.ToInt32());

            draftView.Anchor = AnchorStyles.Top | AnchorStyles.Left |
                               AnchorStyles.Right | AnchorStyles.Bottom;
            draftView.Dock       = DockStyle.Fill;
            draftView.Name       = "draftView";
            draftView.StyleSheet = StyleSheet;
            if (m_rootb != null)
            {
                draftView.RootBox = m_rootb;
            }

            if (fMakeRoot)
            {
                draftView.MakeRoot();
                draftView.Visible = true;
                draftView.ActivateView();
            }

            return(draftView);
        }
예제 #3
0
        /// -----------------------------------------------------------------------------------
        /// <summary>
        /// Creates 2 sync'd draftviews in a form. Loads scripture from the DB.
        /// </summary>
        /// <param name="cache">The cache, believe it or not</param>
        /// -----------------------------------------------------------------------------------
        public RootSiteGroup CreateSyncDraftView(FdoCache cache)
        {
            CheckDisposed();

            Cache = cache;
            RootSiteGroup group = new RootSiteGroup(cache, (int)TeViewGroup.Scripture);

            DummyDraftView draft1 = CreateDummyDraftView(false, false);

            m_draftView = CreateDummyDraftView(false, false);
            group.AddToSyncGroup(draft1);
            group.AddToSyncGroup(m_draftView);
            group.ScrollingController = m_draftView;

            draft1.MakeRoot();
            draft1.Visible = true;
            m_draftView.MakeRoot();
            m_draftView.Visible = true;

            Controls.Add(group);
            group.Show();
            return(group);
        }