private void showAxisInformationToolStripMenuItem_Click(object sender, EventArgs e) { string symbolname = string.Empty; if (gridViewSymbols.SelectedRowsCount > 0) { int[] selrows = gridViewSymbols.GetSelectedRows(); if (selrows.Length > 0) { Trionic5Tools.SymbolHelper dr = (Trionic5Tools.SymbolHelper)gridViewSymbols.GetRow((int)selrows.GetValue(0)); if (dr.Varname != "") { symbolname = dr.Varname; } } } DevExpress.XtraBars.Docking.DockPanel dockPanel = dockManager1.AddPanel(new System.Drawing.Point(-500, -500)); AxisBrowser tabdet = new AxisBrowser(); //tabdet.TheMainForm = this; tabdet.onStartSymbolViewer += new AxisBrowser.StartSymbolViewer(tabdet_onStartSymbolViewer); tabdet.Dock = DockStyle.Fill; dockPanel.Controls.Add(tabdet); tabdet.ShowSymbolCollection(m_trionicFileInformation.SymbolCollection); tabdet.SetCurrentSymbol(symbolname); dockPanel.Text = "Axis browser: " + Path.GetFileName(m_trionicFileInformation.Filename); bool isDocked = false; foreach (DevExpress.XtraBars.Docking.DockPanel pnl in dockManager1.Panels) { if (pnl.Text.StartsWith("Axis browser: ") && pnl != dockPanel && (pnl.Visibility == DevExpress.XtraBars.Docking.DockVisibility.Visible)) { dockPanel.DockAsTab(pnl, 0); isDocked = true; break; } } if (!isDocked) { dockPanel.DockTo(dockManager1, DevExpress.XtraBars.Docking.DockingStyle.Left, 1); dockPanel.Width = 700; } }
void tabdet_onStartSymbolViewer(object sender, AxisBrowser.SymbolViewerRequestedEventArgs e) { StartTableViewer(e.Mapname); }