本文整理汇总了C#中MatterHackers.Agg.UI.FlowLayoutWidget.PerformLayout方法的典型用法代码示例。如果您正苦于以下问题:C# FlowLayoutWidget.PerformLayout方法的具体用法?C# FlowLayoutWidget.PerformLayout怎么用?C# FlowLayoutWidget.PerformLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MatterHackers.Agg.UI.FlowLayoutWidget
的用法示例。
在下文中一共展示了FlowLayoutWidget.PerformLayout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TopToBottomContainerAppliesExpectedMarginToToggleView
public void TopToBottomContainerAppliesExpectedMarginToToggleView()
{
TestContext.CurrentContext.SetCompatibleWorkingDirectory();
int marginSize = 40;
int dimensions = 300;
GuiWidget outerContainer = new GuiWidget(dimensions, dimensions);
FlowLayoutWidget topToBottomContainer = new FlowLayoutWidget(FlowDirection.TopToBottom)
{
HAnchor = HAnchor.ParentLeftRight,
VAnchor = VAnchor.ParentBottomTop,
};
outerContainer.AddChild(topToBottomContainer);
CheckBox toggleBox = new CheckBox("test");
toggleBox.HAnchor = HAnchor.ParentLeftRight;
toggleBox.VAnchor = VAnchor.ParentBottomTop;
toggleBox.Margin = new BorderDouble(marginSize);
toggleBox.BackgroundColor = RGBA_Bytes.Red;
toggleBox.DebugShowBounds = true;
topToBottomContainer.AddChild(toggleBox);
topToBottomContainer.AnchorAll();
topToBottomContainer.PerformLayout();
outerContainer.DoubleBuffer = true;
outerContainer.BackBuffer.NewGraphics2D().Clear(RGBA_Bytes.White);
outerContainer.OnDraw(outerContainer.NewGraphics2D());
// For troubleshooting or visual validation
OutputImages(outerContainer, outerContainer);
var bounds = toggleBox.BoundsRelativeToParent;
Assert.IsTrue(bounds.Left == marginSize, "Left margin is incorrect");
Assert.IsTrue(bounds.Right == dimensions - marginSize, "Right margin is incorrect");
Assert.IsTrue(bounds.Top == dimensions - marginSize, "Top margin is incorrect");
Assert.IsTrue(bounds.Bottom == marginSize, "Bottom margin is incorrect");
}
示例2: topLevelWindow_MouseMove
private void topLevelWindow_MouseMove(object sender, MouseEventArgs mouseEvent)
{
count++;
if (count == 20)
{
RemoveAllChildren();
ScrollableWidget allContainer = new ScrollableWidget(true);
topToBottomTotal = new FlowLayoutWidget(FlowDirection.TopToBottom);
topToBottomTotal.SuspendLayout();
GuiWidget.DefaultEnforceIntegerBounds = true;
AddInfoRecursive(topLevelWindow, topToBottomTotal);
GuiWidget.DefaultEnforceIntegerBounds = false;
topToBottomTotal.ResumeLayout();
topToBottomTotal.PerformLayout();
allContainer.AddChild(topToBottomTotal);
AddChild(allContainer);
allContainer.AnchorAll();
}
}