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


C# FlowLayoutWidget.RemoveAllChildren方法代码示例

本文整理汇总了C#中MatterHackers.Agg.UI.FlowLayoutWidget.RemoveAllChildren方法的典型用法代码示例。如果您正苦于以下问题:C# FlowLayoutWidget.RemoveAllChildren方法的具体用法?C# FlowLayoutWidget.RemoveAllChildren怎么用?C# FlowLayoutWidget.RemoveAllChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MatterHackers.Agg.UI.FlowLayoutWidget的用法示例。


在下文中一共展示了FlowLayoutWidget.RemoveAllChildren方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: QueueBottomToolbar

        public QueueBottomToolbar(QueueDataView queueDataView)
        {
            this.queueDataView = queueDataView;

            SetDisplayAttributes();

            textImageButtonFactory.normalTextColor = ActiveTheme.Instance.PrimaryTextColor;
            textImageButtonFactory.hoverTextColor = ActiveTheme.Instance.PrimaryTextColor;
            textImageButtonFactory.disabledTextColor = ActiveTheme.Instance.PrimaryTextColor;
            textImageButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryTextColor;
            textImageButtonFactory.borderWidth = 0;

            FlowLayoutWidget allControls = new FlowLayoutWidget(FlowDirection.TopToBottom);

            {
                {                    
                    // Ensure the form opens with no rows selected.
                    //ActiveQueueList.Instance.ClearSelected();

                    allControls.AddChild(queueDataView);
                }

                FlowLayoutWidget buttonPanel1 = new FlowLayoutWidget();
                buttonPanel1.HAnchor = HAnchor.ParentLeftRight;
                buttonPanel1.Padding = new BorderDouble(0, 3);

                {
                    Button addToQueueButton = textImageButtonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png");
                    buttonPanel1.AddChild(addToQueueButton);
                    addToQueueButton.Margin = new BorderDouble(0, 0, 3, 0);
                    addToQueueButton.Click += new ButtonBase.ButtonEventHandler(addToQueueButton_Click);

                    // put in the creator button
                    {
                        Button runCreator = textImageButtonFactory.Generate(LocalizedString.Get("Create"), "icon_creator_white_32x32.png");
                        buttonPanel1.AddChild(runCreator);
                        runCreator.Margin = new BorderDouble(0, 0, 3, 0);
                        runCreator.Click += (sender, e) =>
                        {
                            OpenPluginChooserWindow();
                        };
                    }

                    if(OemSettings.Instance.ShowShopButton)
                    {
                        shopButton = textImageButtonFactory.Generate(LocalizedString.Get("Buy Materials"), "icon_shopping_cart_32x32.png");
                        buttonPanel1.AddChild(shopButton);
                        shopButton.Margin = new BorderDouble(0, 0, 3, 0);
                        shopButton.Click += (sender, e) =>
                        {
                            double activeFilamentDiameter = 0;
                            if(ActivePrinterProfile.Instance.ActivePrinter != null)
                            {
                                activeFilamentDiameter = 3;
                                if (ActiveSliceSettings.Instance.FilamentDiameter < 2)
                                {
                                    activeFilamentDiameter = 1.75;
                                }
                            }

                            System.Diagnostics.Process.Start("http://www.matterhackers.com/mc/store/redirect?d={0}&clk=mcs&a={1}".FormatWith(activeFilamentDiameter, OemSettings.Instance.AffiliateCode));
                        };
                    }

                    Button deleteAllFromQueueButton = textImageButtonFactory.Generate(LocalizedString.Get("Remove All"));
                    deleteAllFromQueueButton.Margin = new BorderDouble(3, 0);
                    deleteAllFromQueueButton.Click += new ButtonBase.ButtonEventHandler(deleteAllFromQueueButton_Click);
                    //buttonPanel1.AddChild(deleteAllFromQueueButton);

                    GuiWidget spacer1 = new GuiWidget();
                    spacer1.HAnchor = HAnchor.ParentLeftRight;
                    buttonPanel1.AddChild(spacer1);

                    GuiWidget spacer2 = new GuiWidget();
                    spacer2.HAnchor = HAnchor.ParentLeftRight;
                    buttonPanel1.AddChild(spacer2);

                    FlowLayoutWidget queueMenuSpace = new FlowLayoutWidget();
                    GuiWidget queueMenu = new QueueOptionsMenu();
                    queueMenu.VAnchor = VAnchor.ParentTop;
                    queueMenuSpace.AddChild(queueMenu);
                    buttonPanel1.AddChild(queueMenuSpace);

                    ActivePrinterProfile.Instance.ActivePrinterChanged.RegisterEvent((object sender, EventArgs e) =>
                    {
                        queueMenuSpace.RemoveAllChildren();
                        // the printer changed reload the queueMenue
                        queueMenu = new QueueOptionsMenu();
                        queueMenu.VAnchor = VAnchor.ParentTop;
                        queueMenuSpace.AddChild(queueMenu);
                    }, ref unregisterEvents);
                }
                allControls.AddChild(buttonPanel1);
            }
            allControls.AnchorAll();
            
            this.AddChild(allControls);
        }
开发者ID:klewisjohnson,项目名称:MatterControl,代码行数:98,代码来源:QueueBottomToolbar.cs

示例2: QueueDataWidget


//.........这里部分代码省略.........
				// put in the itme edit menu
				{
					moreMenu = new DropDownMenu("More".Localize() + "... ");
					moreMenu.NormalColor = new RGBA_Bytes();
					moreMenu.BorderWidth = 1;
					moreMenu.BorderColor = ActiveTheme.Instance.SecondaryTextColor;
					moreMenu.MenuAsWideAsItems = false;
					moreMenu.VAnchor = VAnchor.ParentBottomTop;
					moreMenu.Margin = new BorderDouble(3, 3);
					moreMenu.AlignToRightEdge = true;

					topBarContainer.AddChild(moreMenu);
					SetMenuItems(moreMenu);
					moreMenu.SelectionChanged += new EventHandler(ItemMenu_SelectionChanged);
				}

				allControls.AddChild(topBarContainer);

				{
					// Ensure the form opens with no rows selected.
					//ActiveQueueList.Instance.ClearSelected();

					allControls.AddChild(queueDataView);
				}

				FlowLayoutWidget buttonPanel1 = new FlowLayoutWidget();
				buttonPanel1.HAnchor = HAnchor.ParentLeftRight;
				buttonPanel1.Padding = new BorderDouble(0, 3);
				buttonPanel1.MinimumSize = new Vector2(0, 46);
				{
					addToQueueButton = textImageButtonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png");
					buttonPanel1.AddChild(addToQueueButton);
					addToQueueButton.Margin = new BorderDouble(0, 0, 3, 0);
					addToQueueButton.Click += new EventHandler(addToQueueButton_Click);

					// put in the creator button
					{
						createButton = textImageButtonFactory.Generate(LocalizedString.Get("Create"), "icon_creator_white_32x32.png");
						buttonPanel1.AddChild(createButton);
						createButton.Margin = new BorderDouble(0, 0, 3, 0);
						createButton.Click += (sender, e) =>
						{
							OpenPluginChooserWindow();
						};
					}

					bool touchScreenMode = ActiveTheme.Instance.IsTouchScreen;

					if (!touchScreenMode)
					{
						if (OemSettings.Instance.ShowShopButton)
						{
							shopButton = textImageButtonFactory.Generate(LocalizedString.Get("Buy Materials"), "icon_shopping_cart_32x32.png");
							buttonPanel1.AddChild(shopButton);
							shopButton.Margin = new BorderDouble(0, 0, 3, 0);
							shopButton.Click += (sender, e) =>
							{
								double activeFilamentDiameter = 0;
								if (ActivePrinterProfile.Instance.ActivePrinter != null)
								{
									activeFilamentDiameter = 3;
									if (ActiveSliceSettings.Instance.FilamentDiameter < 2)
									{
										activeFilamentDiameter = 1.75;
									}
								}

								MatterControlApplication.Instance.LaunchBrowser("http://www.matterhackers.com/mc/store/redirect?d={0}&clk=mcs&a={1}".FormatWith(activeFilamentDiameter, OemSettings.Instance.AffiliateCode));
							};
						}
					}

					buttonPanel1.AddChild(new HorizontalSpacer());

					queueMenuContainer = new FlowLayoutWidget();
					queueMenuContainer.VAnchor = Agg.UI.VAnchor.ParentBottomTop;
					queueMenu = new QueueOptionsMenu();
					queueMenuContainer.AddChild(queueMenu.MenuDropList);
					if (!touchScreenMode)
					{
						buttonPanel1.AddChild(queueMenuContainer);
					}

					ActivePrinterProfile.Instance.ActivePrinterChanged.RegisterEvent((object sender, EventArgs e) =>
					{
						queueMenuContainer.RemoveAllChildren();
						// the printer changed reload the queueMenue
						queueMenu = new QueueOptionsMenu();
						queueMenuContainer.AddChild(queueMenu.MenuDropList);
					}, ref unregisterEvents);
				}
				allControls.AddChild(buttonPanel1);
			}
			allControls.AnchorAll();

			this.AddChild(allControls);
			AddHandlers();

			//enterEditModeButtonClick(null, null);
		}
开发者ID:CodeMangler,项目名称:MatterControl,代码行数:101,代码来源:QueueDataWidget.cs

示例3: QueueDataWidget


//.........这里部分代码省略.........
					addToQueueButton.Click += new EventHandler(addToQueueButton_Click);

					// put in the creator button
					{
						createButton = textImageButtonFactory.Generate(LocalizedString.Get("Create"), "icon_creator_white_32x32.png");
						buttonPanel1.AddChild(createButton);
						createButton.Margin = new BorderDouble(0, 0, 3, 0);
						createButton.Click += (sender, e) =>
						{
							OpenPluginChooserWindow();
						};
					}

					sendItemButton = textImageButtonFactory.Generate("Send".Localize());
					sendItemButton.Margin = new BorderDouble(0, 0, 3, 0);
					sendItemButton.Click += new EventHandler(sendButton_Click);
					sendItemButton.Visible = false;
					buttonPanel1.AddChild(sendItemButton);

					addToLibraryButton = textImageButtonFactory.Generate("Add To Library".Localize());
					addToLibraryButton.Margin = new BorderDouble(3, 0);
					addToLibraryButton.Click += new EventHandler(addToLibraryButton_Click);
					addToLibraryButton.Visible = false;
					buttonPanel1.AddChild(addToLibraryButton);

					exportItemButton = textImageButtonFactory.Generate("Export".Localize());
					exportItemButton.Margin = new BorderDouble(3, 0);
					exportItemButton.Click += new EventHandler(exportButton_Click);
					exportItemButton.Visible = false;
					buttonPanel1.AddChild(exportItemButton);

					copyItemButton = textImageButtonFactory.Generate("Copy".Localize());
					copyItemButton.Margin = new BorderDouble(3, 0);
					copyItemButton.Click += new EventHandler(copy_Button_Click);
					copyItemButton.Visible = false;
					buttonPanel1.AddChild(copyItemButton);

					removeItemButton = textImageButtonFactory.Generate("Remove".Localize());
					removeItemButton.Margin = new BorderDouble(3, 0);
					removeItemButton.Click += new EventHandler(removeButton_Click);
					removeItemButton.Visible = false;
					buttonPanel1.AddChild(removeItemButton);

					bool touchScreenMode = ActiveTheme.Instance.IsTouchScreen;

					if (!touchScreenMode)
					{
						if (OemSettings.Instance.ShowShopButton)
						{
							shopButton = textImageButtonFactory.Generate(LocalizedString.Get("Buy Materials"), "icon_shopping_cart_32x32.png");
							buttonPanel1.AddChild(shopButton);
							shopButton.Margin = new BorderDouble(0, 0, 3, 0);
							shopButton.Click += (sender, e) =>
							{
								double activeFilamentDiameter = 0;
								if (ActivePrinterProfile.Instance.ActivePrinter != null)
								{
									activeFilamentDiameter = 3;
									if (ActiveSliceSettings.Instance.FilamentDiameter < 2)
									{
										activeFilamentDiameter = 1.75;
									}
								}

								MatterControlApplication.Instance.LaunchBrowser("http://www.matterhackers.com/mc/store/redirect?d={0}&clk=mcs&a={1}".FormatWith(activeFilamentDiameter, OemSettings.Instance.AffiliateCode));
							};
						}
					}

					Button deleteAllFromQueueButton = textImageButtonFactory.Generate(LocalizedString.Get("Remove All"));
					deleteAllFromQueueButton.Margin = new BorderDouble(3, 0);
					deleteAllFromQueueButton.Click += new EventHandler(deleteAllFromQueueButton_Click);
					//buttonPanel1.AddChild(deleteAllFromQueueButton);

					buttonPanel1.AddChild(new HorizontalSpacer());

					queueMenuContainer = new FlowLayoutWidget();
					queueMenuContainer.VAnchor = Agg.UI.VAnchor.ParentBottomTop;
					queueMenu = new QueueOptionsMenu();
					queueMenuContainer.AddChild(queueMenu.MenuDropList);
					if (!touchScreenMode)
					{
						buttonPanel1.AddChild(queueMenuContainer);
					}

					ActivePrinterProfile.Instance.ActivePrinterChanged.RegisterEvent((object sender, EventArgs e) =>
					{
						queueMenuContainer.RemoveAllChildren();
						// the printer changed reload the queueMenue
						queueMenu = new QueueOptionsMenu();
						queueMenuContainer.AddChild(queueMenu.MenuDropList);
					}, ref unregisterEvents);
				}
				allControls.AddChild(buttonPanel1);
			}
			allControls.AnchorAll();

			this.AddChild(allControls);
			AddHandlers();
		}
开发者ID:fuding,项目名称:MatterControl,代码行数:101,代码来源:QueueDataWidget.cs


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