• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# UI.Button类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Button类属于MatterHackers.Agg.UI命名空间,在下文中一共展示了Button类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SetupStepInstallDriver

        public SetupStepInstallDriver(ConnectionWindow windowController, GuiWidget containerWindowToClose, PrinterSetupStatus setupPrinterStatus)
            : base(windowController, containerWindowToClose, setupPrinterStatus)
        {
            this.printerDriverFilePath = this.PrinterSetupStatus.DriverFilePath;

			headerLabel.Text = string.Format(new LocalizedString("Install Communication Driver").Translated);
            printerDriverContainer = createPrinterDriverContainer();
            contentRow.AddChild(printerDriverContainer);
            {
                //Construct buttons
				installButton = textImageButtonFactory.Generate(new LocalizedString("Install Driver").Translated);
                installButton.Click += new ButtonBase.ButtonEventHandler(installButton_Click);

				skipButton = textImageButtonFactory.Generate(new LocalizedString("Skip").Translated);
                skipButton.Click += new ButtonBase.ButtonEventHandler(skipButton_Click);

                GuiWidget hSpacer = new GuiWidget();
                hSpacer.HAnchor = HAnchor.ParentLeftRight;

                //Add buttons to buttonContainer
                footerRow.AddChild(installButton);
                footerRow.AddChild(skipButton);
                footerRow.AddChild(hSpacer);

                footerRow.AddChild(cancelButton);
            }
        }
开发者ID:rubenkar,项目名称:MatterControl,代码行数:27,代码来源:SetupStepInstallDriver.cs


示例2: getThemeButton

		public Button getThemeButton(int index)
		{
			GuiWidget normal = new GuiWidget(colorSelectSize, colorSelectSize);
			normal.BackgroundColor = ActiveTheme.Instance.AvailableThemes[index].primaryAccentColor;
			GuiWidget hover = new GuiWidget(colorSelectSize, colorSelectSize);
			hover.BackgroundColor = ActiveTheme.Instance.AvailableThemes[index].secondaryAccentColor;
			GuiWidget pressed = new GuiWidget(colorSelectSize, colorSelectSize);
			pressed.BackgroundColor = ActiveTheme.Instance.AvailableThemes[index].secondaryAccentColor;
			GuiWidget disabled = new GuiWidget(colorSelectSize, colorSelectSize);

			Button colorButton = new Button(0, 0, new ButtonViewStates(normal, hover, pressed, disabled));
			colorButton.Name = index.ToString();
			colorButton.Click += (sender, mouseEvent) =>
			{
				UserSettings.Instance.set("ActiveThemeIndex", ((GuiWidget)sender).Name);
				ActiveTheme.Instance.LoadThemeSettings(int.Parse(((GuiWidget)sender).Name));
			};

			colorButton.MouseEnterBounds += (sender, mouseEvent) =>
			{
				colorToChangeTo.BackgroundColor = ActiveTheme.Instance.AvailableThemes[index].primaryAccentColor;
			};

			colorButton.MouseLeaveBounds += (sender, mouseEvent) =>
			{
				colorToChangeTo.BackgroundColor = ActiveTheme.Instance.PrimaryAccentColor;
			};

			return colorButton;
		}
开发者ID:broettge,项目名称:MatterControl,代码行数:30,代码来源:ThemeColorSelectorWidget.cs


示例3: SetupStepComPortManual

		public SetupStepComPortManual()
		{
			FlowLayoutWidget printerComPortContainer = createComPortContainer();
			contentRow.AddChild(printerComPortContainer);

			//Construct buttons
			nextButton = textImageButtonFactory.Generate("Done".Localize());
			nextButton.Click += (s, e) => UiThread.RunOnIdle(Parent.Close);
			nextButton.Visible = false;

			connectButton = textImageButtonFactory.Generate("Connect".Localize());
			connectButton.Click += ConnectButton_Click;

			refreshButton = textImageButtonFactory.Generate("Refresh".Localize());
			refreshButton.Click += (s, e) => UiThread.RunOnIdle(WizardWindow.ChangeToPage<SetupStepComPortManual>);

			//Add buttons to buttonContainer
			footerRow.AddChild(nextButton);
			footerRow.AddChild(connectButton);
			footerRow.AddChild(refreshButton);
			footerRow.AddChild(new HorizontalSpacer());
			footerRow.AddChild(cancelButton);

			PrinterConnectionAndCommunication.Instance.CommunicationStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents);
		}
开发者ID:unlimitedbacon,项目名称:MatterControl,代码行数:25,代码来源:SetupStepComPortManual.cs


示例4: AddChildElements

        protected override void AddChildElements()
        {
            actionBarButtonFactory.invertImageLocation = false;
            string connectString = new LocalizedString("Connect").Translated;
            connectPrinterButton = actionBarButtonFactory.Generate(connectString, "icon_power_32x32.png");
            connectPrinterButton.Margin = new BorderDouble(3, 0);
            connectPrinterButton.VAnchor = VAnchor.ParentCenter;
            connectPrinterButton.Cursor = Cursors.Hand;

            string disconnectString = new LocalizedString("Disconnect").Translated;
            disconnectPrinterButton = actionBarButtonFactory.Generate(disconnectString, "icon_power_32x32.png");
            disconnectPrinterButton.Margin = new BorderDouble(3, 0);
            disconnectPrinterButton.VAnchor = VAnchor.ParentCenter;
            disconnectPrinterButton.Visible = false;
            disconnectPrinterButton.Cursor = Cursors.Hand;

            selectActivePrinterButton = new PrinterSelectButton();
            selectActivePrinterButton.HAnchor = HAnchor.ParentLeftRight;
            selectActivePrinterButton.Cursor = Cursors.Hand;

            actionBarButtonFactory.invertImageLocation = true;

            this.AddChild(connectPrinterButton);
            this.AddChild(disconnectPrinterButton);
            this.AddChild(selectActivePrinterButton);
            this.AddChild(CreateOptionsMenu());
        }
开发者ID:rubenkar,项目名称:MatterControl,代码行数:27,代码来源:PrinterActionRow.cs


示例5: SetupStepComPortTwo

        public SetupStepComPortTwo(ConnectionWindow windowController, GuiWidget containerWindowToClose, PrinterSetupStatus setupPrinterStatus)
            : base(windowController, containerWindowToClose, setupPrinterStatus)
        {

            startingPortNames = SerialPort.GetPortNames();
            contentRow.AddChild(createPrinterConnectionMessageContainer());
            {
                //Construct buttons
				nextButton = textImageButtonFactory.Generate(new LocalizedString("Done").Translated);
                nextButton.Click += new ButtonBase.ButtonEventHandler(NextButton_Click);
                nextButton.Visible = false;

				connectButton = textImageButtonFactory.Generate(new LocalizedString("Connect").Translated);
                connectButton.Click += new ButtonBase.ButtonEventHandler(ConnectButton_Click);

                PrinterCommunication.Instance.ConnectionStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents);

                GuiWidget hSpacer = new GuiWidget();
                hSpacer.HAnchor = HAnchor.ParentLeftRight;

                //Add buttons to buttonContainer
                footerRow.AddChild(nextButton);
                footerRow.AddChild(connectButton);
                footerRow.AddChild(hSpacer);

                footerRow.AddChild(cancelButton);
            }
        }
开发者ID:rubenkar,项目名称:MatterControl,代码行数:28,代码来源:SetupStepComPortTwo.cs


示例6: CameraCalibrationWidget

        public CameraCalibrationWidget()
        {
            SuspendLayout();

            FlowLayoutWidget TopToBottomLayout = new FlowLayoutWidget(FlowDirection.TopToBottom);
            {
                FlowLayoutWidget TopButtons = new FlowLayoutWidget(FlowDirection.LeftToRight);
                {
                    connectButton = new Button("Connect");
                    connectButton.Click += new ButtonBase.ButtonEventHandler(ConnectButton_Click);

                    TopButtons.AddChild(connectButton);
                }
                TopToBottomLayout.AddChild(TopButtons);

                xyJogControls = new XYJogControls();
                TopToBottomLayout.AddChild(xyJogControls);

                disableMotors = new Button("Disable Motors");
                disableMotors.Click += new ButtonBase.ButtonEventHandler(disableMotors_Click);
                TopToBottomLayout.AddChild(disableMotors);
            }

            AddChild(TopToBottomLayout);

            ResumeLayout();
        }
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:27,代码来源:CameraCalibrationWidget.cs


示例7: SetupStepMakeModelName

        public SetupStepMakeModelName(ConnectionWindow windowController, GuiWidget containerWindowToClose, PrinterSetupStatus setupPrinter = null)
            : base(windowController, containerWindowToClose, setupPrinter)
        {
            //Construct inputs
            printerNameContainer = createPrinterNameContainer();
            printerMakeContainer = createPrinterMakeContainer();
            printerModelContainer = createPrinterModelContainer();

            //Add inputs to main container
            contentRow.AddChild(printerNameContainer);
            contentRow.AddChild(printerMakeContainer);
            contentRow.AddChild(printerModelContainer);

            //Construct buttons
			nextButton = textImageButtonFactory.Generate(new LocalizedString("Save & Continue").Translated);
            nextButton.Click += new ButtonBase.ButtonEventHandler(NextButton_Click);

            GuiWidget hSpacer = new GuiWidget();
            hSpacer.HAnchor = HAnchor.ParentLeftRight;

            //Add buttons to buttonContainer
            footerRow.AddChild(nextButton);
            footerRow.AddChild(hSpacer);
            footerRow.AddChild(cancelButton);

            SetElementState();
        }
开发者ID:rubenkar,项目名称:MatterControl,代码行数:27,代码来源:SetupStepMakeModelName.cs


示例8: SetupStepInstallDriver

		public SetupStepInstallDriver(ConnectionWindow windowController, GuiWidget containerWindowToClose, PrinterSetupStatus setupPrinterStatus)
			: base(windowController, containerWindowToClose, setupPrinterStatus)
		{
			this.driversToInstall = this.currentPrinterSetupStatus.DriversToInstall;

			headerLabel.Text = string.Format(LocalizedString.Get("Install Communication Driver"));
			printerDriverContainer = createPrinterDriverContainer();
			contentRow.AddChild(printerDriverContainer);
			{
				//Construct buttons
				installButton = textImageButtonFactory.Generate(LocalizedString.Get("Install Driver"));
				installButton.Click += (sender, e) =>
				{
					UiThread.RunOnIdle(installButton_Click);
				};

				skipButton = textImageButtonFactory.Generate(LocalizedString.Get("Skip"));
				skipButton.Click += new EventHandler(skipButton_Click);

				GuiWidget hSpacer = new GuiWidget();
				hSpacer.HAnchor = HAnchor.ParentLeftRight;

				//Add buttons to buttonContainer
				footerRow.AddChild(installButton);
				footerRow.AddChild(skipButton);
				footerRow.AddChild(hSpacer);

				footerRow.AddChild(cancelButton);
			}
		}
开发者ID:fuding,项目名称:MatterControl,代码行数:30,代码来源:SetupStepInstallDriver.cs


示例9: SetupStepInstallDriver

		public SetupStepInstallDriver(ConnectionWizard windowController)
			: base(windowController)
		{
			headerLabel.Text = string.Format(LocalizedString.Get("Install Communication Driver"));
			printerDriverContainer = createPrinterDriverContainer();
			contentRow.AddChild(printerDriverContainer);
			{
				//Construct buttons
				installButton = textImageButtonFactory.Generate(LocalizedString.Get("Install Driver"));
				installButton.Click += (sender, e) =>
				{
					UiThread.RunOnIdle(() =>
					{
						bool canContinue = this.InstallDriver();
						if (canContinue)
						{
							connectionWizard.ChangeToSetupBaudOrComPortOne();
						}
					});
				};

				skipButton = textImageButtonFactory.Generate(LocalizedString.Get("Skip"));
				skipButton.Click += (s, e) => connectionWizard.ChangeToSetupBaudOrComPortOne();

				//Add buttons to buttonContainer
				footerRow.AddChild(installButton);
				footerRow.AddChild(skipButton);
				footerRow.AddChild(new HorizontalSpacer());
				footerRow.AddChild(cancelButton);
			}
		}
开发者ID:broettge,项目名称:MatterControl,代码行数:31,代码来源:SetupStepInstallDriver.cs


示例10: SetupStepComPortManual

		public SetupStepComPortManual(ConnectionWindow windowController, GuiWidget containerWindowToClose, PrinterSetupStatus setupPrinterStatus)
			: base(windowController, containerWindowToClose, setupPrinterStatus)
		{
			linkButtonFactory.fontSize = 8;

			FlowLayoutWidget printerComPortContainer = createComPortContainer();
			contentRow.AddChild(printerComPortContainer);
			{
				//Construct buttons
				nextButton = textImageButtonFactory.Generate(LocalizedString.Get("Done"));
				nextButton.Click += new EventHandler(NextButton_Click);
				nextButton.Visible = false;

				connectButton = textImageButtonFactory.Generate(LocalizedString.Get("Connect"));
				connectButton.Click += new EventHandler(ConnectButton_Click);

				PrinterConnectionAndCommunication.Instance.CommunicationStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents);

				refreshButton = textImageButtonFactory.Generate(LocalizedString.Get("Refresh"));
				refreshButton.Click += new EventHandler(RefreshButton_Click);

				GuiWidget hSpacer = new GuiWidget();
				hSpacer.HAnchor = HAnchor.ParentLeftRight;

				//Add buttons to buttonContainer
				footerRow.AddChild(nextButton);
				footerRow.AddChild(connectButton);
				footerRow.AddChild(refreshButton);
				footerRow.AddChild(hSpacer);
				footerRow.AddChild(cancelButton);
			}
		}
开发者ID:rorypond,项目名称:MatterControl,代码行数:32,代码来源:SetupStepComPortManual.cs


示例11: CreateButton

		private void CreateButton(HAnchor hAnchor, VAnchor vAnchor)
		{
			Button anchorButton = new Button(hAnchor.ToString() + " " + vAnchor.ToString());
			anchorButton.HAnchor = hAnchor;
			anchorButton.VAnchor = vAnchor;
			anchorButton.Margin = new BorderDouble(offset);
			AddChild(anchorButton);
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:8,代码来源:ButtonAnchorTest.cs


示例12: PlayfieldView

        public PlayfieldView(RectangleDouble bounds)
        {
            BoundsRelativeToParent = bounds;

            GameImageSequence menuButtonSequence = (GameImageSequence)DataAssetCache.Instance.GetAsset(typeof(GameImageSequence), "MenuButtonFromGame");
            Button menuButton = new Button(400, 12, new ButtonViewThreeImage(menuButtonSequence.GetImageByIndex(0), menuButtonSequence.GetImageByIndex(1), menuButtonSequence.GetImageByIndex(2)));
            AddChild(menuButton);
            menuButton.Click += new Button.ButtonEventHandler(EscapeMenu);
        }
开发者ID:jeske,项目名称:agg-sharp,代码行数:9,代码来源:PlayFieldView.cs


示例13: CreateButton

		private void CreateButton(HAnchor hAnchor, VAnchor vAnchor)
		{
			Button anchorButton = new Button(hAnchor.ToString() + " - " + vAnchor.ToString());
			anchorButton.BackgroundColor = RGBA_Bytes.Red;
			anchorButton.HAnchor = hAnchor;
			anchorButton.VAnchor = vAnchor;
			anchorButton.Margin = new BorderDouble(offset);
			AddChild(anchorButton);
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:9,代码来源:Center+Anchor.cs


示例14: CreditsMenu

        public CreditsMenu(RectangleDouble bounds)
        {
            BoundsRelativeToParent = bounds;

            GameImageSequence cancelButtonSequence = (GameImageSequence)DataAssetCache.Instance.GetAsset(typeof(GameImageSequence), "NumPlayersCancelButton");
            Button cancelGameButton = new Button(400, 200, new ButtonViewThreeImage(cancelButtonSequence.GetImageByIndex(0), cancelButtonSequence.GetImageByIndex(1), cancelButtonSequence.GetImageByIndex(2)));
            AddChild(cancelGameButton);
            cancelGameButton.Click += new Button.ButtonEventHandler(OnCancelMenuButton);
        }
开发者ID:jeske,项目名称:agg-sharp,代码行数:9,代码来源:CreditsScreen.cs


示例15: SplitButton

		public SplitButton(string buttonText, Direction direction = Direction.Down)
			: base(FlowDirection.LeftToRight, HAnchor.FitToChildren, VAnchor.FitToChildren)
		{
			defaultButton = CreateDefaultButton(buttonText);
			altChoices = CreateDropDown(direction);

			defaultButton.VAnchor = VAnchor.ParentCenter;

			AddChild(defaultButton);
			AddChild(altChoices);
		}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:11,代码来源:SplitButton.cs


示例16: SetupConnectionWidgetBase

		public SetupConnectionWidgetBase(ConnectionWindow windowController, GuiWidget containerWindowToClose, PrinterSetupStatus printerSetupStatus = null)
			: base(windowController, containerWindowToClose)
		{
			SetDisplayAttributes();

			if (printerSetupStatus == null)
			{
				this.currentPrinterSetupStatus = new PrinterSetupStatus();
			}
			else
			{
				this.currentPrinterSetupStatus = printerSetupStatus;
			}

			cancelButton = textImageButtonFactory.Generate(LocalizedString.Get("Cancel"));
			cancelButton.Name = "Setup Connection Cancel Button";
			cancelButton.Click += new EventHandler(CancelButton_Click);

			//Create the main container
			GuiWidget mainContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
			mainContainer.AnchorAll();
			mainContainer.Padding = new BorderDouble(3, 5, 3, 5);
			mainContainer.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;

			//Create the header row for the widget
			headerRow = new FlowLayoutWidget(FlowDirection.LeftToRight);
			headerRow.Margin = new BorderDouble(0, 3, 0, 0);
			headerRow.Padding = new BorderDouble(0, 3, 0, 3);
			headerRow.HAnchor = HAnchor.ParentLeftRight;
			{
				string defaultHeaderTitle = LocalizedString.Get("3D Printer Setup");
				headerLabel = new TextWidget(defaultHeaderTitle, pointSize: 14);
				headerLabel.AutoExpandBoundsToText = true;
				headerLabel.TextColor = this.defaultTextColor;
				headerRow.AddChild(headerLabel);
			}

			//Create the main control container
			contentRow = new FlowLayoutWidget(FlowDirection.TopToBottom);
			contentRow.Padding = new BorderDouble(5);
			contentRow.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor;
			contentRow.HAnchor = HAnchor.ParentLeftRight;
			contentRow.VAnchor = VAnchor.ParentBottomTop;

			//Create the footer (button) container
			footerRow = new FlowLayoutWidget(FlowDirection.LeftToRight);
			footerRow.HAnchor = HAnchor.ParentLeft | HAnchor.ParentRight;
			footerRow.Margin = new BorderDouble(0, 3);

			mainContainer.AddChild(headerRow);
			mainContainer.AddChild(contentRow);
			mainContainer.AddChild(footerRow);
			this.AddChild(mainContainer);
		}
开发者ID:rorypond,项目名称:MatterControl,代码行数:54,代码来源:SetupConnectionWidgetBase.cs


示例17: GetCameraControl

		private FlowLayoutWidget GetCameraControl()
		{
			FlowLayoutWidget buttonRow = new FlowLayoutWidget();
			buttonRow.HAnchor = HAnchor.ParentLeftRight;
			buttonRow.Margin = new BorderDouble(0, 4);

			ImageBuffer cameraIconImage = StaticData.Instance.LoadIcon("camera-24x24.png",24,24).InvertLightness();
			cameraIconImage.SetRecieveBlender(new BlenderPreMultBGRA());
			int iconSize = (int)(24 * GuiWidget.DeviceScale);

			if (!ActiveTheme.Instance.IsDarkTheme)
			{
				cameraIconImage.InvertLightness();
			}

			ImageWidget cameraIcon = new ImageWidget(cameraIconImage);
			cameraIcon.Margin = new BorderDouble(right: 6);

			TextWidget cameraLabel = new TextWidget("Camera Monitoring".Localize());
			cameraLabel.AutoExpandBoundsToText = true;
			cameraLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
			cameraLabel.VAnchor = VAnchor.ParentCenter;

			openCameraButton = textImageButtonFactory.Generate("Preview".Localize().ToUpper());
			openCameraButton.Click += new EventHandler(openCameraPreview_Click);
			openCameraButton.Margin = new BorderDouble(left: 6);

			buttonRow.AddChild(cameraIcon);
			buttonRow.AddChild(cameraLabel);
			buttonRow.AddChild(new HorizontalSpacer());
			buttonRow.AddChild(openCameraButton);

			if (ApplicationSettings.Instance.get(ApplicationSettingsKey.HardwareHasCamera) == "true")
			{
				GuiWidget publishImageSwitchContainer = new FlowLayoutWidget();
				publishImageSwitchContainer.VAnchor = VAnchor.ParentCenter;
				publishImageSwitchContainer.Margin = new BorderDouble(left: 16);

				CheckBox toggleSwitch = ImageButtonFactory.CreateToggleSwitch(ActiveSliceSettings.Instance.GetValue<bool>(SettingsKey.publish_bed_image));
				toggleSwitch.CheckedStateChanged += (sender, e) =>
				{
					CheckBox thisControl = sender as CheckBox;
					ActiveSliceSettings.Instance.SetValue(SettingsKey.publish_bed_image, thisControl.Checked ? "1" : "0");
				};
				publishImageSwitchContainer.AddChild(toggleSwitch);

				publishImageSwitchContainer.SetBoundsToEncloseChildren();

				buttonRow.AddChild(publishImageSwitchContainer);
			}

			return buttonRow;
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:53,代码来源:PrinterSettingsView.cs


示例18: ContactFormWidget

        public ContactFormWidget(string subjectText, string bodyText)
        {
            SetButtonAttributes();
            AnchorAll();

            cancelButton = textImageButtonFactory.Generate(LocalizedString.Get("Cancel"));
            submitButton = textImageButtonFactory.Generate(LocalizedString.Get("Submit"));
            doneButton = textImageButtonFactory.Generate(LocalizedString.Get("Done"));
            doneButton.Visible = false;

            DoLayout(subjectText, bodyText);
            AddButtonHandlers();
        }
开发者ID:klewisjohnson,项目名称:MatterControl,代码行数:13,代码来源:ContactForm.cs


示例19: SetupStepComPortOne

		public SetupStepComPortOne()
		{
			contentRow.AddChild(createPrinterConnectionMessageContainer());
			{
				//Construct buttons
				nextButton = textImageButtonFactory.Generate("Continue".Localize());
				nextButton.Click += (s, e) => WizardWindow.ChangeToPage<SetupStepComPortTwo>();

				//Add buttons to buttonContainer
				footerRow.AddChild(nextButton);
				footerRow.AddChild(new HorizontalSpacer());
				footerRow.AddChild(cancelButton);
			}
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:14,代码来源:SetupStepComPortOne.cs


示例20: MessageBox

        public MessageBox(String message, string windowTitle, MessageType messageType, double width, double height)
            : base(width, height)
        {
            BackgroundColor = new RGBA_Bytes(50, 50, 50, 240);
            FlowLayoutWidget topToBottomFlow = new FlowLayoutWidget(FlowDirection.TopToBottom);
            topToBottomFlow.HAnchor = Agg.UI.HAnchor.ParentCenter;
            topToBottomFlow.VAnchor = Agg.UI.VAnchor.ParentCenter;
            topToBottomFlow.AddChild(new TextWidget(message, textColor: RGBA_Bytes.White));

            Title = windowTitle;

            // add a spacer
            topToBottomFlow.AddChild(new GuiWidget(10, 10));

            switch (messageType)
            {
                case MessageType.YES_NO:
                    {
                        FlowLayoutWidget yesNoButtonsFlow = new FlowLayoutWidget();

                        Button yesButton = new Button("Yes");
                        yesButton.Click += new ButtonBase.ButtonEventHandler(okButton_Click);
                        yesNoButtonsFlow.AddChild(yesButton);

                        Button noButton = new Button("No");
                        noButton.Click += new ButtonBase.ButtonEventHandler(noButton_Click);
                        yesNoButtonsFlow.AddChild(noButton);

                        topToBottomFlow.AddChild(yesNoButtonsFlow);
                    }
                    break;

                case MessageType.OK:
                    {
                        Button okButton = new Button("Ok");
                        okButton.Click += new ButtonBase.ButtonEventHandler(okButton_Click);
                        topToBottomFlow.AddChild(okButton);
                    }
                    break;

                default:
                    throw new NotImplementedException();
            }

            topToBottomFlow.SetBoundsToEncloseChildren();

            AddChild(topToBottomFlow);

            IsModal = true;
        }
开发者ID:jeske,项目名称:agg-sharp,代码行数:50,代码来源:MessageBox.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UI.CheckBox类代码示例发布时间:2022-05-26
下一篇:
C# Image.ImageBuffer类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap