当前位置: 首页>>代码示例>>C#>>正文


C# FlowLayoutWidget.PerformLayout方法代码示例

本文整理汇总了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");
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:40,代码来源:MatterControlUiFeatures.cs

示例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();
			}
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:22,代码来源:DiagnosticsWidget.cs


注:本文中的MatterHackers.Agg.UI.FlowLayoutWidget.PerformLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。