RawTextPane displays an StText using the standard VC, except that if it is empty altogether, we display a message. (Eventually.)
Inheritance: SIL.FieldWorks.Common.RootSites.RootSite, IInterlinearTabControl, IHandleBookmark
Exemplo n.º 1
0
 internal AnnotationMoveHelper(RawTextPane site, KeyPressEventArgs e)
     : base(site.Clerk)
 {
     m_rootSite = site;
     if (!CanEdit())
     {
         return;
     }
     SkipShowRecord = true;
 }
Exemplo n.º 2
0
        /// <summary>
        /// overriden to handle the special case where user hits ENTER in a paragraph.
        /// </summary>
        /// <param name="e"></param>
        /// <param name="modifiers"></param>
        /// <param name="graphics"></param>
        public override void OnKeyPress(KeyPressEventArgs e, Keys modifiers, IVwGraphics graphics)
        {
            RawTextPane rtp = Callbacks as RawTextPane;

            if (rtp == null)
            {
                return;
            }
            try
            {
                using (m_amh = new RawTextPane.AnnotationMoveHelper(rtp, e))
                {
                    if (m_amh.CanEdit())
                    {
                        m_annotationAdjuster.StartKeyPressed(e, modifiers);
                    }
                    base.OnKeyPress(e, modifiers, graphics);
                    // in general we don't want to reload the primary clerk
                    // while we are editing, since that can be expensive.
                    if (rtp.Clerk != null && rtp.Clerk.IsPrimaryClerk)
                    {
                        m_amh.TriggerPendingReloadOnDispose = false;
                        // in some cases we may also want to do Clerk.RemoveInvalidItems()
                        // to help prevent the user from crashing when they click on it.
                    }
                    if (m_amh.CanEdit())
                    {
                        m_annotationAdjuster.EndKeyPressed();
                    }
                }
            }
            finally
            {
                m_amh = null;
            }
        }
Exemplo n.º 3
0
			internal AnnotationMoveHelper(RawTextPane site, KeyPressEventArgs e)
				: base(site.Clerk)
			{
				m_rootSite = site;
				if (!CanEdit())
					return;
				SkipShowRecord = true;
			}
Exemplo n.º 4
0
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			//Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
			// Must not be run more than once.
			if (IsDisposed)
				return;

			if( disposing )
			{
				SuspendLayout();	// don't want do trigger OnLayout() when removing controls!
				DestroyTitleContentsPane();
				if (m_tabCtrl != null)
					m_tabCtrl.SelectedIndexChanged -= new System.EventHandler( m_tabCtrl_SelectedIndexChanged);
				DisposeInterlinDocPanes();
				DisposeIfParentNull(m_panelInterlin);
				DisposeIfParentNull(m_rtPane);
				DisposeIfParentNull(m_infoPane);

				if(components != null)
				{
					components.Dispose();
				}
				// LT-5702
				// The Find / Replace dlg can currently only exist in this view, so
				// remove it when the view changes.  This will have to be expanded
				// when the dlg can search and operate on more than one view in Flex
				// as it does in TE.
				if (FwApp.App != null)
					FwApp.App.RemoveFindReplaceDialog();
			}

			m_tcPane = null;
			m_infoPane = null;
			m_rtPane = null;
			m_constChartPane = null;
			ClearInterlinDocPaneVariables();
			m_panelInterlin = null;
			m_panelTagging = null;
			m_panelPrintView = null;
			m_bookmark = null;

			base.Dispose( disposing );
		}
Exemplo n.º 5
0
		private void MakeRawTextPane()
		{
			//
			//  Finish defining m_tpRawText.
			//
			m_rtPane = new RawTextPane();
			m_rtPane.Name = "m_rtPane";
			m_rtPane.StyleSheet = m_styleSheet;
			m_rtPane.Dock = DockStyle.Fill;
			m_rtPane.Cache = Cache;
			m_rtPane.Init(m_mediator, m_configurationParameters);
			bool fEditable = XmlUtils.GetOptionalBooleanAttributeValue(m_configurationParameters, "editable", true);
			if (!fEditable)
				m_tpRawText.ToolTipText = String.Format(ITextStrings.ksBaseLineNotEditable);
			m_rtPane.SetRoot(m_hvoStText);
		}
Exemplo n.º 6
0
		private void ValidateExpectedPlaceInText(int indexWordBeforeEdit, int ichExpected, int hvoWordBeforeEdit, InterlinMasterHelper imh, RawTextPane rtp, IStText stTextBeforeEdit, TextSelInfo tsiBeforeEdit)
		{
			IStText stTextAfterEdit = rtp.RootObject;
			TextSelInfo tsiAfterEdit = imh.CurrentSelectionInfo;
			Assert.AreEqual(stTextBeforeEdit, stTextAfterEdit, "We expect to be in the same text.");
			// make sure we're in the same text
			Assert.AreEqual(tsiBeforeEdit.HvoAnchor, tsiAfterEdit.HvoAnchor, "We expect to be in the same paragraph");
			// make sure the cursor is in the expected location
			Assert.AreEqual(ichExpected, tsiAfterEdit.IchAnchor, "Expected cursor somewhere else.");
			// Make sure we haven't changed word in the wordform record list.
			int indexWordAfterEdit = m_wordList.CurrentIndex;
			int hvoWordAfterEdit = m_wordList.CurrentObject.Hvo;
			Assert.AreEqual(indexWordBeforeEdit, indexWordAfterEdit, "word index shouldn't have changed");
			Assert.AreEqual(hvoWordBeforeEdit, hvoWordAfterEdit, "word hvo shouldn't have changed");
		}