public LogGraphPage AddPage(string title, bool markAsChanged, bool readOnly, bool addPane) { LogGraphPage tab = new LogGraphPage(m_ModuleManager, readOnly, addPane); if (string.IsNullOrEmpty(title)) { tab.Text = GenerateName("Page"); } else { tab.Text = title; } tab.ItemDatabase = m_Database; m_TabControl.TabPages.Add(tab); m_TabControl.SelectedTab = tab; if (markAsChanged) { m_HasChanged = true; } tab.OnSelectedPaneChanged += new EventHandler(OnSelectedPaneChanged); tab.OnSelectedCurveItemChanged += new EventHandler(OnSelectedCurveItemChanged); return(tab); }
public LogGraphControl() { InitializeComponent(); m_AddPageButton = new ToolStripButton("", LogStudio.Graph.Properties.Resources.AddPage, new EventHandler(m_MenuAddTab_Click)); m_AddPageButton.ImageScaling = ToolStripItemImageScaling.None; m_AddPageButton.ToolTipText = LogStudio.Graph.Properties.Resources.RES_ToolTipAddPage; m_RemovePageButton = new ToolStripButton("", LogStudio.Graph.Properties.Resources.RemovePage, new EventHandler(m_MenuRemovePage_Click)); m_RemovePageButton.ImageScaling = ToolStripItemImageScaling.None; m_RemovePageButton.ToolTipText = LogStudio.Graph.Properties.Resources.RES_ToolTipRemovePage; m_AddPaneButton = new ToolStripButton("", LogStudio.Graph.Properties.Resources.AddGraph, new EventHandler(m_MenuAddPane_Click)); m_AddPaneButton.ImageScaling = ToolStripItemImageScaling.None; m_AddPaneButton.ToolTipText = LogStudio.Graph.Properties.Resources.RES_ToolTipAddGraph; m_RemovePaneButton = new ToolStripButton("", LogStudio.Graph.Properties.Resources.RemoveGraph, new EventHandler(m_MenuRemovePane_Click)); m_RemovePaneButton.ImageScaling = ToolStripItemImageScaling.None; m_RemovePaneButton.ToolTipText = LogStudio.Graph.Properties.Resources.RES_ToolTipRemoveGraph; m_PageName = new ToolStripTextBox(); m_PageName.Leave += new EventHandler(OnPageNameLeave); m_PageName.KeyDown += new KeyEventHandler(OnPageNameKeyDown); m_AddPaneButton.Enabled = false; m_RemovePageButton.Enabled = false; m_RemovePaneButton.Enabled = false; m_TabControl.SelectedIndex = -1; LogGraphPage page = AddPage(GenerateName("Page"), false, false, true); m_TabControl.VisibleChanged += (s, e) => { if (m_TabControl.Visible && m_TabControl.SelectedTab is LogGraphPage pageTab) { if (pageTab.ItemDatabase != m_Database) { pageTab.ItemDatabase = m_Database; } } }; m_TabControl.Selected += (s, e) => { if (m_TabControl.Visible && m_TabControl.SelectedTab is LogGraphPage pageTab) { if (pageTab.ItemDatabase != m_Database) { pageTab.ItemDatabase = m_Database; } } }; }
public void RemovePage(LogGraphPage page) { if (page != null) { page.ClearAllGraphs(); page.OnSelectedPaneChanged -= new EventHandler(OnSelectedPaneChanged); page.OnSelectedCurveItemChanged -= new EventHandler(OnSelectedCurveItemChanged); m_TabControl.TabPages.Remove(page); m_HasChanged = true; } }
public LogGraphPane(LogGraphPage parent, IModuleManager manager) { m_Parent = parent; m_Manager = manager; CheckedItems = new BindingListEx <string>(); CheckedItems.ListChanged += new ListChangedEventHandler(OnCheckedItemsChanged); Title.IsVisible = false; base.XAxis.Type = AxisType.Date; base.XAxis.Title.Text = "Time"; base.XAxis.Scale.FontSpec.Family = "Verdana"; base.XAxis.Scale.FontSpec.Size = 10; // base.XAxis.Grid = true; base.XAxis.Title.FontSpec.Family = "Verdana"; base.XAxis.Title.FontSpec.Size = 12; base.XAxis.Title.FontSpec.IsBold = false; base.Legend.FontSpec.Family = "Verdana"; base.Legend.FontSpec.Size = 10; base.YAxis.Title.Text = "Value"; base.YAxis.Scale.FontSpec.Family = "Verdana"; base.YAxis.Scale.FontSpec.Size = 10; base.YAxis.Title.FontSpec.Family = "Verdana"; base.YAxis.Title.FontSpec.Size = 12; base.YAxis.Title.FontSpec.IsBold = false; //base.YAxis.IsShowGrid = true; base.Y2Axis.Title.Text = "Value"; base.Y2Axis.IsVisible = false; base.Y2Axis.Title.FontSpec.Family = "Verdana"; base.Y2Axis.Title.FontSpec.Size = 12; base.Y2Axis.Title.FontSpec.IsBold = false; base.Y2Axis.Scale.FontSpec.Family = "Verdana"; base.Y2Axis.Scale.FontSpec.Size = 10; //base.Y2Axis.StepAuto = true; //base.Y2Axis.ScaleFormatAuto = true; //base.Y2Axis.ScaleMagAuto = true; base.IsFontsScaled = false; AxisChange(); }
public LogGraphTabEventArgs(LogGraphPage tab) { Tab = tab; }