/// <summary> /// Initialize a new instance of the FloatspaceCellEventArgs class. /// </summary> /// <param name="floatspace">Reference to existing floatspace control instance.</param> /// <param name="element">Reference to docking floatspace element that is managing the floatspace control.</param> /// <param name="cell">Reference tofloatspace control cell instance.</param> public FloatspaceCellEventArgs(KryptonFloatspace floatspace, KryptonDockingFloatspace element, KryptonWorkspaceCell cell) { FloatspaceControl = floatspace; FloatspaceElement = element; CellControl = cell; }
/// <summary> /// Initialize a new instance of the KryptonDockingFloatspace class. /// </summary> /// <param name="name">Initial name of the element.</param> public KryptonDockingFloatspace(string name) : base(name, "Floating") { // Create a new floatspace that will be a host for docking pages SpaceControl = new KryptonFloatspace(); FloatspaceControl.Dock = DockStyle.Fill; FloatspaceControl.CellPageInserting += OnSpaceCellPageInserting; FloatspaceControl.PageCloseClicked += OnFloatspacePageCloseClicked; FloatspaceControl.PagesDoubleClicked += OnFloatspacePagesDoubleClicked; FloatspaceControl.PageDropDownClicked += OnFloatspaceDropDownClicked; FloatspaceControl.BeforePageDrag += OnFloatspaceBeforePageDrag; }
/// <summary> /// Initialize a new instance of the KryptonFloatingWindow class. /// </summary> /// <param name="owner">Reference to form that will own all the floating window.</param> /// <param name="floatspace">Reference to owning floatspace instance.</param> /// <param name="useMinimiseBox">Allow window to be minimised.</param> public KryptonFloatingWindow(Form owner, KryptonFloatspace floatspace, bool useMinimiseBox = false) { // Set the owner of the window so that minimizing the owner will do the same to this Owner = owner; // Set correct form settings for a floating window TopLevel = true; ShowIcon = false; ShowInTaskbar = false; MinimizeBox = useMinimiseBox; StartPosition = FormStartPosition.Manual; ButtonSpecMin.ImageStates.ImageDisabled = EMPTY_IMAGE; // Hook into floatspace events and add as the content of the floating window FloatspaceControl = floatspace; FloatspaceControl.CellCountChanged += OnFloatspaceCellCountChanged; FloatspaceControl.CellVisibleCountChanged += OnFloatspaceCellVisibleCountChanged; FloatspaceControl.WorkspaceCellAdding += OnFloatspaceCellAdding; FloatspaceControl.WorkspaceCellRemoved += OnFloatspaceCellRemoved; Controls.Add(FloatspaceControl); }
/// <summary> /// Initialize a new instance of the FloatspaceEventArgs class. /// </summary> /// <param name="floatspace">Reference to new floatspace control instance.</param> /// <param name="element">Reference to docking floatspace element that is managing the floatspace control.</param> public FloatspaceEventArgs(KryptonFloatspace floatspace, KryptonDockingFloatspace element) { FloatspaceControl = floatspace; FloatspaceElement = element; }
private KryptonPage MainFormNodeChaned(NodeInfo ninfo) { KryptonWorkspaceCell cell = kDWorkspaceContent.FirstVisibleCell(); try { if (cell == null) { cell = new KryptonWorkspaceCell(); kDWorkspaceContent.Root.Children.Add(cell); } #region 基于菜单表 要重写 //新增 判断如果不存在则新增 if (!_pageDic.ContainsKey(ninfo.NodeName) && kDWorkspaceContent.PageForUniqueName(ninfo.NodeName) == null) { KryptonPage pageTmp = OpenForm(ninfo); if (pageTmp != null) { cell.Pages.Add(pageTmp); cell.SelectedPage = pageTmp; cell.Focus(); } return(pageTmp); } else if (_pageDic.ContainsKey(ninfo.NodeName) && kDWorkspaceContent.PageForUniqueName(ninfo.NodeName) != null) { KryptonFloatingWindow kfw = FindFWindow(_pageDic[ninfo.NodeName]); if (kfw == null) { //如果这个page已经存在那么就要把它找出来 不在FloatWindow里的情况 cell = kDWorkspaceContent.CellForUniqueName(ninfo.NodeName); kDWorkspaceContent.ActiveCell = cell; cell.SelectedPage = _pageDic[ninfo.NodeName]; return(cell.SelectedPage); } else { kfw.Activate(); KryptonFloatspace kfs = kfw.FloatspaceControl; kfs.SeparatorStyle = ComponentFactory.Krypton.Toolkit.SeparatorStyle.HighProfile; Form f = kfw.FindForm(); cell = kfs.CellForUniqueName(ninfo.NodeName); kfs.ActiveCell = cell; cell.SelectedPage = _pageDic[ninfo.NodeName]; cell.Focus(); return(cell.SelectedPage); } } else if (kDWorkspaceContent.PageForUniqueName(ninfo.NodeName) != null) { KryptonPage pageTmp = kDWorkspaceContent.PageForUniqueName(ninfo.NodeName); kDWorkspaceContent.ClosePage(pageTmp); bool a = pageTmp.Visible; //其他特殊情况 pageTmp = OpenForm(ninfo); cell.Pages.Add(pageTmp); cell.SelectedPage = pageTmp; cell.Focus(); return(cell.SelectedPage); } return(null); #endregion } catch (Exception ex) { throw ex; } }