Example #1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Creates the Scripture/Draft View
		/// </summary>
		/// <param name="viewName">Name of the view.</param>
		/// <param name="viewType">Type of the view.</param>
		/// <param name="tabItem">The tab item.</param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		protected ISelectableView CreateDraftView(string viewName, TeViewType viewType,
			SBTabItemProperties tabItem)
		{
			TeScrDraftViewProxy topDraftView = new TeScrDraftViewProxy(this, "TopDraftView",
				true, false, false, TeViewType.DraftView);
			DraftStylebarProxy topStylebar = new DraftStylebarProxy(this, "Top", false);
			TeScrDraftViewProxy bottomDraftView = new TeScrDraftViewProxy(this, "BottomDraftView",
				true, false, false, TeViewType.DraftView);
			DraftStylebarProxy bottomStylebar = new DraftStylebarProxy(this, "Bottom", false);

			TeFootnoteDraftViewProxy footnoteDraftView = new TeFootnoteDraftViewProxy(this,
				"DraftFootnoteView", true, false);
			DraftStylebarProxy footnoteStylebar = new DraftStylebarProxy(this, "Footnote", true);

			// Construct the one draft view wrapper (client window)
			DraftViewWrapper draftViewWrap = new DraftViewWrapper(kDraftViewWrapperName, this,
				m_cache, StyleSheet, SettingsKey, topDraftView, topStylebar, bottomDraftView,
				bottomStylebar, footnoteDraftView, footnoteStylebar);
			((ISelectableView)draftViewWrap).BaseInfoBarCaption = viewName;
			draftViewWrap.ResumeLayout();

			if (tabItem != null)
			{
				tabItem.Tag = draftViewWrap;
				tabItem.Update = true;
			}

			ClientControls.Add(draftViewWrap);
			// Bring the draftView to the top of the z-order, so that
			// (if it is the active view) it fills only the remaining space
			draftViewWrap.BringToFront();
			m_rgClientViews.Add(TeEditingHelper.ViewTypeString(viewType), draftViewWrap);
			m_uncreatedViews.Remove(viewType);
			return draftViewWrap;
		}
Example #2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Creates the Scripture/Draft View
		/// </summary>
		/// <param name="userView">The user view.</param>
		/// <param name="viewType">Type of the view.</param>
		/// <param name="tabItem">The tab item.</param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		protected ISelectableView CreateDraftView(UserView userView, TeViewType viewType,
			SBTabItemProperties tabItem)
		{
			DraftViewCreateInfo topDraftView = new DraftViewCreateInfo("TopDraftView", false,
				false, false, true, true, TeViewType.DraftView);
			StylebarCreateInfo topStylebar = new StylebarCreateInfo("Top", false);
			DraftViewCreateInfo bottomDraftView = new DraftViewCreateInfo("BottomDraftView", false,
				false, false, true, true, TeViewType.DraftView);
			StylebarCreateInfo bottomStylebar = new StylebarCreateInfo("Bottom", false);

			FootnoteCreateInfo footnoteDraftView = new FootnoteCreateInfo("DraftFootnoteView", false,
				true);
			StylebarCreateInfo footnoteStylebar = new StylebarCreateInfo("Footnote", true);

			// Construct the one draft view wrapper (client window)
			DraftViewWrapper draftViewWrap = new DraftViewWrapper(kDraftViewWrapperName, this,
				m_cache, StyleSheet, SettingsKey, topDraftView, topStylebar, bottomDraftView,
				bottomStylebar, footnoteDraftView, footnoteStylebar);
			((ISelectableView)draftViewWrap).BaseInfoBarCaption = userView.ViewNameShort;
			draftViewWrap.ResumeLayout();

			if (tabItem != null)
			{
				tabItem.Tag = draftViewWrap;
				tabItem.Update = true;
			}

			Debug.Assert(m_scrDraftView == null, "Shouldn't try to create a draft view if one already exists");
			m_scrDraftView = draftViewWrap;
			ClientControls.Add(draftViewWrap);
			// Bring the draftView to the top of the z-order, so that
			// (if it is the active view) it fills only the remaining space
			draftViewWrap.BringToFront();
			ClientWindows.Add(TeEditingHelper.ViewTypeString(viewType), draftViewWrap);
			m_uncreatedViews.Remove(viewType);
			return draftViewWrap;
		}