The 'Sandbox' is a small view used to edit the data associated with a single Wordform... specifically, the data associated with a standard interlinear view. It uses a different, simpler model than the real interlinear view, documented below under the constants we use to describe it. This view makes editing easier. A further advantage is that we don't have to worry, until the view closes, about whether the user is editing one of the existing analyses or creating a new one.
Inheritance: SandboxBase, IAnalysisControlInternal
		public FocusBoxController(Sandbox sandbox) : this()
		{
			if (sandbox != null)
			{
				this.InterlinWordControl = sandbox;
			}
		}
Exemple #2
0
 /// <summary>
 /// NOTE: currently needs to get called after sandbox.MakeRoot, since that's when RightToLeftWritingSystem is valid.
 /// </summary>
 /// <param name="sandbox"></param>
 private void AdjustControlsForRightToLeftWritingSystem(Sandbox sandbox)
 {
     if (sandbox.RightToLeftWritingSystem && btnConfirmChanges.Location.X != 0)
     {
         panelSandbox.Anchor = AnchorStyles.Right | AnchorStyles.Top;
         // make buttons RightToLeft oriented.
         btnConfirmChanges.Anchor               = AnchorStyles.Left;
         btnConfirmChanges.Location             = new Point(0, btnConfirmChanges.Location.Y);
         btnConfirmChangesForWholeText.Anchor   = AnchorStyles.Left;
         btnConfirmChangesForWholeText.Location =
             new Point(btnConfirmChanges.Width, btnConfirmChangesForWholeText.Location.Y);
         btnUndoChanges.Anchor   = AnchorStyles.Left;
         btnUndoChanges.Location = new Point(
             btnConfirmChanges.Width + btnConfirmChangesForWholeText.Width, btnUndoChanges.Location.Y);
         btnMenu.Anchor   = AnchorStyles.Right;
         btnMenu.Location = new Point(panelControlBar.Width - btnMenu.Width, btnMenu.Location.Y);
     }
 }
Exemple #3
0
        internal virtual IAnalysisControlInternal CreateNewSandbox(AnalysisOccurrence selected)
        {
            Sandbox sandbox = new Sandbox(selected.Analysis.Cache, m_mediator, m_propertyTable, m_stylesheet,
                                          m_lineChoices, selected, this);

            sandbox.SizeToContent = true;             // Layout will ignore size.
            //sandbox.Mediator = Mediator;
            sandbox.ShowMorphBundles = true;
            sandbox.StyleSheet       = m_stylesheet;
            panelSandbox.Controls.Add(sandbox);             // Makes it real and may give it a root box.
            // Note: adding sandbox to Controls doesn't always MakeRoot(), because OnHandleCreated happens
            // only when the parent control is Visible.
            if (sandbox.RootBox == null)
            {
                sandbox.MakeRoot();
            }
            AdjustControlsForRightToLeftWritingSystem(sandbox);
            // this is needed for the Undo button.
            sandbox.SandboxChangedEvent += m_sandbox_SandboxChangedEvent;
            return(sandbox as IAnalysisControlInternal);
        }
		/// <summary>
		/// NOTE: currently needs to get called after sandbox.MakeRoot, since that's when RightToLeftWritingSystem is valid.
		/// </summary>
		/// <param name="sandbox"></param>
		private void AdjustControlsForRightToLeftWritingSystem(Sandbox sandbox)
		{
			if (sandbox.RightToLeftWritingSystem && btnConfirmChanges.Location.X != 0)
			{
				panelSandbox.Anchor = AnchorStyles.Right | AnchorStyles.Top;
				// make buttons RightToLeft oriented.
				btnConfirmChanges.Anchor = AnchorStyles.Left;
				btnConfirmChanges.Location = new Point(0, btnConfirmChanges.Location.Y);
				btnConfirmChangesForWholeText.Anchor = AnchorStyles.Left;
				btnConfirmChangesForWholeText.Location =
					new Point(btnConfirmChanges.Width, btnConfirmChangesForWholeText.Location.Y);
				btnUndoChanges.Anchor = AnchorStyles.Left;
				btnUndoChanges.Location = new Point(
					btnConfirmChanges.Width + btnConfirmChangesForWholeText.Width, btnUndoChanges.Location.Y);
				btnMenu.Anchor = AnchorStyles.Right;
				btnMenu.Location = new Point(panelControlBar.Width - btnMenu.Width, btnMenu.Location.Y);
			}
		}
		internal virtual IAnalysisControlInternal CreateNewSandbox(AnalysisOccurrence selected)
		{
			Sandbox sandbox = new Sandbox(selected.Analysis.Cache, m_mediator, m_stylesheet,
				m_lineChoices, selected, this);
			sandbox.SizeToContent = true; // Layout will ignore size.
			//sandbox.Mediator = Mediator;
			sandbox.ShowMorphBundles = true;
			sandbox.StyleSheet = m_stylesheet;
			panelSandbox.Controls.Add(sandbox); // Makes it real and may give it a root box.
			// Note: adding sandbox to Controls doesn't always MakeRoot(), because OnHandleCreated happens
			// only when the parent control is Visible.
			if (sandbox.RootBox == null)
				sandbox.MakeRoot();
			AdjustControlsForRightToLeftWritingSystem(sandbox);
			// this is needed for the Undo button.
			sandbox.SandboxChangedEvent += m_sandbox_SandboxChangedEvent;
			return sandbox as IAnalysisControlInternal;
		}
Exemple #6
0
		private Sandbox CreateNewSandbox(int hvoNewAnnotation, int hvoNewAnalysis)
		{
			Sandbox sandbox = new Sandbox(this.Cache, this.Mediator, this.StyleSheet,
				m_vc.LineChoices, hvoNewAnnotation, this);
			sandbox.SizeToContent = true; // Layout will ignore size.
			//sandbox.Mediator = Mediator;
			sandbox.ShowMorphBundles = m_vc.ShowMorphBundles;
			sandbox.StyleSheet = this.StyleSheet;
			sandbox.Visible = false;
			return sandbox;
		}
Exemple #7
0
		private void ChangeSandboxRoot(Sandbox sandbox, int hvoNewAnnotation, int hvoNewAnalysis)
		{
			sandbox.Visible = false;
			sandbox.SwitchWord(hvoNewAnnotation, true);
		}