The main body of the chart, containing the actual view of the charted words.
Inheritance: SIL.FieldWorks.Common.RootSites.RootSite
		protected override void CreateTestData()
		{
			base.CreateTestData();
			m_logic = new TestCCLogic(Cache, m_chart, m_stText); // m_chart is still null!
			m_helper.Logic = m_logic;
			m_logic.Ribbon = new MockRibbon(Cache, m_stText.Hvo);
			m_helper.MakeTemplate(out m_allColumns);
			// Note: do this AFTER creating the template, which may also create the DiscourseData object.
			m_chart = m_helper.SetupAChart();

			m_constChart = new ConstituentChart(Cache, m_logic);
			m_constChart.Init(null, null);
			m_chartBody = m_constChart.Body;
			m_chartBody.Cache = Cache; // don't know why constructor doesn't do this, but it doesn't.

			m_chartBody.SetRoot(m_chart, m_allColumns.ToArray());
		}
		protected override void CreateTestData()
		{
			base.CreateTestData();
			m_firstParaWfics = m_helper.MakeAnnotations(m_firstPara);
			m_logic = new TestCCLogic(Cache, m_chart, m_stText.Hvo); // m_chart is still null!
			m_helper.Logic = m_logic;
			m_logic.Ribbon = m_mockRibbon = new MockRibbon(Cache, m_stText.Hvo);
			m_template = m_helper.MakeTemplate(out m_allColumns);
			// Note: do this AFTER creating the template, which may also create the DiscourseData object.
			m_chart = new DsConstChart();
			Cache.LangProject.DiscourseDataOA.ChartsOC.Add(m_chart);
			m_chart.TemplateRA = m_template;
			m_logic.Chart = m_chart;
			m_helper.MakeDefaultChartMarkers();
			m_helper.Chart = m_chart;

			m_constChart = new ConstituentChart(Cache, m_logic);
			m_constChart.Init(null, null);
			m_chartBody = m_constChart.Body;
			m_chartBody.Cache = Cache; // don't know why constructor doesn't do this, but it doesn't.
			m_chartBody.SetRoot(m_chart.Hvo, m_allColumns.ToArray());
		}
Example #3
0
		private void BuildTopStuffUI()
		{
			m_body = new ConstChartBody(m_logic, this) { Cache = m_cache, Dock = DockStyle.Fill };

			// Seems to be right (cf BrowseViewer) but not ideal.
			m_headerMainCols = new ChartHeaderView(this) { Dock = DockStyle.Top,
				View = View.Details, Height = 22, Scrollable = false,
				AllowColumnReorder = false };
			m_headerMainCols.Layout += m_headerMainCols_Layout;
			m_headerMainCols.SizeChanged += m_headerMainCols_SizeChanged;

			m_topStuff = new Panel { Dock = DockStyle.Fill };
			m_topStuff.Controls.AddRange(new Control[] { m_body, m_headerMainCols });
		}
Example #4
0
		/// <summary>
		/// Make one. This variant is used in testing (to plug in a known logic class).
		/// </summary>
		internal ConstituentChart(FdoCache cache, ConstituentChartLogic logic)
		{
			m_cache = cache;
			m_logic = logic;
			this.SuspendLayout();
			m_ribbon = new InterlinRibbon(m_cache, 0);
			m_ribbon.Dock = DockStyle.Fill; // fills the 'bottom stuff'
			m_logic.Ribbon = m_ribbon as IInterlinRibbon;
			m_toolTip = new ToolTip(); // Holds tooltip help for 'Move Here' buttons.
			// Set up the delays for the ToolTip.
			m_toolTip.AutoPopDelay = 5000;
			m_toolTip.InitialDelay = 1000;
			m_toolTip.ReshowDelay = 500;
			// Force the ToolTip text to be displayed whether or not the form is active.
			m_toolTip.ShowAlways = true;

			m_bottomStuff = new Panel();
			m_bottomStuff.SuspendLayout();
			m_bottomStuff.Height = 100; // Enhance: figure based on contents or at least number of rows.
			m_bottomStuff.Dock = DockStyle.Bottom;

			m_buttonRow = new Panel();
			m_buttonRow.Height = new Button().Height; // grab the default height of a button; don't insert any yet.
			m_buttonRow.Dock = DockStyle.Top;
			m_buttonRow.Layout += new LayoutEventHandler(m_buttonRow_Layout);

			m_bottomStuff.Controls.AddRange(new Control[] { m_ribbon, m_buttonRow });
			m_fContextMenuButtonsEnabled = true;
			m_bottomStuff.ResumeLayout();

			m_body = new ConstChartBody(m_logic, this);
			m_body.Cache = m_cache;
			m_body.Dock = DockStyle.Fill;

			//m_headerGroups = new ChartHeaderView();
			m_headerMainCols = new ChartHeaderView(this);
			m_headerMainCols.Dock = DockStyle.Top;
			m_headerMainCols.Layout += new LayoutEventHandler(m_headerMainCols_Layout);
			m_headerMainCols.SizeChanged += new EventHandler(m_headerMainCols_SizeChanged);
			m_headerMainCols.View = System.Windows.Forms.View.Details;
			m_headerMainCols.Height = 22; // Seems to be right (cf BrowseViewer) but not ideal.
			m_headerMainCols.Scrollable = false;
			m_headerMainCols.AllowColumnReorder = false;
			m_headerMainCols.ColumnWidthChanged += new ColumnWidthChangedEventHandler(m_headerMainCols_ColumnWidthChanged);
			//m_headerGroups.Layout += new LayoutEventHandler(m_headerGroups_Layout);

			m_logic.Ribbon_Changed += new EventHandler(m_logic_Ribbon_Changed);

			m_topStuff = new Panel();
			m_topStuff.Dock = DockStyle.Fill;
			m_topStuff.Controls.AddRange(new Control[] { m_body, m_headerMainCols /*, m_headerGroups */});

			this.Controls.AddRange(new Control[] { m_topStuff, m_bottomStuff });

			this.ResumeLayout();
		}
Example #5
0
		public ConstChartVc(ConstChartBody chart)
			: base(chart.Cache)
		{
			m_chart = chart;
			m_cache = m_chart.Cache;
			m_tssSpace = m_cache.MakeAnalysisTss(" ");
			LoadFormatProps();
		}
Example #6
0
		/// <summary>
		/// Make one.
		/// </summary>
		/// <param name="baseObj"></param>
		/// <param name="cache"></param>
		/// <param name="vwenv"></param>
		/// <param name="hvo"></param>
		public MakeCellsMethod(ConstChartVc baseObj, FdoCache cache, IVwEnv vwenv, int hvo)
		{
			m_this = baseObj;
			m_cache = cache;
			m_vwenv = vwenv;
			m_hvoRow = hvo;
			m_chart = baseObj.m_chart;
		}
Example #7
0
		public ConstChartVc(ConstChartBody chart)
			: base(chart.Cache)
		{
			m_chart = chart;
			m_cache = m_chart.Cache;
			m_tssFact = m_cache.TsStrFactory;
			m_tssSpace = m_tssFact.MakeString(" ", m_cache.DefaultAnalWs);
			m_rowRepo = m_cache.ServiceLocator.GetInstance<IConstChartRowRepository>();
			m_wordGrpRepo = m_cache.ServiceLocator.GetInstance<IConstChartWordGroupRepository>();
			m_partRepo = m_cache.ServiceLocator.GetInstance<IConstituentChartCellPartRepository>();
			m_sMovedTextBefore = m_tssFact.MakeString(DiscourseStrings.ksMovedTextBefore,
													m_cache.DefaultUserWs);
			m_sMovedTextAfter = m_tssFact.MakeString(DiscourseStrings.ksMovedTextAfter,
													m_cache.DefaultUserWs);
			LoadFormatProps();
		}
Example #8
0
		/// <summary>
		/// Make one.
		/// </summary>
		/// <param name="baseObj"></param>
		/// <param name="cache"></param>
		/// <param name="vwenv"></param>
		/// <param name="hvo"></param>
		public MakeCellsMethod(ConstChartVc baseObj, FdoCache cache, IVwEnv vwenv, int hvo)
		{
			m_this = baseObj;
			m_cache = cache;
			m_rowRepo = m_cache.ServiceLocator.GetInstance<IConstChartRowRepository>();
			m_partRepo = m_cache.ServiceLocator.GetInstance<IConstituentChartCellPartRepository>();

			// Decorator makes sure that things get put out in the right order if chart is RtL
			m_chart = baseObj.m_chart;
			//var sPopFormatting = m_cache.TsStrFactory.MakeString(Convert.ToString(m_chart.PDF), m_cache.DefaultAnalWs);
			m_vwenv = new ChartRowEnvDecorator(vwenv);

			m_hvoRow = hvo;
			m_row = m_rowRepo.GetObject(m_hvoRow);
		}