public void HorizontalEqualsMaxPercentage() { FwSplitContainer splitContainer = new FwSplitContainer(); splitContainer.Orientation = Orientation.Horizontal; splitContainer.Bounds = new Rectangle(0, 0, 100, 100); splitContainer.SplitterDistance = 50; splitContainer.MaxFirstPanePercentage = 0.7f; // Moving splitter to 70% should be allowed SplitterCancelEventArgs e = new SplitterCancelEventArgs(50, 70, 50, 70); splitContainer.OnSplitterMoving(e); Assert.IsFalse(e.Cancel); }
public void HorizontalGreaterThenMaxPercentage() { FwSplitContainer splitContainer = new FwSplitContainer(); splitContainer.Orientation = Orientation.Horizontal; splitContainer.Bounds = new Rectangle(0, 0, 100, 100); splitContainer.SplitterDistance = 50; splitContainer.MaxFirstPanePercentage = 0.7f; // Moving splitter to 90% should leave splitter at 70% SplitterCancelEventArgs e = new SplitterCancelEventArgs(50, 90, 50, 90); splitContainer.OnSplitterMoving(e); Assert.AreEqual((int)(splitContainer.Height * splitContainer.MaxFirstPanePercentage), e.SplitY); }
public void HorizontalEqualsMaxPercentage() { using (FwSplitContainer splitContainer = new FwSplitContainer()) { splitContainer.Orientation = Orientation.Horizontal; splitContainer.Bounds = new Rectangle(0, 0, 100, 100); splitContainer.SplitterDistance = 50; splitContainer.MaxFirstPanePercentage = 0.7f; // Moving splitter to 70% should be allowed SplitterCancelEventArgs e = new SplitterCancelEventArgs(50, 70, 50, 70); splitContainer.OnSplitterMoving(e); Assert.IsFalse(e.Cancel); } }
public void VerticalGreaterThenMaxPercentage() { using (FwSplitContainer splitContainer = new FwSplitContainer()) { splitContainer.Orientation = Orientation.Vertical; splitContainer.Bounds = new Rectangle(0, 0, 100, 100); splitContainer.SplitterDistance = 50; splitContainer.MaxFirstPanePercentage = 0.7f; // Moving splitter to 90% should leave splitter at 70% SplitterCancelEventArgs e = new SplitterCancelEventArgs(90, 50, 90, 50); splitContainer.OnSplitterMoving(e); Assert.AreEqual((int)(splitContainer.Width * splitContainer.MaxFirstPanePercentage), e.SplitX); } }
public void HorizontalGreaterThenMaxPercentage() { FwSplitContainer splitContainer = new FwSplitContainer(); splitContainer.Orientation = Orientation.Horizontal; splitContainer.Bounds = new Rectangle(0, 0, 100, 100); splitContainer.SplitterDistance = 50; splitContainer.MaxFirstPanePercentage = 0.7f; // Moving splitter to 90% should leave splitter at 70% SplitterCancelEventArgs e = new SplitterCancelEventArgs(50, 90, 50, 90); splitContainer.OnSplitterMoving(e); Assert.AreEqual((int)(splitContainer.Height * splitContainer.MaxFirstPanePercentage), e.SplitY); }
public void VerticalGreaterThenMaxPercentage() { using (FwSplitContainer splitContainer = new FwSplitContainer()) { splitContainer.Orientation = Orientation.Vertical; splitContainer.Bounds = new Rectangle(0, 0, 100, 100); splitContainer.SplitterDistance = 50; splitContainer.MaxFirstPanePercentage = 0.7f; // Moving splitter to 90% should leave splitter at 70% SplitterCancelEventArgs e = new SplitterCancelEventArgs(90, 50, 90, 50); splitContainer.OnSplitterMoving(e); Assert.AreEqual((int)(splitContainer.Width * splitContainer.MaxFirstPanePercentage), e.SplitX); } }