Exemplo n.º 1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Method to create the view when needed
        /// </summary>
        /// <param name="host">The control that will host (or "wrap") the view (can be
        /// <c>null</c>)</param>
        /// <returns>The created view</returns>
        /// ------------------------------------------------------------------------------------
        public override Control CreateView(Control host)
        {
            ViewWrapper  wrapper      = (ViewWrapper)host;
            FootnoteView footnoteView = new FootnoteView(m_mainWnd.Cache,
                                                         m_mainWnd.Handle.ToInt32(), m_mainWnd.App, m_name, m_editable, m_viewType,
                                                         GetBtWs(wrapper), wrapper.DraftView);

            m_mainWnd.RegisterFocusableView(footnoteView);
            return(footnoteView);
        }
Exemplo n.º 2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Method to create the view when needed
        /// </summary>
        /// <param name="host">The control that will host (or "wrap") the view (can be
        /// <c>null</c>)</param>
        /// <returns>The created view</returns>
        /// ------------------------------------------------------------------------------------
        public override Control CreateView(Control host)
        {
            ViewWrapper wrapper   = (ViewWrapper)host;
            DraftView   draftView = new DraftView(m_mainWnd.Cache, m_mainWnd.Handle.ToInt32(),
                                                  m_mainWnd.App, m_name, m_editable, m_showInTable, m_makeRootAutomatically,
                                                  m_viewType, GetBtWs(wrapper), m_mainWnd.App);

            m_mainWnd.RegisterFocusableView(draftView);
            draftView.TheViewWrapper = wrapper;
            return(draftView);
        }
Exemplo n.º 3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Gets the HVO of the writing system to use if this is a back translation view;
		/// otherwise -1.
		/// </summary>
		/// <param name="wrapper">The wrapper that is to host the view being created.</param>
		/// ------------------------------------------------------------------------------------
		protected int GetBtWs(ViewWrapper wrapper)
		{
			return (m_viewType & TeViewType.BackTranslation) == 0 ? -1 :
				m_mainWnd.GetBackTranslationWsForView(wrapper.Name);
		}
Exemplo n.º 4
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Gets the HVO of the writing system to use if this is a back translation view;
 /// otherwise -1.
 /// </summary>
 /// <param name="wrapper">The wrapper that is to host the view being created.</param>
 /// ------------------------------------------------------------------------------------
 protected int GetBtWs(ViewWrapper wrapper)
 {
     return((m_viewType & TeViewType.BackTranslation) == 0 ? -1 :
            m_mainWnd.GetBackTranslationWsForView(wrapper.Name));
 }
Exemplo n.º 5
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Creates the Back Translation Review 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 CreateBackTransConsultantCheckView(string viewName,
			TeViewType viewType, SBTabItemProperties tabItem)
		{
			TeScrDraftViewProxy topDraftView = new TeScrDraftViewProxy(this, "BTReviewDraftView",
				false, false, false, TeViewType.BackTranslationConsultantCheck);
			DraftStylebarProxy topStylebar = new DraftStylebarProxy(this, "BTReview", false);

			TeFootnoteDraftViewProxy footnoteDraftView = new TeFootnoteDraftViewProxy(this,
				"BTReviewFootnoteView", false, true);
			DraftStylebarProxy footnoteStylebar = new DraftStylebarProxy(this,
				"BTReviewFootnote", true);

			// Construct the one view wrapper (client window)
			ViewWrapper reviewWrap = new ViewWrapper(kBTReviewWrapperName, this, m_cache,
				StyleSheet, SettingsKey, topDraftView, topStylebar, footnoteDraftView,
				footnoteStylebar);
			((ISelectableView)reviewWrap).BaseInfoBarCaption = viewName;

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

			ClientControls.Add(reviewWrap);
			// Bring the draftView to the top of the z-order, so that
			// (if it is the active view) it fills only the remaining space
			reviewWrap.BringToFront();
			m_rgClientViews.Add(TeEditingHelper.ViewTypeString(TeViewType.BackTranslationConsultantCheck),
				reviewWrap);
			m_uncreatedViews.Remove(TeViewType.BackTranslationConsultantCheck);
			return reviewWrap;
		}
Exemplo n.º 6
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Creates the footnote view.
		/// </summary>
		/// <param name="createInfo">The create info.</param>
		/// <param name="wrapper">The wrapper.</param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		private Control CreateFootnoteView(object createInfo, ViewWrapper wrapper)
		{
			FootnoteCreateInfo fnInfo = (FootnoteCreateInfo)createInfo;
			FootnoteView footnoteView = new FootnoteView(m_cache, Handle.ToInt32(), wrapper.DraftView,
				fnInfo.IsBackTrans ? GetBackTranslationWsForView(wrapper.Name) : -1);
			footnoteView.Name = fnInfo.Name;
			footnoteView.LostFocus += ViewLostFocus;
			footnoteView.GotFocus += ViewGotFocus;
			footnoteView.Editable = fnInfo.IsEditable;
			return footnoteView;
		}
Exemplo n.º 7
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Creates the draft view.
		/// </summary>
		/// <param name="createInfo">The create info.</param>
		/// <param name="wrapper">The wrapper.</param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		public Control CreateDraftView(object createInfo, ViewWrapper wrapper)
		{
			DraftViewCreateInfo info = (DraftViewCreateInfo)createInfo;
			StVc.ContentTypes contentType = StVc.ContentTypes.kctNormal;
			if (info.IsBackTrans)
			{
				contentType = (Options.UseInterlinearBackTranslation ?
					StVc.ContentTypes.kctSegmentBT : StVc.ContentTypes.kctSimpleBT);
			}

			DraftView draftView = new DraftView(m_cache, contentType, info.ShowInTable,
					info.MakeRootAutomatically, info.PersistSettings, info.ViewType, Handle.ToInt32());
			draftView.Name = info.Name;
			draftView.AccessibleName = info.Name;
			draftView.Editable = info.IsEditable;
			draftView.LostFocus += ViewLostFocus;
			draftView.GotFocus += ViewGotFocus;
			draftView.TheViewWrapper = wrapper;
			return draftView;
		}