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);
			}
		}
        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);
            }
        }
		public SetupStepComPortManual(ConnectionWizard connectionWizard) : base(connectionWizard)
		{
			linkButtonFactory.fontSize = 8;

			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) => connectionWizard.ChangeToSetupComPortManual();

			//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);
		}
예제 #4
0
        public SetupStepComPortManual(ConnectionWizard connectionWizard) : base(connectionWizard)
        {
            linkButtonFactory.fontSize = 8;

            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) => connectionWizard.ChangeToSetupComPortManual();

            //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);
        }
예제 #5
0
 public static void Show()
 {
     if (connectionWindow != null)
     {
         connectionWindow.BringToFront();
     }
     else
     {
         connectionWindow         = new ConnectionWizard();
         connectionWindow.Closed += (s, e) => connectionWindow = null;
     }
 }
예제 #6
0
		public static void Show()
		{
			if (connectionWindow != null)
			{
				connectionWindow.BringToFront();
			}
			else
			{ 
				connectionWindow = new ConnectionWizard();
				connectionWindow.Closed += (s, e) => connectionWindow = null;
			}
		}
예제 #7
0
        public SetupStepComPortOne(ConnectionWizard connectionWizard) : base(connectionWizard)
        {
            contentRow.AddChild(createPrinterConnectionMessageContainer());
            {
                //Construct buttons
                nextButton        = textImageButtonFactory.Generate("Continue".Localize());
                nextButton.Click += (s, e) => connectionWizard.ChangeToSetupCompPortTwo();

                //Add buttons to buttonContainer
                footerRow.AddChild(nextButton);
                footerRow.AddChild(new HorizontalSpacer());
                footerRow.AddChild(cancelButton);
            }
        }
예제 #8
0
		public SetupStepComPortOne(ConnectionWizard connectionWizard) : base(connectionWizard)
		{
			contentRow.AddChild(createPrinterConnectionMessageContainer());
			{
				//Construct buttons
				nextButton = textImageButtonFactory.Generate("Continue".Localize());
				nextButton.Click += (s, e) => connectionWizard.ChangeToSetupCompPortTwo();

				//Add buttons to buttonContainer
				footerRow.AddChild(nextButton);
				footerRow.AddChild(new HorizontalSpacer());
				footerRow.AddChild(cancelButton);
			}
		}
        public SetupStepConfigureConnection(ConnectionWizard connectionWizard) : base(connectionWizard)
        {
            BorderDouble elementMargin = new BorderDouble(top: 5);

            var continueMessage = new TextWidget("Would you like to connect to this printer now?", 0, 0, 12);

            continueMessage.AutoExpandBoundsToText = true;
            continueMessage.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            continueMessage.HAnchor   = HAnchor.ParentLeftRight;
            continueMessage.Margin    = elementMargin;

            var continueMessageTwo = new TextWidget("You can always configure this later.", 0, 0, 10);

            continueMessageTwo.AutoExpandBoundsToText = true;
            continueMessageTwo.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            continueMessageTwo.HAnchor   = HAnchor.ParentLeftRight;
            continueMessageTwo.Margin    = elementMargin;

            var printerErrorMessage = new TextWidget("", 0, 0, 10);

            printerErrorMessage.AutoExpandBoundsToText = true;
            printerErrorMessage.TextColor = RGBA_Bytes.Red;
            printerErrorMessage.HAnchor   = HAnchor.ParentLeftRight;
            printerErrorMessage.Margin    = elementMargin;

            var container = new FlowLayoutWidget(FlowDirection.TopToBottom);

            container.Margin = new BorderDouble(5);
            container.AddChild(continueMessage);
            container.AddChild(continueMessageTwo);
            container.AddChild(printerErrorMessage);
            container.HAnchor = HAnchor.ParentLeftRight;

            //Construct buttons
            var nextButton = textImageButtonFactory.Generate("Connect");

            nextButton.Click += (s, e) => base.connectionWizard.ChangeToSetupBaudOrComPortOne();

            var skipButton = textImageButtonFactory.Generate("Skip");

            skipButton.Click += (s, e) => SaveAndExit();

            //Add buttons to buttonContainer
            footerRow.AddChild(nextButton);
            footerRow.AddChild(skipButton);
            footerRow.AddChild(new HorizontalSpacer());
            footerRow.AddChild(cancelButton);
        }
예제 #10
0
        public SetupStepBaudRate(ConnectionWizard connectionWizard) : base(connectionWizard)
        {
            linkButtonFactory.fontSize = 8;

            printerBaudRateContainer = createPrinterBaudRateContainer();
            contentRow.AddChild(printerBaudRateContainer);
            {
                nextButton        = textImageButtonFactory.Generate(LocalizedString.Get("Continue"));
                nextButton.Click += new EventHandler(NextButton_Click);

                //Add buttons to buttonContainer
                footerRow.AddChild(nextButton);
                footerRow.AddChild(new HorizontalSpacer());
                footerRow.AddChild(cancelButton);
            }
            BindBaudRateHandlers();
        }
예제 #11
0
		public SetupStepBaudRate(ConnectionWizard connectionWizard) : base(connectionWizard)
		{
			linkButtonFactory.fontSize = 8;

			printerBaudRateContainer = createPrinterBaudRateContainer();
			contentRow.AddChild(printerBaudRateContainer);
			{
				nextButton = textImageButtonFactory.Generate(LocalizedString.Get("Continue"));
				nextButton.Click += new EventHandler(NextButton_Click);

				//Add buttons to buttonContainer
				footerRow.AddChild(nextButton);
				footerRow.AddChild(new HorizontalSpacer());
				footerRow.AddChild(cancelButton);
			}
			BindBaudRateHandlers();
		}
예제 #12
0
        public SetupStepMakeModelName(ConnectionWizard windowController) : base(windowController)
        {
            //Construct inputs
            printerNameContainer = createPrinterNameContainer();
            printerMakeContainer = createPrinterMakeContainer();

            if (printerManufacturerSelector.CountOfMakes == 1)
            {
                ActivePrinter.Make = printerManufacturerSelector.ManufacturerDropList.SelectedValue;

                printerMakeContainer.Visible  = false;
                printerModelContainer         = createPrinterModelContainer(printerManufacturerSelector.ManufacturerDropList.SelectedValue);
                printerModelContainer.Visible = true;
            }
            else
            {
                printerModelContainer = createPrinterModelContainer();
            }

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

            //Construct buttons
            nextButton        = textImageButtonFactory.Generate(LocalizedString.Get("Save & Continue"));
            nextButton.Name   = "Save & Continue Button";
            nextButton.Click += (s, e) =>
            {
                bool canContinue = this.OnSave();
                if (canContinue)
                {
                    UiThread.RunOnIdle(connectionWizard.Close);
                }
            };

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

            usingDefaultName = true;

            SetElementVisibility();
        }
		public SetupStepMakeModelName(ConnectionWizard windowController) : base(windowController)
		{
			//Construct inputs
			printerNameContainer = createPrinterNameContainer();
			printerMakeContainer = createPrinterMakeContainer();

			if (printerManufacturerSelector.CountOfMakes == 1)
			{
				ActivePrinter.Make = printerManufacturerSelector.ManufacturerDropList.SelectedValue;

				printerMakeContainer.Visible = false;
				printerModelContainer = createPrinterModelContainer(printerManufacturerSelector.ManufacturerDropList.SelectedValue);
				printerModelContainer.Visible = true;
			}
			else
			{
				printerModelContainer = createPrinterModelContainer();
			}

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

			//Construct buttons
			nextButton = textImageButtonFactory.Generate(LocalizedString.Get("Save & Continue"));
			nextButton.Name = "Save & Continue Button";
			nextButton.Click += (s, e) =>
			{
				bool canContinue = this.OnSave();
				if (canContinue)
				{
					UiThread.RunOnIdle(connectionWizard.Close);
				}
			};

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

			usingDefaultName = true;

			SetElementVisibility();
		}
예제 #14
0
        public SetupConnectionWidgetBase(ConnectionWizard wizard) : base(wizard)
        {
            SetDisplayAttributes();

            cancelButton        = textImageButtonFactory.Generate("Cancel".Localize());
            cancelButton.Name   = "Setup Connection Cancel Button";
            cancelButton.Click += 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;
            {
                headerLabel = new TextWidget("3D Printer Setup".Localize(), pointSize: 14);
                headerLabel.AutoExpandBoundsToText = true;
                headerLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
                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);
        }
		public SetupConnectionWidgetBase(ConnectionWizard wizard) : base(wizard)
		{
			SetDisplayAttributes();
			
			cancelButton = textImageButtonFactory.Generate("Cancel".Localize());
			cancelButton.Name = "Setup Connection Cancel Button";
			cancelButton.Click += 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;
			{
				headerLabel = new TextWidget("3D Printer Setup".Localize(), pointSize: 14);
				headerLabel.AutoExpandBoundsToText = true;
				headerLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
				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);
		}
		public SetupStepConfigureConnection(ConnectionWizard connectionWizard) : base(connectionWizard)
		{
			BorderDouble elementMargin = new BorderDouble(top: 5);

			var continueMessage = new TextWidget("Would you like to connect to this printer now?", 0, 0, 12);
			continueMessage.AutoExpandBoundsToText = true;
			continueMessage.TextColor = ActiveTheme.Instance.PrimaryTextColor;
			continueMessage.HAnchor = HAnchor.ParentLeftRight;
			continueMessage.Margin = elementMargin;

			var continueMessageTwo = new TextWidget("You can always configure this later.", 0, 0, 10);
			continueMessageTwo.AutoExpandBoundsToText = true;
			continueMessageTwo.TextColor = ActiveTheme.Instance.PrimaryTextColor;
			continueMessageTwo.HAnchor = HAnchor.ParentLeftRight;
			continueMessageTwo.Margin = elementMargin;

			var printerErrorMessage = new TextWidget("", 0, 0, 10);
			printerErrorMessage.AutoExpandBoundsToText = true;
			printerErrorMessage.TextColor = RGBA_Bytes.Red;
			printerErrorMessage.HAnchor = HAnchor.ParentLeftRight;
			printerErrorMessage.Margin = elementMargin;

			var container = new FlowLayoutWidget(FlowDirection.TopToBottom);
			container.Margin = new BorderDouble(5);
			container.AddChild(continueMessage);
			container.AddChild(continueMessageTwo);
			container.AddChild(printerErrorMessage);
			container.HAnchor = HAnchor.ParentLeftRight;

			//Construct buttons
			var nextButton = textImageButtonFactory.Generate("Connect");
			nextButton.Click += (s, e) => base.connectionWizard.ChangeToSetupBaudOrComPortOne();

			var skipButton = textImageButtonFactory.Generate("Skip");
			skipButton.Click += (s, e) => SaveAndExit();

			//Add buttons to buttonContainer
			footerRow.AddChild(nextButton);
			footerRow.AddChild(skipButton);
			footerRow.AddChild(new HorizontalSpacer());
			footerRow.AddChild(cancelButton);
		}
예제 #17
0
		public static void OpenConnectionWindow(bool connectAfterSelection = false)
		{
			if (connectAfterSelection)
			{
				ActiveSliceSettings.ActivePrinterChanged.RegisterEvent(ConnectToActivePrinter, ref staticUnregisterEvents);
			}

			if (connectionWindow == null)
			{
				connectionWindow = new ConnectionWizard();

				connectionWindow.Closed += new EventHandler(ConnectionWindow_Closed);
			}
			else
			{
				if (connectionWindow != null)
				{
					connectionWindow.BringToFront();
				}
			}
		}
예제 #18
0
		public SetupStepComPortTwo(ConnectionWizard windowController) : base(windowController)
		{
			startingPortNames = FrostedSerialPort.GetPortNames();
			contentRow.AddChild(createPrinterConnectionMessageContainer());
			{
				//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;

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

				//Add buttons to buttonContainer
				footerRow.AddChild(nextButton);
				footerRow.AddChild(connectButton);
				footerRow.AddChild(new HorizontalSpacer());
				footerRow.AddChild(cancelButton);
			}
		}
예제 #19
0
        public SetupStepComPortTwo(ConnectionWizard windowController) : base(windowController)
        {
            startingPortNames = FrostedSerialPort.GetPortNames();
            contentRow.AddChild(createPrinterConnectionMessageContainer());
            {
                //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;

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

                //Add buttons to buttonContainer
                footerRow.AddChild(nextButton);
                footerRow.AddChild(connectButton);
                footerRow.AddChild(new HorizontalSpacer());
                footerRow.AddChild(cancelButton);
            }
        }
예제 #20
0
		public ConnectionWidgetBase(ConnectionWizard wizard)
		{
			this.connectionWizard = wizard;
			ActiveTheme.Instance.ThemeChanged.RegisterEvent((s,e) => this.Invalidate(), ref unregisterEvents);
		}
예제 #21
0
		static private void ConnectionWindow_Closed(object sender, EventArgs e)
		{
			connectionWindow = null;
		}
예제 #22
0
 public ConnectionWidgetBase(ConnectionWizard wizard)
 {
     this.connectionWizard = wizard;
     ActiveTheme.Instance.ThemeChanged.RegisterEvent((s, e) => this.Invalidate(), ref unregisterEvents);
 }