/// <summary>
        /// Initialize a new instance of the KryptonDockingFloatingWindow class.
        /// </summary>
        /// <param name="name">Initial name of the element.</param>
        /// <param name="owner">Reference to form that owns the floating windows.</param>
        /// <param name="floatspace">Reference to form that will own all the floating window.</param>
        /// <param name="useMinimiseBox">Allow window to be minimised.</param>
        public KryptonDockingFloatingWindow(string name, Form owner, KryptonDockingFloatspace floatspace, bool useMinimiseBox)
            : base(name)
        {
            if (owner == null)
            {
                throw new ArgumentNullException(nameof(owner));
            }

            FloatspaceElement           = floatspace ?? throw new ArgumentNullException(nameof(floatspace));
            FloatspaceElement.Disposed += OnDockingFloatspaceDisposed;

            // Create the actual window control and hook into events
            FloatingWindow = new KryptonFloatingWindow(owner, floatspace.FloatspaceControl, useMinimiseBox);
            FloatingWindow.WindowCloseClicked    += OnFloatingWindowCloseClicked;
            FloatingWindow.WindowCaptionDragging += OnFloatingWindowCaptionDragging;
            FloatingWindow.Disposed += OnFloatingWindowDisposed;

            // Create and add a control we use to obscure the floating window client area during multi-part operations
            _obscure = new ObscureControl
            {
                Anchor  = (AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom),
                Visible = false
            };
            FloatingWindow.Controls.Add(_obscure);

            // Add the floatspace as the only child of this collection
            InternalAdd(floatspace);
        }
Пример #2
0
 /// <summary>
 /// Initialize a new instance of the DragTargetNull class.
 /// </summary>
 /// <param name="manager">Reference to docking manager.</param>
 /// <param name="floatingWindow">Reference to window being dragged.</param>
 /// <param name="pages">Reference to collection of pages to drag.</param>
 public DockingDragTargetProvider(KryptonDockingManager manager,
                                  KryptonFloatingWindow floatingWindow,
                                  KryptonPageCollection pages)
 {
     _manager        = manager;
     _floatingWindow = floatingWindow;
     _pages          = pages;
 }
 /// <summary>
 /// Propagates a request for drag targets down the hierarchy of docking elements.
 /// </summary>
 /// <param name="floatingWindow">Reference to window being dragged.</param>
 /// <param name="dragData">Set of pages being dragged.</param>
 /// <param name="targets">Collection of drag targets.</param>
 public override void PropogateDragTargets(KryptonFloatingWindow floatingWindow,
                                           PageDragEndData dragData,
                                           DragTargetList targets)
 {
     // Can only generate targets for a floating window that is actually visible and not the one being dragged
     if (FloatingWindow.Visible && (floatingWindow != FloatingWindow))
     {
         base.PropogateDragTargets(floatingWindow, dragData, targets);
     }
 }
        /// <summary>
        /// Propagates a request for drag targets down the hierarchy of docking elements.
        /// </summary>
        /// <param name="floatingWindow">Reference to window being dragged.</param>
        /// <param name="dragData">Set of pages being dragged.</param>
        /// <param name="targets">Collection of drag targets.</param>
        public override void PropogateDragTargets(KryptonFloatingWindow floatingWindow,
                                                  PageDragEndData dragData,
                                                  DragTargetList targets)
        {
            // Create list of the pages that are allowed to be dropped into this workspace
            KryptonPageCollection pages = new KryptonPageCollection();

            foreach (KryptonPage page in dragData.Pages)
            {
                if (page.AreFlagsSet(KryptonPageFlags.DockingAllowWorkspace))
                {
                    pages.Add(page);
                }
            }

            // Do we have any pages left for dragging?
            if (pages.Count > 0)
            {
                DragTargetList workspaceTargets = DockableWorkspaceControl.GenerateDragTargets(new PageDragEndData(this, pages), KryptonPageFlags.DockingAllowWorkspace);
                targets.AddRange(workspaceTargets.ToArray());
            }
        }
Пример #5
0
 /// <summary>
 /// Initialize a new instance of the FloatingWindowEventArgs class.
 /// </summary>
 /// <param name="floatingWindow">Reference to floating window instance.</param>
 /// <param name="element">Reference to docking floating winodw element that is managing the floating window.</param>
 public FloatingWindowEventArgs(KryptonFloatingWindow floatingWindow,
                                KryptonDockingFloatingWindow element)
 {
     FloatingWindow        = floatingWindow;
     FloatingWindowElement = element;
 }