Example #1
0
			/// ------------------------------------------------------------------------------------
			/// <summary>
			/// Initializes a new instance of the <see cref="LocationTrackerImpl"/> class.
			/// </summary>
			/// <param name="vDraft"></param>
			/// <param name="cache">The cache.</param>
			/// <param name="filterInstance">The filter instance.</param>
			/// ------------------------------------------------------------------------------------
			public VerticalDraftViewLocationTracker(VerticalDraftView vDraft, FdoCache cache,
				int filterInstance) : base(cache, filterInstance)
			{
				m_vDraft = vDraft;
			}
Example #2
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="LocationTrackerImpl"/> class.
 /// </summary>
 /// <param name="vDraft"></param>
 /// <param name="cache">The cache.</param>
 /// <param name="filterInstance">The filter instance.</param>
 /// ------------------------------------------------------------------------------------
 public VerticalDraftViewLocationTracker(VerticalDraftView vDraft, FdoCache cache,
                                         int filterInstance) : base(cache, filterInstance)
 {
     m_vDraft = vDraft;
 }
Example #3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Creates the Scripture/Vertical View.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		protected ISelectableView CreateVerticalView(string viewName, TeViewType viewType,
			SBTabItemProperties tabItem)
		{
			// Current view cannot handle an empty project, so the quick fix is to not put up the
			// view at all for an empty project. User will need to add a book and then re-open TE.
			// Since this is only for testing now, this seems like the safest/easiest fix.
			//
			// This will not prevent crashes if the last book is deleted. There are also other ways
			// you can probably crash the view - delete the section that the view is showing.
			if (Cache.LangProject.TranslatedScriptureOA.ScriptureBooksOS.Count == 0)
				return null;

			// Create a draft view (adapted from CreateDraftContainer).
			DraftView vDraft = new VerticalDraftView(m_cache, m_app, m_app, false, Handle.ToInt32());
			// Although the constructor sets this, setting it with the setter (bizarrely) does extra stuff which for the
			// moment we need. When we refine VerticalDraftView so it doesn't use laziness, we can remove this, since
			// it won't need the paragraph counter which the Cache setter creates.
			vDraft.Cache = m_cache;
			vDraft.StyleSheet = m_StyleSheet;
			vDraft.MakeRoot();
			vDraft.Editable = true;

			vDraft.Anchor = AnchorStyles.Top | AnchorStyles.Left |
				AnchorStyles.Right | AnchorStyles.Bottom;
			vDraft.Dock = DockStyle.Fill;
			((ISelectableView)vDraft).BaseInfoBarCaption = "VEdit";

			// This is done in the constructors of many of our other views, and it is essential that a
			// main client window be not visible, otherwise, it appears initially even if not meant to
			// be selected (at least, the last one created and brought to the front appears). Only one
			// client control is supposed to be visible.
			// I thought it better to put it here because the VerticalDraftView is parallel in function
			// to a regular DraftView, and if there are other clients, they may not want it be initially
			// invisible; unlike other classes used as client windows, this one is not necessarily
			// intended to be used ONLY as a direct client window of the main window. So I put setting
			// the visibility here.
			vDraft.Visible = false;

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

			ClientControls.Add(vDraft);
			// Bring the draftView to the top of the z-order, so that
			// (if it is the active view) it fills only the remaining space (Review JohnT: is this needed here? Copied from DraftView)
			vDraft.BringToFront();
			m_rgClientViews.Add(TeEditingHelper.ViewTypeString(TeViewType.VerticalView), vDraft);
			m_uncreatedViews.Remove(TeViewType.VerticalView);
			return vDraft;
		}