public virtual Point ResetValue(Point currentValue, Size viewportSize, Size extentSize) { if (this.Children.Count <= 0) { return(currentValue); } Point res = currentValue; if (this.Orientation == System.Windows.Forms.Orientation.Vertical) { res.X = RadCanvasViewport.ValidatePosition(currentValue.X, extentSize.Width - viewportSize.Width); int vertPos = GetOffsetFromIndex(currentValue.Y); if (vertPos > extentSize.Height - viewportSize.Height) { res.Y = this.Children.Count - GetLastFullVisibleItemsNum(); } } else { int horizPos = GetOffsetFromIndex(currentValue.X); if (horizPos > extentSize.Width - viewportSize.Width) { res.X = this.Children.Count - GetLastFullVisibleItemsNum(); } res.Y = RadCanvasViewport.ValidatePosition(currentValue.Y, extentSize.Height - viewportSize.Height); } return(res); }
/// <summary> /// Make viewportOffset to be with correct value. /// Set Value of ScrollBars using viewportOffset /// </summary> private void ResetScrollPos() { this.ResetScrollParamsInternal(); Point oldValue = this.Value; Point newValue = oldValue; if (this.UsePhysicalScrolling) { newValue.X = RadCanvasViewport.ValidatePosition(newValue.X, this.extentSize.Width - this.viewportSize.Width); newValue.Y = RadCanvasViewport.ValidatePosition(newValue.Y, this.extentSize.Height - this.viewportSize.Height); } else { if (this.viewport != null) { newValue = ((IRadScrollViewport)this.viewport).ResetValue(this.Value, this.viewportSize, this.extentSize); } } newValue = GetValidValue(newValue); SetScrollValueInternal(newValue); if (oldValue != newValue || newValue == this.MinValue) { DoScroll(oldValue, newValue); } }
public virtual Point ResetValue(Point currentValue, Size viewportSize, Size extentSize) { if (this.Children.Count <= 0) { return(currentValue); } Point point = currentValue; if (this.Orientation == Orientation.Vertical) { point.X = RadCanvasViewport.ValidatePosition(currentValue.X, extentSize.Width - viewportSize.Width); if (this.GetOffsetFromIndex(currentValue.Y) > extentSize.Height - viewportSize.Height) { point.Y = this.Children.Count - this.GetLastFullVisibleItemsNum(); } } else { if (this.GetOffsetFromIndex(currentValue.X) > extentSize.Width - viewportSize.Width) { point.X = this.Children.Count - this.GetLastFullVisibleItemsNum(); } point.Y = RadCanvasViewport.ValidatePosition(currentValue.Y, extentSize.Height - viewportSize.Height); } return(point); }
public Point ResetValue(Point currentValue, Size viewportSize, Size canvasSize) { Point empty = Point.Empty; empty.X = RadCanvasViewport.ValidatePosition(currentValue.X, canvasSize.Width - viewportSize.Width); empty.Y = RadCanvasViewport.ValidatePosition(currentValue.Y, canvasSize.Height - viewportSize.Height); return(empty); }
public override Point ResetValue(Point currentValue, Size viewportSize, Size canvasSize) { Point res = Point.Empty; res.X = RadCanvasViewport.ValidatePosition(currentValue.X, canvasSize.Width - viewportSize.Width); res.Y = RadCanvasViewport.ValidatePosition(currentValue.Y, canvasSize.Height - viewportSize.Height); return(res); }