public void Add(DockablePanel panel) { if (panel == null) throw new ArgumentNullException("panel"); NSTabView tabControl; if (panel.Dock == DockStyle.Left || panel.Dock == DockStyle.Top) { tabControl = TabControl1; } else { tabControl = TabControl2; } if (tabControl == null) return; var tabPage = new NSTabViewItem(); tabPage.View = ((NSView)panel.InnerControl); tabPage.Identifier = NSObject.FromObject(panel.Key); tabPage.Label = panel.Caption; //tabPage.d += TabPageOnVisibleChanged; _allTabs.Add(panel.Key, tabPage); tabControl.Add(tabPage); OnPanelAdded(new DockablePanelEventArgs(panel.Key)); OnActivePanelChanged(new DockablePanelEventArgs(panel.Key)); }
public void Add(DockablePanel panel) { if (panel == null) throw new ArgumentNullException("panel"); TabControl tabControl; if (panel.Dock == DockStyle.Left || panel.Dock == DockStyle.Top) { tabControl = TabControl1; } else { tabControl = TabControl2; } if (tabControl == null) return; var tabPage = new TabPage { Name = panel.Key, Text = panel.Caption, }; tabPage.VisibleChanged += TabPageOnVisibleChanged; panel.InnerControl.Dock = DockStyle.Fill; tabPage.Controls.Add(panel.InnerControl); _allTabs.Add(panel.Key, tabPage); tabControl.TabPages.Add(tabPage); OnPanelAdded(new DockablePanelEventArgs(panel.Key)); OnActivePanelChanged(new DockablePanelEventArgs(panel.Key)); }
private void AddDockingPane() { var form = new AboutBox(); DockablePanel aboutPanel = new DockablePanel(AboutPanelKey, "About", form.tableLayoutPanel, DockStyle.Right); App.DockManager.Add(aboutPanel); form.okButton.Click += okButton_Click; App.DockManager.ActivePanelChanged += DockManager_ActivePanelChanged; }
private void AddDockingPane() { var form = new AboutBox(); form.okButton.Click += (o, args) => App.DockManager.HidePanel(AboutPanelKey); var aboutPanel = new DockablePanel(AboutPanelKey, "About", form.tableLayoutPanel, DockStyle.Right); App.DockManager.Add(aboutPanel); }
public void Add(DockablePanel panel) { System.Windows.Forms.TabPage tabPage = new TabPage(); tabPage.Controls.Add(panel.InnerControl); panel.InnerControl.Dock = DockStyle.Fill; tabPage.Name = panel.Key; tabPage.Text = panel.Caption; this.uxTabControl.Controls.Add(tabPage); }
/// <summary> /// Adds the specified panel. /// </summary> /// <param name="panel"></param> public void Add(DockablePanel panel) { Add(panel.Key, panel.Caption, panel.InnerControl, panel.Dock); }
/// <summary> /// Adds the specified panel. /// </summary> /// <param name="panel"></param> public void Add(DockablePanel panel) { Add(panel.Key, panel.Caption, panel.InnerControl, panel.Dock); OnPanelAdded(new DockablePanelEventArgs(panel.Key)); }
//add a datasheet panel public void AddPanel() { var dp = new DockablePanel(strPanelKey, strPanelCaption, _frmDatasheet, DockStyle.Fill); dp.DefaultSortOrder = (short)pluginType; App.DockManager.Add(dp); }
/// <summary> /// Add a dockable panel /// </summary> /// <param name="panel">The dockable panel</param> public void Add(DockablePanel panel) { string key = panel.Key; string caption = panel.Caption; Control innerControl = panel.InnerControl; DockStyle dockStyle = panel.Dock; short zOrder = panel.DefaultSortOrder; Image img = null; if (panel.SmallImage != null) img = panel.SmallImage; //set dock style of the inner control to Fill innerControl.Dock = DockStyle.Fill; // make an attempt to start the pane off at the right width. if (dockStyle == DockStyle.Right) MainDockPanel.DockRightPortion = (double)innerControl.Width / MainDockPanel.Width; //setting document tab strip location to 'bottom' if (dockStyle == DockStyle.Fill) { MainDockPanel.DocumentTabStripLocation = DocumentTabStripLocation.Bottom; MainDockPanel.DocumentStyle = DocumentStyle.DockingWindow; } //add the inner control of the panel DockContent content = new DockContent(); content.ShowHint = ConvertToDockState(dockStyle); content.Controls.Add(innerControl); content.Text = caption; content.TabText = caption; content.Tag = key; innerControl.Tag = key; content.HideOnClose = true; if (img != null) { content.Icon = ImageToIcon(img); } content.Show(MainDockPanel); //event handler for closing content.FormClosing += new FormClosingEventHandler(content_FormClosing); content.FormClosed += new FormClosedEventHandler(content_FormClosed); //the tag is used by the ActivePanelChanged event content.Pane.Tag = key; //add panel to contents dictionary if (!dockContents.ContainsKey(key)) { dockContents.Add(key, content); } if (!sortOrderLookup.ContainsKey(content)) { sortOrderLookup.Add(content, zOrder); } //trigger the panel added event OnPanelAdded(key); //set the correct sort order if (content.Pane.Contents.Count > 1) { int sortingIndex = ConvertSortOrderToIndex(content, zOrder); content.Pane.SetContentIndex(content, sortingIndex); } }
//add the panel content within the plugin public void AddPanel() { var dp = new DockablePanel(strPanelKey, strPanelCaption, innerIronPythonControl, DockStyle.Fill); dp.DefaultSortOrder = (short)pluginType; App.DockManager.Add(dp); }
//add a datasheet panel public void AddPanel() { var dp = new DockablePanel(strPanelKey, strPanelCaption, cLocation, System.Windows.Forms.DockStyle.Fill); dp.DefaultSortOrder = (short)pluginType; App.DockManager.Add(dp); }
public void Add(DockablePanel panel) { if (!_isActivated) return; _dockManager.Add(panel); }