/// ------------------------------------------------------------------------------------
        /// <summary>
        /// Makes the selection in in the Scripture reference of the specified annotation.
        /// </summary>
        /// <param name="vc">The vc.</param>
        /// <param name="bookIndex">Index of the book.</param>
        /// <param name="iAnnotation">Index of the annotation.</param>
        /// <param name="notesDataEntryView">The notes data entry view.</param>
        /// ------------------------------------------------------------------------------------
        internal void MakeSelectionInNoteRef(TeNotesVc vc, int bookIndex, int iAnnotation,
                                             NotesDataEntryView notesDataEntryView)
        {
            EnsureNoteIsVisible(vc, bookIndex, iAnnotation, notesDataEntryView);

            SelectionHelper selHelper = new SelectionHelper();

            selHelper.NumberOfLevels             = 2;
            selHelper.LevelInfo[0].cpropPrevious = 0;
            selHelper.LevelInfo[0].ich           = -1;
            selHelper.LevelInfo[0].ihvo          = iAnnotation;
            selHelper.LevelInfo[0].tag           = ScrBookAnnotationsTags.kflidNotes;
            selHelper.LevelInfo[0].ws            = 0;
            selHelper.LevelInfo[1].cpropPrevious = 0;
            selHelper.LevelInfo[1].ich           = -1;
            selHelper.LevelInfo[1].ihvo          = bookIndex;
            selHelper.LevelInfo[1].tag           = ScriptureTags.kflidBookAnnotations;
            selHelper.LevelInfo[1].ws            = 0;
            selHelper.IchAnchor  = 0;
            selHelper.AssocPrev  = false;
            selHelper.TextPropId = -2;
            selHelper.SetTextPropId(SelectionHelper.SelLimitType.Anchor,
                                    CmBaseAnnotationTags.kflidBeginRef);

            selHelper.SetSelection(notesDataEntryView, true, true, VwScrollSelOpts.kssoDefault);
        }
예제 #2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Adds the Notes Data Entry View
		/// </summary>
		/// ------------------------------------------------------------------------------------
		protected virtual void AddNotesView(string viewName, int wsUser)
		{
			m_dataEntryView = new NotesDataEntryView(Cache, m_app, viewName, this);
			m_dataEntryView.Zoom = m_zoomPercent;
			m_dataEntryView.StyleSheet = m_StyleSheet;
			m_dataEntryView.Dock = DockStyle.Fill;
			m_dataEntryView.FilterChanged += NoteFilterChanged;

			// Add this user view to the sidebar tab.
			SBTabItemProperties itemProps = new SBTabItemProperties(this);
			itemProps.Name = viewName;
			itemProps.Text = viewName;
			itemProps.ImageIndex = (int)TeResourceHelper.SideBarIndices.DataEntry;
			itemProps.Tag = m_dataEntryView;
			itemProps.Message = "SwitchActiveView";
			AddSideBarTabItem(kViewsSBTabInternalName, itemProps);

			ClientControls.Add(m_dataEntryView);
			// Bring the draftView to the top of the z-order, so that
			// (if it is the active view) it fills only the remaining space
			m_dataEntryView.BringToFront();
			m_rgClientViews.Add(m_dataEntryView.GetType().Name, m_dataEntryView);
		}
예제 #3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Makes the selection in in the Scripture reference of the specified annotation.
		/// </summary>
		/// <param name="vc">The vc.</param>
		/// <param name="bookIndex">Index of the book.</param>
		/// <param name="iAnnotation">Index of the annotation.</param>
		/// <param name="notesDataEntryView">The notes data entry view.</param>
		/// ------------------------------------------------------------------------------------
		internal void MakeSelectionInNoteRef(TeNotesVc vc, int bookIndex, int iAnnotation,
			NotesDataEntryView notesDataEntryView)
		{
			EnsureNoteIsVisible(vc, bookIndex, iAnnotation, notesDataEntryView);

			SelectionHelper selHelper = new SelectionHelper();
			selHelper.NumberOfLevels = 2;
			selHelper.LevelInfo[0].cpropPrevious = 0;
			selHelper.LevelInfo[0].ich = -1;
			selHelper.LevelInfo[0].ihvo = iAnnotation;
			selHelper.LevelInfo[0].tag = vc.NotesSequenceHandler.Tag;
			selHelper.LevelInfo[0].ws = 0;
			selHelper.LevelInfo[1].cpropPrevious = 0;
			selHelper.LevelInfo[1].ich = -1;
			selHelper.LevelInfo[1].ihvo = bookIndex;
			selHelper.LevelInfo[1].tag = (int)Scripture.ScriptureTags.kflidBookAnnotations;
			selHelper.LevelInfo[1].ws = 0;
			selHelper.IchAnchor = 0;
			selHelper.AssocPrev = false;
			selHelper.SetTextPropId(SelectionHelper.SelLimitType.Anchor,
				(int)CmBaseAnnotation.CmBaseAnnotationTags.kflidBeginRef);

			selHelper.SetSelection(notesDataEntryView, true, true, VwScrollSelOpts.kssoDefault);
		}
예제 #4
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Adds the Notes Data Entry View
		/// </summary>
		/// <param name="userView"></param>
		/// <param name="wsUser"></param>
		/// ------------------------------------------------------------------------------------
		protected virtual void AddNotesView(UserView userView, int wsUser)
		{
			if (userView.RecordsOC.Count == 0)
			{
				// Scripture is displayed by showing its BookAnnotations (which are ScrBookAnnotations).
				UserViewRec rec = new UserViewRec();
				userView.RecordsOC.Add(rec);
				rec.Clsid = Scripture.kClassId;

				UserViewField field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)Scripture.ScriptureTags.kflidBookAnnotations;

				// Each ScrBookAnnotations record is displayed by showing its Notes (which are ScrScriptureNotes).
				rec = new UserViewRec();
				userView.RecordsOC.Add(rec);
				rec.Clsid = ScrBookAnnotations.kClassId;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrBookAnnotations.ScrBookAnnotationsTags.kflidNotes;

				// Each ScrScriptureNote record is displayed by showing its status, references, categories, etc.
				rec = new UserViewRec();
				userView.RecordsOC.Add(rec);
				rec.Clsid = ScrScriptureNote.kClassId;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrScriptureNote.ScrScriptureNoteTags.kflidResolutionStatus;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)CmBaseAnnotation.CmBaseAnnotationTags.kflidBeginRef;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)CmBaseAnnotation.CmBaseAnnotationTags.kflidEndRef;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrScriptureNote.ScrScriptureNoteTags.kflidCategories;
				field.PossListRAHvo = m_scr.NoteCategoriesOAHvo;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrScriptureNote.ScrScriptureNoteTags.kflidRecommendation;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrScriptureNote.ScrScriptureNoteTags.kflidResolution;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrScriptureNote.ScrScriptureNoteTags.kflidDiscussion;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrScriptureNote.ScrScriptureNoteTags.kflidResponses;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrScriptureNote.ScrScriptureNoteTags.kflidQuote;

// TODO: There will be a date created and modified for each of the previous five fields.
// We need to determine how they will be differntiated.
				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)StJournalText.StJournalTextTags.kflidDateCreated;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)StJournalText.StJournalTextTags.kflidDateModified;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)CmAnnotation.CmAnnotationTags.kflidSource;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)CmAnnotation.CmAnnotationTags.kflidAnnotationType;
				field.PossListRAHvo = m_cache.LangProject.AnnotationDefsOAHvo;
			}

			m_dataEntryView = new NotesDataEntryView(m_cache, userView, this);
			m_dataEntryView.Zoom = m_zoomPercent;
			m_dataEntryView.StyleSheet = m_StyleSheet;
			m_dataEntryView.Dock = DockStyle.Fill;
			m_dataEntryView.FilterChanged += NoteFilterChanged;

			// Add this user view to the sidebar tab.
			SBTabItemProperties itemProps = new SBTabItemProperties(this);
			string name = string.IsNullOrEmpty(userView.ViewNameShort) ?
			TeResourceHelper.GetResourceString("kstidNotes") : userView.ViewNameShort;
			itemProps.Name = name;
			itemProps.Text = name;
			itemProps.ImageIndex = (int)TeResourceHelper.SideBarIndices.DataEntry;
			itemProps.Tag = m_dataEntryView;
			itemProps.Message = "SwitchActiveView";
			AddSideBarTabItem(kViewsSBTabInternalName, itemProps);

			ClientControls.Add(m_dataEntryView);
			// Bring the draftView to the top of the z-order, so that
			// (if it is the active view) it fills only the remaining space
			m_dataEntryView.BringToFront();
			ClientWindows.Add(m_dataEntryView.GetType().Name, m_dataEntryView);
		}