This class wraps together a style bar, a vernacular draft view, and a back-translation draft view, not to mention a footnote view or two (plus a kangaroo).
Inheritance: SIL.FieldWorks.TE.ViewWrapper
示例#1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Creates the Back Translation/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 CreateBackTransDraftView(string viewName, TeViewType viewType,
			SBTabItemProperties tabItem)
		{
			TeScrDraftViewProxy draftView = new TeScrDraftViewProxy(this, kDraftViewName, true,
				true, false, TeViewType.DraftView);
			TeScrDraftViewProxy btDraftView = new TeScrDraftViewProxy(this, kBackTransView, true,
				true, false, TeViewType.BackTranslationDraft);
			DraftStylebarProxy stylebar = new DraftStylebarProxy(this, "BTSplit", false);

			TeFootnoteDraftViewProxy footnoteDraftView = new TeFootnoteDraftViewProxy(this,
				kDraftFootnoteViewName, true, false);
			TeFootnoteDraftViewProxy footnoteBtDraftView = new TeFootnoteDraftViewProxy(this,
				kBackTransFootnoteView, true, true);
			DraftStylebarProxy footnoteStylebar = new DraftStylebarProxy(this,
				"BackTransFootnote", true);

			// Construct the one view wrapper
			BtDraftSplitWrapper btWrap = new BtDraftSplitWrapper(kBtDraftSplitView, this,
				m_cache, StyleSheet, SettingsKey, draftView, stylebar, btDraftView,
				footnoteDraftView, footnoteStylebar, footnoteBtDraftView);
			((ISelectableView)btWrap).BaseInfoBarCaption = viewName;

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

			ClientControls.Add(btWrap);
			// Bring the wrapper to the top of the z-order, so that
			// (if it is the active view) it fills only the remaining space
			btWrap.BringToFront();
			//Debug.Assert(m_rgClientViews.Count >= 1);
			m_rgClientViews.Add(TeEditingHelper.ViewTypeString(TeViewType.BackTranslationDraft), btWrap);
			m_uncreatedViews.Remove(TeViewType.BackTranslationDraft);
			return btWrap;
		}
示例#2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Creates the Back Translation/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>
		/// ------------------------------------------------------------------------------------
		protected ISelectableView CreateBackTransDraftView(UserView userView, TeViewType viewType,
			SBTabItemProperties tabItem)
		{
			DraftViewCreateInfo draftView = new DraftViewCreateInfo(kDraftViewName, false,
				true, false, true, true, TeViewType.DraftView);
				// REVIEW (EberhardB): Do we need to or the Scripture and BT flags like this?   true, false, true, true, TeViewType.Scripture | TeViewType.BackTranslationDraft);
			DraftViewCreateInfo btDraftView = new DraftViewCreateInfo(kBackTransView, true,
				true, false, true, true, TeViewType.BackTranslationDraft);
			StylebarCreateInfo stylebar = new StylebarCreateInfo("BTSplit", false);

			FootnoteCreateInfo footnoteDraftView = new FootnoteCreateInfo(kDraftFootnoteViewName,
				false, true);
			FootnoteCreateInfo footnoteBtDraftView = new FootnoteCreateInfo(kBackTransFootnoteView,
				true, true);
			StylebarCreateInfo footnoteStylebar = new StylebarCreateInfo("BackTransFootnote", true);

			// Construct the one view wrapper
			BtDraftSplitWrapper btWrap = new BtDraftSplitWrapper(kBtDraftSplitView, this,
				m_cache, StyleSheet, SettingsKey, draftView, stylebar, btDraftView,
				footnoteDraftView, footnoteStylebar, footnoteBtDraftView);
			((ISelectableView)btWrap).BaseInfoBarCaption = userView.ViewNameShort;

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

			ClientControls.Add(btWrap);
			// Bring the wrapper to the top of the z-order, so that
			// (if it is the active view) it fills only the remaining space
			btWrap.BringToFront();
			//Debug.Assert(ClientWindows.Count >= 1);
			ClientWindows.Add(TeEditingHelper.ViewTypeString(TeViewType.BackTranslationDraft), btWrap);
			m_uncreatedViews.Remove(TeViewType.BackTranslationDraft);
			return btWrap;
		}