/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void rightSplitter_SplitterMoving(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) { // Obtain the minimum and maximum right splitter positions. int minimumRightSplitterPosition = MinimumRightSplitterPosition(); int maximumRightSplitterPosition = MaximumRightSplitterPosition(); // Calculate the new right splitter position. newRightSplitterPosition = rightSplitterPosition - e.Position; // Validate the new right splitter position. Adjust it as needed. if (newRightSplitterPosition < minimumRightSplitterPosition) { newRightSplitterPosition = minimumRightSplitterPosition; } else if (newRightSplitterPosition > maximumRightSplitterPosition) { newRightSplitterPosition = maximumRightSplitterPosition; } // Calculate. Rectangle trackingIndicatorRectangle = CalculateVerticalTrackingIndicatorRectangle(VirtualWidth - newRightSplitterPosition); // Set the new right splitter position, if it has changed. verticalTrackingIdicator.Update(VirtualClientRectangleToParent(trackingIndicatorRectangle).Location); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void rightSplitter_SplitterEndMove(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) { verticalTrackingIdicator.End(); rightSplitterPosition = newRightSplitterPosition; PerformLayout(); Invalidate(); }
/// <summary> /// splitterLightweightControlHorizontal_SplitterMoving event handler. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void splitterLightweightControlHorizontal_SplitterMoving(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) { // If the splitter has moved. if (e.Position != 0) { AdjustHorizontalLightweightSplitterEventArgsPosition(ref e); // Adjust the horizontal splitter position. HorizontalSplitterPosition += (double)e.Position / PaneLayoutHeight; // Layout and invalidate. PerformLayout(); Invalidate(); // Update manually to keep the screen as up to date as possible. Update(); } }
/// <summary> /// splitterLightweightControlHorizontal_SplitterEndMove event handler. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void splitterLightweightControlHorizontal_SplitterEndMove(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) { // If the splitter has moved. if (e.Position != 0) { // Adjust the horizontal splitter position. AdjustHorizontalLightweightSplitterEventArgsPosition(ref e); // Adjust the horizontal splitter position. HorizontalSplitterPosition += (double)e.Position / PaneLayoutHeight; // Layout and invalidate. PerformLayout(); Invalidate(); } }
/// <summary> /// splitterLightweightControlVertical_SplitterMoving event handler. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void splitterLightweightControlVertical_SplitterMoving(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) { // If the splitter has moved. if (e.Position != 0) { // Adjust the splitter position. AdjustVerticalLightweightSplitterEventArgsPosition(ref e); // Adjust the preferred column width - in real time. if (verticalSplitterStyle == VerticalSplitterStyle.Left) { PreferredColumnWidth -= e.Position; } else if (verticalSplitterStyle == VerticalSplitterStyle.Right) { PreferredColumnWidth += e.Position; } // Update manually to keep the screen as up to date as possible. Update(); } }
/// <summary> /// splitterLightweightControlVertical_SplitterEndMove event handler. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void splitterLightweightControlVertical_SplitterEndMove(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) { // If the splitter has moved. if (e.Position != 0) { // Adjust the vertical splitter position. AdjustVerticalLightweightSplitterEventArgsPosition(ref e); // Adjust the preferred column width. if (verticalSplitterStyle == VerticalSplitterStyle.Left) { PreferredColumnWidth -= e.Position; } else if (verticalSplitterStyle == VerticalSplitterStyle.Right) { PreferredColumnWidth += e.Position; } } }