public void CompleteDrag() { if (this.Visible) { PlotLayoutAxis plotLayoutAxis = this.Source.Object as PlotLayoutAxis; PlotLayoutAxis plotLayoutAxis2 = this.Destination.Object as PlotLayoutAxis; PlotLayoutDockableAll plotLayoutDockableAll = this.Source.Object as PlotLayoutDockableAll; PlotLayoutDockableAll plotLayoutDockableAll2 = this.Destination.Object as PlotLayoutDockableAll; PlotLayoutDockableDataView plotLayoutDockableDataView = this.Source.Object as PlotLayoutDockableDataView; PlotLayoutDockableDataView plotLayoutDockableDataView2 = this.Destination.Object as PlotLayoutDockableDataView; PlotLayoutDataView plotLayoutDataView = this.Source.Object as PlotLayoutDataView; PlotLayoutDataView plotLayoutDataView2 = this.Destination.Object as PlotLayoutDataView; if (plotLayoutDataView != null && plotLayoutDataView2 != null) { this.DropDataViewOnDataView(); } else if (plotLayoutDockableDataView != null) { if (plotLayoutDockableDataView != null && plotLayoutDockableDataView2 != null) { this.DropDockableAllOnDockableAll(); } else if (plotLayoutDockableDataView != null && plotLayoutDataView2 != null) { this.DropDockableDataViewOnDataView(); } else if (plotLayoutDockableAll != null && this.Destination.Object == null) { this.DropDockableAllOnPlotDockGroup(); } if (plotLayoutAxis != null && plotLayoutAxis2 != null) { plotLayoutAxis.DockStyle = plotLayoutAxis2.DockStyle; } else if (plotLayoutDockableAll != null && plotLayoutDockableAll2 != null) { plotLayoutDockableAll.DockStyle = plotLayoutDockableAll2.DockStyle; } else if (plotLayoutDockableAll != null && plotLayoutAxis2 != null) { plotLayoutDockableAll.DockStyle = PlotDockStyleAll.DataView; } else if (plotLayoutDockableAll != null && plotLayoutDataView2 != null) { plotLayoutDockableAll.DockStyle = PlotDockStyleAll.DataView; } else if (plotLayoutAxis != null && plotLayoutDataView2 != null) { plotLayoutAxis.DockStyle = PlotDockStyleAxis.DataView; } else if (plotLayoutDockableAll != null && this.Destination.Object == null) { plotLayoutDockableAll.DockStyle = PlotDockStyleAll.Plot; } } (this.m_ControlBase as PlotLayoutViewer).MakeDirty(); } }
private void AssignGroups() { this.PlotDockGroup.Clear(); this.LayoutGroupOrphan.Clear(); this.StackingGroups.Clear(); foreach (PlotLayoutBlockGroup dataViewGroup in this.DataViewGroups) { dataViewGroup.Clear(); PlotLayoutStackingGroup plotLayoutStackingGroup = this.StackingGroups.GetStackingGroup(dataViewGroup.DataView); if (plotLayoutStackingGroup == null) { plotLayoutStackingGroup = new PlotLayoutStackingGroup(); plotLayoutStackingGroup.Index = dataViewGroup.DataView.StackingGroupIndex; this.StackingGroups.Add(plotLayoutStackingGroup); } plotLayoutStackingGroup.Add(dataViewGroup); } foreach (PlotLayoutBlockItem blockItem in this.BlockItems) { if (blockItem.Object is PlotLayoutAxis) { PlotLayoutAxis plotLayoutAxis = blockItem.Object as PlotLayoutAxis; PlotLayoutBlockGroup blockGroup = this.GetBlockGroup(plotLayoutAxis.DockDataView); if (blockGroup != null) { blockGroup.Add(blockItem); } else { this.LayoutGroupOrphan.Add(blockItem); } } else if (blockItem.Object is PlotLayoutDockableAll) { PlotLayoutDockableAll plotLayoutDockableAll = blockItem.Object as PlotLayoutDockableAll; if (plotLayoutDockableAll.DockStyle == PlotDockStyleAll.Plot) { this.PlotDockGroup.Add(blockItem); } else { PlotLayoutBlockGroup blockGroup = this.GetBlockGroup(plotLayoutDockableAll.DockDataView); if (blockGroup != null) { blockGroup.Add(blockItem); } else { this.LayoutGroupOrphan.Add(blockItem); } } } } }
public void DropDockableAllOnPlotDockGroup() { PlotLayoutDockableAll plotLayoutDockableAll = this.Source.Object as PlotLayoutDockableAll; plotLayoutDockableAll.DockDataViewName = ""; PlotLayoutBlockItemCollection plotLayoutBlockItemCollection; if (this.DestinationSide == PlotDragSide.Left) { plotLayoutDockableAll.DockSide = AlignmentQuadSide.Left; plotLayoutBlockItemCollection = (this.Destination as PlotLayoutBlockGroup).ListLeft; } else if (this.DestinationSide == PlotDragSide.Right) { plotLayoutDockableAll.DockSide = AlignmentQuadSide.Right; plotLayoutBlockItemCollection = (this.Destination as PlotLayoutBlockGroup).ListRight; } else if (this.DestinationSide == PlotDragSide.Top) { plotLayoutDockableAll.DockSide = AlignmentQuadSide.Top; plotLayoutBlockItemCollection = (this.Destination as PlotLayoutBlockGroup).ListTop; } else { plotLayoutDockableAll.DockSide = AlignmentQuadSide.Bottom; plotLayoutBlockItemCollection = (this.Destination as PlotLayoutBlockGroup).ListBottom; } this.Source.List.Remove(this.Source); this.FixupStacking(this.Source.List, plotLayoutDockableAll.DockOrder); if (this.Destination.List != null) { if (plotLayoutBlockItemCollection.Count != 0) { plotLayoutDockableAll.DockOrder = plotLayoutBlockItemCollection[0].Object.DockOrder - 1; } else { plotLayoutDockableAll.DockOrder = 0; } plotLayoutDockableAll.DockPercentStart = 0.0; plotLayoutDockableAll.DockPercentStop = 1.0; } }
private void PerformStartStopFixup(PaintArgs p) { foreach (PlotLayoutBase layoutObject in this.LayoutObjects) { Rectangle rectangle; if (layoutObject is PlotLayoutDockableAll) { PlotLayoutDockableAll plotLayoutDockableAll = layoutObject as PlotLayoutDockableAll; if (plotLayoutDockableAll.DockStartStyle != 0) { PlotDataView dockStartDataView = plotLayoutDockableAll.DockStartDataView; if (dockStartDataView != null) { rectangle = ((plotLayoutDockableAll.DockStartStyle != PlotDockStartStopStyleDockableAll.DataViewOuter) ? dockStartDataView.BoundsClip : dockStartDataView.Bounds); if (plotLayoutDockableAll.DockVertical) { plotLayoutDockableAll.Bounds = Rectangle.FromLTRB(rectangle.Left, plotLayoutDockableAll.Bounds.Top, plotLayoutDockableAll.Bounds.Right, plotLayoutDockableAll.Bounds.Bottom); } else { plotLayoutDockableAll.Bounds = Rectangle.FromLTRB(plotLayoutDockableAll.Bounds.Left, plotLayoutDockableAll.Bounds.Top, plotLayoutDockableAll.Bounds.Right, rectangle.Bottom); } } } if (plotLayoutDockableAll.DockStopStyle != 0) { PlotDataView dockStartDataView = plotLayoutDockableAll.DockStopDataView; if (dockStartDataView != null) { rectangle = ((plotLayoutDockableAll.DockStopStyle != PlotDockStartStopStyleDockableAll.DataViewOuter) ? dockStartDataView.BoundsClip : dockStartDataView.Bounds); if (plotLayoutDockableAll.DockVertical) { plotLayoutDockableAll.Bounds = Rectangle.FromLTRB(plotLayoutDockableAll.Bounds.Left, plotLayoutDockableAll.Bounds.Top, rectangle.Right, plotLayoutDockableAll.Bounds.Bottom); } else { plotLayoutDockableAll.Bounds = Rectangle.FromLTRB(plotLayoutDockableAll.Bounds.Left, rectangle.Top, plotLayoutDockableAll.Bounds.Right, plotLayoutDockableAll.Bounds.Bottom); } } } } else if (layoutObject is PlotLayoutAxis) { PlotLayoutAxis plotLayoutAxis = layoutObject as PlotLayoutAxis; if (plotLayoutAxis.DockStartStyle != 0) { PlotLayoutAxis dockStartAxis = plotLayoutAxis.DockStartAxis; if (dockStartAxis != null) { rectangle = dockStartAxis.Bounds; if (dockStartAxis.DockVertical) { plotLayoutAxis.Bounds = Rectangle.FromLTRB(rectangle.Left, plotLayoutAxis.Bounds.Top, plotLayoutAxis.Bounds.Right, plotLayoutAxis.Bounds.Bottom); } else { plotLayoutAxis.Bounds = Rectangle.FromLTRB(plotLayoutAxis.Bounds.Left, plotLayoutAxis.Bounds.Top, plotLayoutAxis.Bounds.Right, rectangle.Bottom); } } } if (plotLayoutAxis.DockStopStyle != 0) { PlotLayoutAxis dockStartAxis = plotLayoutAxis.DockStopAxis; if (dockStartAxis != null) { rectangle = dockStartAxis.Bounds; if (dockStartAxis.DockVertical) { plotLayoutAxis.Bounds = Rectangle.FromLTRB(plotLayoutAxis.Bounds.Left, plotLayoutAxis.Bounds.Top, rectangle.Right, plotLayoutAxis.Bounds.Bottom); } else { plotLayoutAxis.Bounds = Rectangle.FromLTRB(plotLayoutAxis.Bounds.Left, rectangle.Top, plotLayoutAxis.Bounds.Right, plotLayoutAxis.Bounds.Bottom); } } } } } }