Exemplo n.º 1
0
        private XMLFrame CreatePrinterBusyFrame(GUIHost host)
        {
            var xmlFrame = new XMLFrame(0)
            {
                RelativeX      = 0.0f,
                RelativeY      = 0.0f,
                RelativeWidth  = 1f,
                RelativeHeight = 1f
            };

            pleasewaittext = new TextWidget(1)
            {
                Color         = new Color4(byte.MaxValue, 127, 39, byte.MaxValue),
                Text          = "Please wait.\nThe printer is busy perfoming the requested actions.",
                RelativeWidth = 1f,
                Size          = FontSize.Medium,
                Alignment     = QFontAlignment.Centre
            };
            pleasewaittext.SetPosition(0, -30);
            xmlFrame.AddChildElement(pleasewaittext);
            var spriteAnimationWidget = new SpriteAnimationWidget(3);

            spriteAnimationWidget.Init(host, "guicontrols", 0.0f, 768f, 767f, 1023f, 6, 2, 12, 200U);
            spriteAnimationWidget.SetSize(128, 108);
            spriteAnimationWidget.CenterVerticallyInParent   = true;
            spriteAnimationWidget.CenterHorizontallyInParent = true;
            xmlFrame.AddChildElement(spriteAnimationWidget);
            Sprite.pixel_perfect = false;
            return(xmlFrame);
        }
Exemplo n.º 2
0
        public void Init(GUIHost host)
        {
            var scrollFrame = new ScrollFrame(0, this);

            scrollFrame.Init(host);
            scrollFrame.RelativeWidth  = 1f;
            scrollFrame.RelativeHeight = 1f;
            AddChildElement(scrollFrame);
            var imageWidget = new ImageWidget(0, scrollFrame);

            imageWidget.Init(host, "guicontrols", 0.0f, 737f, 128f, 767f, 0.0f, 737f, 128f, 767f, 0.0f, 737f, 128f, 767f);
            imageWidget.Width      = 129;
            imageWidget.Height     = 31;
            imageWidget.Y          = 10;
            imageWidget.X          = 10;
            imageWidget.SandBoxing = false;
            scrollFrame.AddChildElement(imageWidget);
            var versionText = Version.VersionText;
            var textWidget  = new TextWidget(0, scrollFrame)
            {
                Text       = Locale.GlobalLocale.T("T_AboutText") + versionText,
                Size       = FontSize.Medium,
                Alignment  = QFontAlignment.Left,
                VAlignment = TextVerticalAlignment.Top,
                Color      = new Color4(0.5f, 0.5f, 0.5f, 1f)
            };

            textWidget.SetPosition(10, 60);
            textWidget.Height        = 300;
            textWidget.RelativeWidth = 0.8f;
            scrollFrame.AddChildElement(textWidget);
            textWidget.IgnoreMouse = false;
        }
Exemplo n.º 3
0
        private void CreateStandardElements()
        {
            SetSize(750, 500);
            var borderedImageFrame = new BorderedImageFrame(ID, null);

            borderedImageFrame.Init(host, "guicontrols", 640f, 320f, 704f, 383f, 41, 8, 64, 35, 8, 64);
            borderedImageFrame.SetSize(750, 500);
            borderedImageFrame.CenterHorizontallyInParent = true;
            borderedImageFrame.CenterVerticallyInParent   = true;
            AddChildElement(borderedImageFrame);
            AutoCenterYOffset          = 0;
            CenterHorizontallyInParent = true;
            CenterVerticallyInParent   = true;
            var textWidget = new TextWidget(600);

            textWidget.SetPosition(50, 2);
            textWidget.SetSize(500, 35);
            textWidget.Text      = "Advanced Print Settings";
            textWidget.Alignment = QFontAlignment.Left;
            textWidget.Size      = FontSize.Large;
            textWidget.Color     = new Color4(0.5f, 0.5f, 0.5f, 1f);
            AddChildElement(textWidget);
            var x = 10;

            AddChildElement(CreateUserOptionButton(host, "OK", AdvancedPrintSettingsFrame.AdvanceSettingsButtons.OK, x, -42, 100, 32, ""));
            int num;

            AddChildElement(CreateUserOptionButton(host, "Cancel", AdvancedPrintSettingsFrame.AdvanceSettingsButtons.Cancel, num = x + 110, -42, 100, 32, ""));
            AddChildElement(CreateUserOptionButton(host, "Reset", AdvancedPrintSettingsFrame.AdvanceSettingsButtons.Reset, -110, -42, 100, 32, ""));
            OK_Button = FindChildElement(613) as ButtonWidget;
        }
Exemplo n.º 4
0
        public void Init(GUIHost host)
        {
            m_oMainFrame_BasicCalibration = new XMLFrame();
            var calibrationPanel = Resources.AdvancedCalibrationPanel;

            m_oMainFrame_BasicCalibration.Init(host, calibrationPanel, new ButtonCallback(MyButtonCallback));
            m_oMainFrame_BasicCalibration.SetPosition(0, 0);
            m_oMainFrame_BasicCalibration.RelativeWidth  = 1f;
            m_oMainFrame_BasicCalibration.RelativeHeight = 1f;
            AddChildElement(m_oMainFrame_BasicCalibration);
            m_G32SettingsCog_button            = (ButtonWidget)m_oMainFrame_BasicCalibration.FindChildElement(6);
            m_oebwBacklashX_edit               = (EditBoxWidget)m_oMainFrame_BasicCalibration.FindChildElement(7);
            m_oebwBacklashY_edit               = (EditBoxWidget)m_oMainFrame_BasicCalibration.FindChildElement(8);
            m_oebwBacklashSpeed_edit           = (EditBoxWidget)m_oMainFrame_BasicCalibration.FindChildElement(9);
            m_obwCalibratePrintBorder_button   = (ButtonWidget)m_oMainFrame_BasicCalibration.FindChildElement(5);
            m_obwCalibrateBedlocation_button   = (ButtonWidget)m_oMainFrame_BasicCalibration.FindChildElement(2);
            m_oebwCalibrationOffset_edit       = (EditBoxWidget)m_oMainFrame_BasicCalibration.FindChildElement(15);
            m_oSubFrame_CalibrationOffsetFrame = (Frame)m_oMainFrame_BasicCalibration.FindChildElement(3002);
            m_oMainFrame_G32Calibration        = new XMLFrame();
            var calibrationGantryPanel = Resources.AdvancedCalibrationGantryPanel;

            m_oMainFrame_G32Calibration.Init(host, calibrationGantryPanel, new ButtonCallback(MyButtonCallback));
            m_oMainFrame_G32Calibration.Visible = false;
            m_oMainFrame_G32Calibration.Enabled = false;
            m_oMainFrame_G32Calibration.SetPosition(0, 0);
            m_oMainFrame_G32Calibration.RelativeWidth  = 1f;
            m_oMainFrame_G32Calibration.RelativeHeight = 1f;
            AddChildElement(m_oMainFrame_G32Calibration);
            m_obwCalibrateBedOrientation_button = (ButtonWidget)m_oMainFrame_G32Calibration.FindChildElement(3);
            m_oMainFrame_Busy = new Frame(0);
            m_oMainFrame_Busy.SetPosition(0, 0);
            m_oMainFrame_Busy.RelativeWidth  = 1f;
            m_oMainFrame_Busy.RelativeHeight = 1f;
            m_otwStatusText = new TextWidget(1001)
            {
                Text       = "",
                Size       = FontSize.Medium,
                Alignment  = QFontAlignment.Left,
                VAlignment = TextVerticalAlignment.Top
            };
            m_otwStatusText.SetPosition(16, 16);
            m_otwStatusText.SetSize(500, 320);
            m_otwStatusText.Color   = new Color4(0.25f, 0.25f, 0.25f, 1f);
            m_otwStatusText.Visible = false;
            m_otwStatusText.Enabled = false;
            m_oMainFrame_Busy.AddChildElement(m_otwStatusText);
            m_osawProgressWidget = new SpriteAnimationWidget(1);
            m_osawProgressWidget.Init(host, "guicontrols", 0.0f, 768f, 767f, 1023f, 6, 2, 12, 200U);
            m_osawProgressWidget.SetSize(128, 108);
            m_osawProgressWidget.SetPosition(14, 192);
            m_osawProgressWidget.Visible = false;
            m_osawProgressWidget.CenterHorizontallyInParent = true;
            m_osawProgressWidget.CenterVerticallyInParent   = true;
            m_oMainFrame_Busy.AddChildElement(m_osawProgressWidget);
            AddChildElement(m_oMainFrame_Busy);
        }
Exemplo n.º 5
0
        public void Init(GUIHost host)
        {
            var borderedImageFrame = new BorderedImageFrame(ID, null);

            AddChildElement(borderedImageFrame);
            SetSize(480, 340);
            borderedImageFrame.Init(host, "guicontrols", 640f, 256f, 703f, 319f, 8, 8, 64, 8, 8, 64);
            borderedImageFrame.SetSize(480, 340);
            borderedImageFrame.CenterHorizontallyInParent = true;
            borderedImageFrame.CenterVerticallyInParent   = true;
            var textWidget = new TextWidget(0)
            {
                Size       = FontSize.Medium,
                Alignment  = QFontAlignment.Centre,
                VAlignment = TextVerticalAlignment.Middle,
                Text       = "T_PrintDialog_SlicingWarning",
                Color      = new Color4(100, 100, 100, byte.MaxValue)
            };

            textWidget.SetPosition(0, 10);
            textWidget.SetSize(480, 80);
            textWidget.CenterHorizontallyInParent = true;
            borderedImageFrame.AddChildElement(textWidget);
            pleasewait_text = new TextWidget(0)
            {
                Size       = FontSize.Medium,
                Alignment  = QFontAlignment.Centre,
                VAlignment = TextVerticalAlignment.Middle,
                Text       = "T_PrintDialog_SlicingPleaseWait",
                Color      = new Color4(100, 100, 100, byte.MaxValue)
            };
            pleasewait_text.SetPosition(0, 109);
            pleasewait_text.SetSize(247, 50);
            pleasewait_text.CenterHorizontallyInParent = true;
            borderedImageFrame.AddChildElement(pleasewait_text);
            progressbar = new ProgressBarWidget(0);
            progressbar.Init(host, "guicontrols", 944f, 96f, 960f, 144f, 2, 2, 16, 2, 2, 16);
            progressbar.SetPosition(42, 185);
            progressbar.SetSize(401, 24);
            progressbar.PercentComplete = 0.0f;
            borderedImageFrame.AddChildElement(progressbar);
            cancel_button = new ButtonWidget(0);
            cancel_button.Init(host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            cancel_button.Size = FontSize.Medium;
            cancel_button.Text = "Cancel";
            cancel_button.SetGrowableWidth(4, 4, 32);
            cancel_button.SetGrowableHeight(4, 4, 32);
            cancel_button.SetSize(100, 32);
            cancel_button.SetPosition(0, -46);
            cancel_button.CenterHorizontallyInParent = true;
            cancel_button.SetCallback(new ButtonCallback(MyButtonCallback));
            borderedImageFrame.AddChildElement(cancel_button);
        }
Exemplo n.º 6
0
 private void CreateErrorWarningMessage()
 {
     ErrorWarningMessage = new TextWidget();
     ErrorWarningMessage.SetPosition(300, -45);
     ErrorWarningMessage.SetSize(500, 35);
     ErrorWarningMessage.Text      = "Testing one two three";
     ErrorWarningMessage.Alignment = QFontAlignment.Left;
     ErrorWarningMessage.Size      = FontSize.Large;
     ErrorWarningMessage.Color     = new Color4(0.5f, 0.5f, 0.5f, 1f);
     ErrorWarningMessage.Visible   = false;
     AddChildElement(ErrorWarningMessage);
 }
Exemplo n.º 7
0
        public void Init(GUIHost host)
        {
            SetSize(480, 340);
            var borderedImageFrame = new BorderedImageFrame(ID, null);

            borderedImageFrame.Init(host, "guicontrols", 640f, 256f, 703f, 319f, 8, 8, 64, 8, 8, 64);
            borderedImageFrame.SetSize(480, 340);
            borderedImageFrame.CenterHorizontallyInParent = true;
            borderedImageFrame.CenterVerticallyInParent   = true;
            AddChildElement(borderedImageFrame);
            var textWidget = new TextWidget(0)
            {
                Size       = FontSize.Medium,
                Alignment  = QFontAlignment.Centre,
                VAlignment = TextVerticalAlignment.Middle,
                Text       = "T_PrintDialog_PreparingModel",
                Color      = new Color4(100, 100, 100, byte.MaxValue)
            };

            textWidget.SetPosition(0, 10);
            textWidget.SetSize(480, 80);
            textWidget.CenterHorizontallyInParent = true;
            borderedImageFrame.AddChildElement(textWidget);
            var spriteAnimationWidget = new SpriteAnimationWidget(1);

            spriteAnimationWidget.Init(host, "guicontrols", 0.0f, 768f, 767f, 1023f, 6, 2, 12, 200U);
            spriteAnimationWidget.SetSize(128, 108);
            spriteAnimationWidget.SetPosition(238, 100);
            spriteAnimationWidget.CenterHorizontallyInParent = true;
            borderedImageFrame.AddChildElement(spriteAnimationWidget);
            var buttonWidget = new ButtonWidget(101);

            buttonWidget.Init(host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget.Size = FontSize.Medium;
            buttonWidget.Text = "T_Cancel";
            buttonWidget.SetGrowableWidth(4, 4, 32);
            buttonWidget.SetGrowableHeight(4, 4, 32);
            buttonWidget.SetSize(100, 32);
            buttonWidget.SetPosition(0, -46);
            buttonWidget.CenterHorizontallyInParent = true;
            buttonWidget.SetCallback(new ButtonCallback(MyButtonCallback));
            AddChildElement(buttonWidget);
        }
Exemplo n.º 8
0
 public void Init(GUIHost host)
 {
     Sprite.pixel_perfect = true;
     Init(host, "guicontrols", 768f, 384f, 895f, 511f, 14, 14, 64, 14, 14, 64);
     SetSize(300, 100);
     X = 36;
     Y = 0;
     text_information = new TextWidget(0)
     {
         Text       = "Job Started",
         Size       = FontSize.Medium,
         Alignment  = QFontAlignment.Centre,
         VAlignment = TextVerticalAlignment.Middle
     };
     text_information.SetPosition(14, 14);
     text_information.SetSize(272, 72);
     text_information.Color = new Color4(0.25f, 0.25f, 0.25f, 1f);
     AddChildElement(text_information);
     host.AddControlElement(this);
     Sprite.pixel_perfect = false;
 }
Exemplo n.º 9
0
 public void Init(GUIHost host)
 {
     MainFrame = CreateMainFrame(host);
     AddChildElement(MainFrame);
     PrinterBusyFrame = CreatePrinterBusyFrame(host);
     AddChildElement(PrinterBusyFrame);
     Please_Connect_Text = new TextWidget(1)
     {
         Color = new Color4(byte.MaxValue, 127, 39, byte.MaxValue)
     };
     Please_Connect_Text.SetPosition(0, 0);
     Please_Connect_Text.SetSize(400, 200);
     Please_Connect_Text.RelativeWidth  = 1f;
     Please_Connect_Text.RelativeHeight = 1f;
     Please_Connect_Text.Text           = "Sorry, but a printer has not been connected.";
     Please_Connect_Text.Size           = FontSize.Medium;
     Please_Connect_Text.Alignment      = QFontAlignment.Centre;
     Please_Connect_Text.VAlignment     = TextVerticalAlignment.Middle;
     AddChildElement(Please_Connect_Text);
     Calibration_Not_Supported = new TextWidget(1)
     {
         Color = new Color4(byte.MaxValue, 127, 39, byte.MaxValue)
     };
     Calibration_Not_Supported.SetPosition(0, 0);
     Calibration_Not_Supported.SetSize(400, 200);
     Calibration_Not_Supported.RelativeWidth  = 1f;
     Calibration_Not_Supported.RelativeHeight = 1f;
     Calibration_Not_Supported.Text           = "Sorry. Calibration is not currently supported on your printer.";
     Calibration_Not_Supported.Size           = FontSize.Medium;
     Calibration_Not_Supported.Alignment      = QFontAlignment.Centre;
     Calibration_Not_Supported.VAlignment     = TextVerticalAlignment.Middle;
     AddChildElement(Calibration_Not_Supported);
     Calibration_Not_Supported.Visible = false;
     MainFrame.Visible        = false;
     PrinterBusyFrame.Visible = false;
 }
Exemplo n.º 10
0
 public Tooltip(GUIHost host)
     : base(0)
 {
     mytimer = new Stopwatch();
     mytimer.Reset();
     mytimer.Stop();
     this.host = host;
     SetSize(300, 100);
     X                = 0;
     Y                = 0;
     BGColor          = new Color4(byte.MaxValue, byte.MaxValue, 225, byte.MaxValue);
     BorderColor      = new Color4(0, 0, 0, byte.MaxValue);
     text_information = new TextWidget(0)
     {
         Text       = "",
         Size       = FontSize.Medium,
         Alignment  = QFontAlignment.Left,
         VAlignment = TextVerticalAlignment.Middle
     };
     text_information.SetPosition(0, 0);
     text_information.SetSize(272, 72);
     text_information.Color = new Color4(0.25f, 0.25f, 0.25f, 1f);
     AddChildElement(text_information);
 }
Exemplo n.º 11
0
        public MainWindow(int ID, GUIHost host, SettingsManager main_controller, PopupMessageBox messagebox, SpoolerConnection spooler_connection)
            : base(ID)
        {
            settingsManager = main_controller;
            this.messagebox = messagebox;
            this.host       = host;
            Init(host, "guicontrols", 640f, 320f, 704f, 383f, 41, 8, 64, 37, 8, 64);
            SetSize(792, 356);
            var textWidget = new TextWidget(0);

            textWidget.SetPosition(50, 2);
            textWidget.SetSize(500, 35);
            textWidget.Text      = "T_ACCESSORIES";
            textWidget.Alignment = QFontAlignment.Left;
            textWidget.Size      = FontSize.Large;
            textWidget.Color     = new Color4(0.5f, 0.5f, 0.5f, 1f);
            AddChildElement(textWidget);
            var buttonWidget = new ButtonWidget(1)
            {
                X = -40,
                Y = 4
            };

            buttonWidget.SetSize(32, 32);
            buttonWidget.Text          = "";
            buttonWidget.TextColor     = new Color4(0.5f, 0.5f, 0.5f, 1f);
            buttonWidget.TextDownColor = new Color4(1f, 1f, 1f, 1f);
            buttonWidget.TextOverColor = new Color4(0.161f, 0.79f, 0.95f, 1f);
            buttonWidget.Alignment     = QFontAlignment.Left;
            buttonWidget.Init(host, "guicontrols", 704f, 320f, 735f, 351f, 736f, 320f, 767f, 351f, 704f, 352f, 735f, 383f);
            buttonWidget.DontMove = true;
            buttonWidget.SetCallback(new ButtonCallback(MyButtonCallback));
            AddChildElement(buttonWidget);
            tab_frame = new Frame(2)
            {
                X                 = 210,
                Y                 = 45,
                RelativeWidth     = 1f,
                RelativeWidthAdj  = -220,
                RelativeHeight    = 1f,
                RelativeHeightAdj = -55
            };
            AddChildElement(tab_frame);
            m_oTabButtonsVerticalLayout = new ScrollableVerticalLayout();
            m_oTabButtonsVerticalLayout.Init(host);
            m_oTabButtonsVerticalLayout.SetSize(208, 200);
            m_oTabButtonsVerticalLayout.RelativeHeight    = 1f;
            m_oTabButtonsVerticalLayout.RelativeHeightAdj = -40;
            m_oTabButtonsVerticalLayout.Y            = 35;
            m_oTabButtonsVerticalLayout.X            = 0;
            m_oTabButtonsVerticalLayout.BorderWidth  = 0;
            m_oTabButtonsVerticalLayout.BorderHeight = 0;
            m_oTabButtonsVerticalLayout.layoutMode   = Layout.LayoutMode.ResizeLayoutToFitChildren;
            AddChildElement(m_oTabButtonsVerticalLayout);
            Sprite.pixel_perfect = true;
            ButtonWidget tabButton = CreateTabButton(3, "T_AccessoriesTab_Nozzle");

            m_oTabButtonsVerticalLayout.Refresh();
            Sprite.pixel_perfect = false;
            Visible = false;
            CreateNozzlePage(host, spooler_connection, messagebox);
            var num = 1;

            tabButton.Checked = num != 0;
        }
Exemplo n.º 12
0
        private void Init(GUIHost host)
        {
            this.host = host;
            Init(host, "guicontrols", 640f, 320f, 704f, 383f, 41, 8, 64, 35, 8, 64);
            SetSize(792, 356);
            var textWidget = new TextWidget(100);

            textWidget.SetPosition(50, 2);
            textWidget.SetSize(500, 35);
            textWidget.Text      = "Multi-Printer Options";
            textWidget.Alignment = QFontAlignment.Left;
            textWidget.Size      = FontSize.Large;
            textWidget.Color     = new Color4(0.5f, 0.5f, 0.5f, 1f);
            AddChildElement(textWidget);
            var buttonWidget = new ButtonWidget(1000)
            {
                X = -40,
                Y = 4
            };

            buttonWidget.SetSize(32, 32);
            buttonWidget.Text          = "";
            buttonWidget.TextColor     = new Color4(0.5f, 0.5f, 0.5f, 1f);
            buttonWidget.TextDownColor = new Color4(1f, 1f, 1f, 1f);
            buttonWidget.TextOverColor = new Color4(0.161f, 0.79f, 0.95f, 1f);
            buttonWidget.Alignment     = QFontAlignment.Left;
            buttonWidget.Init(host, "guicontrols", 704f, 320f, 735f, 351f, 736f, 320f, 767f, 351f, 704f, 352f, 735f, 383f);
            buttonWidget.DontMove = true;
            buttonWidget.SetCallback(new ButtonCallback(MyButtonCallback));
            AddChildElement(buttonWidget);
            navigation      = new Frame(0, null);
            navigation_left = new ButtonWidget(1005, null)
            {
                Text   = "",
                X      = 16,
                Y      = 0,
                Width  = 32,
                Height = 32
            };
            navigation_left.SetCallback(new ButtonCallback(MyButtonCallback));
            navigation_left.Init(host, "guicontrols", 608f, 0.0f, 639f, 31f, 640f, 0.0f, 671f, 31f, 672f, 0.0f, 703f, 31f, 704f, 0.0f, 735f, 31f);
            navigation_right = new ButtonWidget(1006, null)
            {
                Text   = "",
                X      = -48,
                Y      = 0,
                Width  = 32,
                Height = 32
            };
            navigation_right.SetCallback(new ButtonCallback(MyButtonCallback));
            navigation_right.Init(host, "guicontrols", 608f, 32f, 639f, 63f, 640f, 32f, 671f, 63f, 672f, 32f, 703f, 63f, 704f, 32f, 735f, 63f);
            pagebuttons = new ButtonWidget[31];
            for (var ID = 1032; ID < 1062; ++ID)
            {
                var index = ID - 1032;
                pagebuttons[index] = new ButtonWidget(ID, null)
                {
                    Text   = "",
                    X      = 48 + (ID - 1032) * 24,
                    Y      = 8,
                    Width  = 16,
                    Height = 16
                };
                pagebuttons[index].SetCallback(new ButtonCallback(MyButtonCallback));
                pagebuttons[index].Init(host, "guicontrols", 448f, 192f, 463f, 208f, 480f, 192f, 495f, 208f, 464f, 192f, 479f, 208f);
                pagebuttons[index].DontMove  = true;
                pagebuttons[index].GroupID   = 1;
                pagebuttons[index].ClickType = ButtonType.Checkable;
                pagebuttons[index].Visible   = false;
                navigation.AddChildElement(pagebuttons[index]);
            }
            navigation.AddChildElement(navigation_left);
            navigation.AddChildElement(navigation_right);
            navigation.RelativeWidth = 0.95f;
            navigation.Height        = 32;
            navigation.SetPosition(0, -50);
            navigation.CenterHorizontallyInParent = true;
            AddChildElement(navigation);
            PrinterGrid = new GridLayout(1)
            {
                ColumnWidth    = 130,
                RowHeight      = 150,
                BorderWidth    = 0,
                BorderHeight   = 0,
                RelativeHeight = 0.8f,
                RelativeWidth  = 0.8f
            };
            PrinterGrid.SetPosition(0, 48);
            PrinterGrid.CenterHorizontallyInParent = true;
            AddChildElement(PrinterGrid);
            Sprite.pixel_perfect = false;
            Visible = false;
        }
Exemplo n.º 13
0
        public override void Init()
        {
            var color4_1 = new Color4(246, 246, 246, byte.MaxValue);
            var color4_2 = new Color4(220, 220, 220, byte.MaxValue);
            var color4_3 = new Color4(0.15f, 0.15f, 0.15f, 1f);
            var frame    = new Frame(0)
            {
                BorderColor = color4_2,
                BGColor     = color4_1
            };
            var textWidget1 = new TextWidget(11)
            {
                Color = color4_3
            };

            textWidget1.SetSize(500, 50);
            textWidget1.SetPosition(0, 25);
            textWidget1.Alignment  = QFontAlignment.Centre;
            textWidget1.VAlignment = TextVerticalAlignment.Middle;
            textWidget1.CenterHorizontallyInParent = true;
            textWidget1.Text = "Change Current Temperature Settings:";
            AddChildElement(textWidget1);
            var textWidget2 = new TextWidget(12)
            {
                Color          = new Color4(0.35f, 0.35f, 0.35f, 1f),
                RelativeWidth  = 0.45f,
                RelativeHeight = 0.2f,
                RelativeX      = 0.0f,
                RelativeY      = 0.1f,
                Alignment      = QFontAlignment.Right,
                VAlignment     = TextVerticalAlignment.Middle,
                Text           = "Color:"
            };

            frame.AddChildElement(textWidget2);
            textColor = new TextWidget(14)
            {
                Color          = new Color4(0.35f, 0.35f, 0.35f, 1f),
                RelativeWidth  = 0.45f,
                RelativeHeight = 0.2f,
                RelativeX      = 0.55f,
                RelativeY      = 0.1f,
                Alignment      = QFontAlignment.Left,
                VAlignment     = TextVerticalAlignment.Middle,
                Text           = ""
            };
            frame.AddChildElement(textColor);
            var textWidget3 = new TextWidget(15)
            {
                Color          = new Color4(0.35f, 0.35f, 0.35f, 1f),
                RelativeWidth  = 0.45f,
                RelativeHeight = 0.2f,
                RelativeX      = 0.0f,
                RelativeY      = 0.3f,
                Alignment      = QFontAlignment.Right,
                VAlignment     = TextVerticalAlignment.Middle,
                Text           = "Material:"
            };

            frame.AddChildElement(textWidget3);
            textMaterial = new TextWidget(16)
            {
                Color          = new Color4(0.35f, 0.35f, 0.35f, 1f),
                RelativeWidth  = 0.45f,
                RelativeHeight = 0.2f,
                RelativeX      = 0.55f,
                RelativeY      = 0.3f,
                Alignment      = QFontAlignment.Left,
                VAlignment     = TextVerticalAlignment.Middle,
                Text           = "PLA"
            };
            frame.AddChildElement(textMaterial);
            var textWidget4 = new TextWidget(17)
            {
                Color          = new Color4(0.35f, 0.35f, 0.35f, 1f),
                RelativeWidth  = 0.45f,
                RelativeHeight = 0.2f,
                RelativeX      = 0.0f,
                RelativeY      = 0.5f,
                Alignment      = QFontAlignment.Right,
                VAlignment     = TextVerticalAlignment.Middle,
                Text           = "Temperature:"
            };

            frame.AddChildElement(textWidget4);
            custom_temperature_edit = new EditBoxWidget(13);
            custom_temperature_edit.Init(Host, "guicontrols", 898f, 104f, 941f, 135f);
            custom_temperature_edit.SetGrowableWidth(3, 3, 32);
            custom_temperature_edit.Text    = "";
            custom_temperature_edit.Enabled = true;
            custom_temperature_edit.SetSize(100, 24);
            custom_temperature_edit.Color = color4_3;
            custom_temperature_edit.SetTextWindowBorders(4, 4, 4, 4);
            custom_temperature_edit.RelativeX = 0.55f;
            custom_temperature_edit.RelativeY = 0.55f;
            custom_temperature_edit.SetVisible(true);
            custom_temperature_edit.SetCallbackEnterKey(new EditBoxWidget.EditBoxCallback(TemperatureEditEnterCallback));
            frame.AddChildElement(custom_temperature_edit);
            var buttonWidget1 = new ButtonWidget(20);

            buttonWidget1.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget1.Size = FontSize.Medium;
            buttonWidget1.Text = "Reset";
            buttonWidget1.SetSize(70, 24);
            buttonWidget1.RelativeX = 0.63f;
            buttonWidget1.RelativeY = 0.55f;
            buttonWidget1.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            frame.AddChildElement(buttonWidget1);
            var buttonWidget2 = new ButtonWidget(18, this);

            buttonWidget2.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget2.Color = new Color4(0.5f, 0.5f, 0.5f, 1f);
            buttonWidget2.Size  = FontSize.Large;
            buttonWidget2.SetSize(100, 32);
            buttonWidget2.RelativeX = 0.35f;
            buttonWidget2.RelativeY = 0.8f;
            buttonWidget2.SetGrowableHeight(4, 4, 32);
            buttonWidget2.SetGrowableWidth(4, 4, 32);
            buttonWidget2.Text = "Cancel";
            buttonWidget2.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget2);
            var buttonWidget3 = new ButtonWidget(19, this);

            buttonWidget3.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget3.Color = color4_3;
            buttonWidget3.Size  = FontSize.Large;
            buttonWidget3.SetSize(100, 32);
            buttonWidget3.RelativeX = 0.55f;
            buttonWidget3.RelativeY = 0.8f;
            buttonWidget3.SetGrowableHeight(4, 4, 32);
            buttonWidget3.SetGrowableWidth(4, 4, 32);
            buttonWidget3.Text = "Save";
            buttonWidget3.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget3);
            SetPosition(0, 0);
            RelativeWidth        = 1f;
            RelativeHeight       = 1f;
            frame.RelativeX      = 0.0f;
            frame.RelativeY      = 0.2f;
            frame.RelativeWidth  = 1f;
            frame.RelativeHeight = 0.5f;
            AddChildElement(frame);
        }
Exemplo n.º 14
0
 private void InitGUIElement(GUIHost host, Element2D parent_element)
 {
     status_dialog_frame          = new BorderedImageFrame(2340);
     Sprite.texture_height_pixels = 1024;
     Sprite.texture_width_pixels  = 1024;
     Sprite.pixel_perfect         = true;
     status_dialog_frame.Init(host, "guicontrols", 768f, 384f, 895f, 511f, 14, 14, 64, 14, 14, 64);
     status_dialog_frame.SetSize(420, 160);
     status_dialog_frame.SetPosition(-400, 64);
     status_dialog_frame.Visible = false;
     Sprite.pixel_perfect        = false;
     progress_indicator          = new SpriteAnimationWidget(3);
     progress_indicator.Init(host, "guicontrols", 0.0f, 768f, 767f, 1023f, 6, 2, 12, 200U);
     progress_indicator.SetSize(100, 100);
     progress_indicator.SetPosition(-110, 10);
     progress_indicator.Visible = false;
     status_dialog_frame.AddChildElement(progress_indicator);
     printer_name_text = new TextWidget(2);
     printer_name_text.SetPosition(140, 10);
     printer_name_text.SetSize(250, 30);
     printer_name_text.Text      = Info.serial_number.ToString();
     printer_name_text.Size      = FontSize.Medium;
     printer_name_text.Alignment = QFontAlignment.Left;
     printer_name_text.Color     = new Color4(0.25f, 0.25f, 0.25f, 1f);
     status_dialog_frame.AddChildElement(printer_name_text);
     status_text = new TextWidget(3);
     status_text.SetPosition(140, 40);
     status_text.SetSize(250, 30);
     status_text.Text      = "Please Wait...";
     status_text.Size      = FontSize.Medium;
     status_text.Alignment = QFontAlignment.Left;
     status_text.Color     = new Color4(0.25f, 0.25f, 0.25f, 1f);
     status_dialog_frame.AddChildElement(status_text);
     remain_text = new TextWidget(4);
     remain_text.SetPosition(140, 70);
     remain_text.SetSize(350, 30);
     remain_text.Text      = "Remaining: ...Calculating...";
     remain_text.Size      = FontSize.Medium;
     remain_text.Alignment = QFontAlignment.Left;
     remain_text.Color     = new Color4(0.25f, 0.25f, 0.25f, 1f);
     status_dialog_frame.AddChildElement(remain_text);
     abort_button = new ButtonWidget(0);
     abort_button.Init(host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
     abort_button.Size      = FontSize.Medium;
     abort_button.Text      = "Abort";
     abort_button.TextColor = new Color4(0.95f, 0.5f, 0.0f, 1f);
     abort_button.SetGrowableWidth(4, 4, 32);
     abort_button.SetGrowableHeight(4, 4, 32);
     abort_button.SetSize(90, 32);
     abort_button.SetPosition(140, 110);
     abort_button.SetCallback(new ButtonCallback(MyButtonCallback));
     status_dialog_frame.AddChildElement(abort_button);
     pause_print = new ButtonWidget(1);
     pause_print.Init(host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
     pause_print.Size      = FontSize.Medium;
     pause_print.Text      = "Pause";
     pause_print.TextColor = new Color4(0.95f, 0.5f, 0.0f, 1f);
     pause_print.SetGrowableWidth(4, 4, 32);
     pause_print.SetGrowableHeight(4, 4, 32);
     pause_print.SetSize(90, 32);
     pause_print.SetPosition(250, 110);
     pause_print.SetCallback(new ButtonCallback(MyButtonCallback));
     pause_print.Enabled = true;
     status_dialog_frame.AddChildElement(pause_print);
     continue_print = new ButtonWidget(2);
     continue_print.Init(host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
     continue_print.Size      = FontSize.Medium;
     continue_print.Text      = "Continue";
     continue_print.TextColor = new Color4(0.95f, 0.5f, 0.0f, 1f);
     continue_print.SetGrowableWidth(4, 4, 32);
     continue_print.SetGrowableHeight(4, 4, 32);
     continue_print.SetSize(100, 32);
     continue_print.SetPosition(250, 110);
     continue_print.SetCallback(new ButtonCallback(MyButtonCallback));
     continue_print.Enabled = true;
     status_dialog_frame.AddChildElement(continue_print);
     modelName_text = new TextWidget();
     modelName_text.SetPosition(10, 150);
     modelName_text.SetSize(380, 30);
     modelName_text.Text      = "modelName_text";
     modelName_text.Size      = FontSize.Medium;
     modelName_text.Alignment = QFontAlignment.Left;
     modelName_text.Color     = new Color4(0.25f, 0.25f, 0.25f, 1f);
     modelName_text.Visible   = false;
     status_dialog_frame.AddChildElement(modelName_text);
     quality_text = new TextWidget();
     quality_text.SetPosition(10, 180);
     quality_text.SetSize(380, 30);
     quality_text.Text      = "quality_text";
     quality_text.Size      = FontSize.Medium;
     quality_text.Alignment = QFontAlignment.Left;
     quality_text.Color     = new Color4(0.25f, 0.25f, 0.25f, 1f);
     quality_text.Visible   = false;
     status_dialog_frame.AddChildElement(quality_text);
     infill_text = new TextWidget();
     infill_text.SetPosition(10, 210);
     infill_text.SetSize(380, 30);
     infill_text.Text      = "infill_text";
     infill_text.Size      = FontSize.Medium;
     infill_text.Alignment = QFontAlignment.Left;
     infill_text.Color     = new Color4(0.25f, 0.25f, 0.25f, 1f);
     infill_text.Visible   = false;
     status_dialog_frame.AddChildElement(infill_text);
     options_text = new TextWidget();
     options_text.SetPosition(10, 240);
     options_text.SetSize(380, 30);
     options_text.Text      = "";
     options_text.Size      = FontSize.Medium;
     options_text.Alignment = QFontAlignment.Left;
     options_text.Color     = new Color4(0.25f, 0.25f, 0.25f, 1f);
     options_text.Visible   = false;
     status_dialog_frame.AddChildElement(options_text);
     heater_temp_text = new TextWidget();
     heater_temp_text.SetPosition(10, 270);
     heater_temp_text.SetSize(380, 30);
     heater_temp_text.Text      = "Heater Temperature:";
     heater_temp_text.Size      = FontSize.Medium;
     heater_temp_text.Alignment = QFontAlignment.Left;
     heater_temp_text.Color     = new Color4(0.25f, 0.25f, 0.25f, 1f);
     heater_temp_text.Visible   = false;
     status_dialog_frame.AddChildElement(heater_temp_text);
     heatedbed_temp_text = new TextWidget();
     heatedbed_temp_text.SetPosition(10, 300);
     heatedbed_temp_text.SetSize(380, 30);
     heatedbed_temp_text.Text      = "Heated Bed Temperature:";
     heatedbed_temp_text.Size      = FontSize.Medium;
     heatedbed_temp_text.Alignment = QFontAlignment.Left;
     heatedbed_temp_text.Color     = new Color4(0.25f, 0.25f, 0.25f, 1f);
     heatedbed_temp_text.Visible   = false;
     status_dialog_frame.AddChildElement(heatedbed_temp_text);
     more_info = new ButtonWidget(3)
     {
         Text = "",
         Size = FontSize.Medium
     };
     more_info.SetPosition(355, 112);
     more_info.SetSize(30, 30);
     more_info.SetCallback(new ButtonCallback(MyButtonCallback));
     more_info.Enabled = true;
     more_info.Init(host, "guicontrols", 448f, 512f, 511f, 575f, 512f, 512f, 575f, 575f, 576f, 512f, 639f, 575f);
     more_info.ToolTipMessage = host.Locale.T("T_TOOLTIP_INFORMATION");
     status_dialog_frame.AddChildElement(more_info);
     parent_element.AddChildElement(status_dialog_frame);
 }
Exemplo n.º 15
0
        public void Init(GUIHost host)
        {
            this.host = host;
            Init(host, "guicontrols", 640f, 320f, 704f, 383f, 41, 8, 64, 35, 8, 64);
            Sprite.pixel_perfect = false;
            var textWidget1 = new TextWidget(0);

            textWidget1.SetPosition(50, 2);
            textWidget1.SetSize(500, 35);
            textWidget1.Text      = "Add Filament Profile";
            textWidget1.Alignment = QFontAlignment.Left;
            textWidget1.Size      = FontSize.Medium;
            textWidget1.Color     = new Color4(0.5f, 0.5f, 0.5f, 1f);
            AddChildElement(textWidget1);
            var textWidget2 = new TextWidget(0)
            {
                Text      = "Type",
                Size      = FontSize.Medium,
                Alignment = QFontAlignment.Left
            };

            textWidget2.SetPosition(30, 50);
            textWidget2.SetSize(200, 24);
            textWidget2.Color = new Color4(0.5f, 0.5f, 0.5f, 1f);
            AddChildElement(textWidget2);
            var textWidget3 = new TextWidget(0)
            {
                Text      = "Color",
                Size      = FontSize.Medium,
                Alignment = QFontAlignment.Left
            };

            textWidget3.SetPosition(30, 110);
            textWidget3.SetSize(50, 24);
            textWidget3.Color       = new Color4(0.5f, 0.5f, 0.5f, 1f);
            textWidget3.IgnoreMouse = true;
            AddChildElement(textWidget3);
            type_combobox = new ComboBoxWidget(0);
            type_combobox.Init(host);
            type_combobox.ListBox.SetOnChangeCallback(new ListBoxWidget.OnChangeCallback(MyOnChangeFilamentTypeCallback));
            type_combobox.Select = 0;
            type_combobox.SetPosition(30, 80);
            type_combobox.SetSize(256, 24);
            foreach (FilamentSpool.TypeEnum typeEnum in (FilamentSpool.TypeEnum[])Enum.GetValues(typeof(FilamentSpool.TypeEnum)))
            {
                type_combobox.AddItem(typeEnum.ToString());
            }

            type_combobox.Select   = 0;
            type_combobox.tabIndex = 1;
            AddChildElement(type_combobox);
            color_combobox = new ComboBoxWidget(0);
            color_combobox.Init(host);
            color_combobox.ListBox.SetOnChangeCallback(new ListBoxWidget.OnChangeCallback(MyOnChangeColorCallback));
            color_combobox.Select = 0;
            color_combobox.SetPosition(30, 140);
            color_combobox.SetSize(256, 24);
            color_combobox.tabIndex = 2;
            AddChildElement(color_combobox);
            AddColorItems(FilamentSpool.TypeEnum.ABS);
            add_button = new ButtonWidget(3);
            add_button.Init(host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            add_button.Size = FontSize.Medium;
            add_button.Text = "Add";
            add_button.SetGrowableWidth(4, 4, 32);
            add_button.SetGrowableHeight(4, 4, 32);
            add_button.SetSize(80, 32);
            add_button.SetPosition(70, -50);
            add_button.SetCallback(new ButtonCallback(MyButtonCallback));
            add_button.tabIndex = 4;
            AddChildElement(add_button);
            cancel_button = new ButtonWidget(4);
            cancel_button.Init(host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            cancel_button.Size = FontSize.Medium;
            cancel_button.Text = "Cancel";
            cancel_button.SetGrowableWidth(4, 4, 32);
            cancel_button.SetGrowableHeight(4, 4, 32);
            cancel_button.SetSize(100, 32);
            cancel_button.SetPosition(160, -50);
            cancel_button.SetCallback(new ButtonCallback(MyButtonCallback));
            cancel_button.tabIndex = 5;
            AddChildElement(cancel_button);
            Sprite.pixel_perfect = false;
        }
Exemplo n.º 16
0
        public override void Init()
        {
            RelativeX      = 0.0f;
            RelativeY      = 0.0f;
            RelativeWidth  = 1f;
            RelativeHeight = 1f;
            var textWidget1 = new TextWidget(1)
            {
                Color         = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text          = "Re-insert Print Bed",
                RelativeWidth = 1f,
                Size          = FontSize.Medium,
                Alignment     = QFontAlignment.Centre
            };

            textWidget1.SetPosition(0, 25);
            AddChildElement(textWidget1);
            var frame = new Frame(2);

            frame.SetPosition(0, 50);
            frame.RelativeWidth  = 1f;
            frame.RelativeHeight = 0.75f;
            frame.BGColor        = new Color4(246, 246, 246, byte.MaxValue);
            frame.BorderColor    = new Color4(220, 220, 220, byte.MaxValue);
            AddChildElement(frame);
            Sprite.pixel_perfect = true;
            var imageWidget1 = new ImageWidget(0);

            imageWidget1.Init(Host, "extendedcontrols", 240f, 512f, 359f, 612f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget1.SetSize(120, 102);
            imageWidget1.SetPosition(10, 5);
            frame.AddChildElement(imageWidget1);
            var textWidget2 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "1. Wrap extra filament back on the spool and place the filament spool into the compartment. Make sure the label filament can unravel counter-clockwise."
            };

            textWidget2.SetSize(380, 100);
            textWidget2.Size       = FontSize.Medium;
            textWidget2.Alignment  = QFontAlignment.Left;
            textWidget2.VAlignment = TextVerticalAlignment.Top;
            textWidget2.SetPosition(140, 5);
            frame.AddChildElement(textWidget2);
            var imageWidget2 = new ImageWidget(0);

            imageWidget2.Init(Host, "extendedcontrols", 120f, 613f, 239f, 713f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget2.SetSize(120, 102);
            imageWidget2.SetPosition(10, 110);
            frame.AddChildElement(imageWidget2);
            var textWidget3 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "2. Re-insert the print bed"
            };

            textWidget3.SetSize(380, 100);
            textWidget3.Size       = FontSize.Medium;
            textWidget3.Alignment  = QFontAlignment.Left;
            textWidget3.VAlignment = TextVerticalAlignment.Top;
            textWidget3.SetPosition(140, 110);
            frame.AddChildElement(textWidget3);
            var imageWidget3 = new ImageWidget(0);

            imageWidget3.Init(Host, "extendedcontrols", 120f, 512f, 239f, 612f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget3.SetSize(120, 102);
            imageWidget3.SetPosition(10, 215);
            frame.AddChildElement(imageWidget3);
            var textWidget4 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "3. Make sure the print bed is secure and pull it forward to lock it."
            };

            textWidget4.SetSize(380, 100);
            textWidget4.Size       = FontSize.Medium;
            textWidget4.Alignment  = QFontAlignment.Left;
            textWidget4.VAlignment = TextVerticalAlignment.Top;
            textWidget4.SetPosition(140, 215);
            frame.AddChildElement(textWidget4);
            Sprite.pixel_perfect = false;
            var buttonWidget = new ButtonWidget(8);

            buttonWidget.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget.Size = FontSize.Medium;
            buttonWidget.Text = "Next";
            buttonWidget.SetGrowableWidth(4, 4, 32);
            buttonWidget.SetGrowableHeight(4, 4, 32);
            buttonWidget.SetSize(100, 32);
            buttonWidget.SetPosition(400, -50);
            buttonWidget.RelativeX = 0.8f;
            buttonWidget.RelativeY = -1000f;
            buttonWidget.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget);
        }
Exemplo n.º 17
0
        public ControlBar(Form1 form1, GUIHost host, SettingsManager settingsManager, PopupMessageBox messagebox, MessagePopUp infobox, SpoolerConnection spooler_connection, ModelLoadingManager model_loading_manager, Updater softwareUpdater)
            : base(0, null)
        {
            m_oSpoolerConnection   = spooler_connection;
            m_oSettingsManager     = settingsManager;
            m_oModelLoadingManager = model_loading_manager;
            m_GUIHost = host;
            spooler_connection.OnSelectedPrinterChanged += new SpoolerConnection.SelectedPrinterChangedCallback(OnSelectedPrinterChanged);
            Sprite.texture_height_pixels = 1024;
            Sprite.texture_width_pixels  = 1024;
            X             = 0;
            Y             = 0;
            RelativeWidth = 1f;
            Height        = 50;
            BGColor       = new Color4(0.913725f, 0.905882f, 0.9098f, 1f);
            Sprite.texture_height_pixels = 1024;
            Sprite.texture_width_pixels  = 1024;
            var x1 = 10;

            m_owidgetFilamentButton = new ButtonWidget(8)
            {
                Text          = "T_3DINK",
                Size          = FontSize.Large,
                TextColor     = new Color4(0.5f, 0.5f, 0.5f, 1f),
                TextOverColor = new Color4(0.4392157f, 0.8392157f, 0.9372549f, 1f),
                TextDownColor = new Color4(0.2f, 0.6078432f, 0.7098039f, 1f),
                Alignment     = QFontAlignment.Left
            };
            m_owidgetFilamentButton.SetSize(170, 50);
            m_owidgetFilamentButton.SetPosition(x1, 0);
            m_owidgetFilamentButton.SetCallback(new ButtonCallback(MyButtonCallback));
            m_owidgetFilamentButton.Init(host, "guicontrols", 0.0f, 6f, 157f, 57f, 0.0f, 70f, 157f, 121f, 0.0f, 134f, 157f, 185f);
            m_owidgetFilamentButton.SetGrowableWidth(2, 2, 160);
            m_owidgetFilamentButton.ToolTipMessage = host.Locale.T("T_TOOLTIP_3DINK");
            var x2 = x1 + m_owidgetFilamentButton.Width;

            m_owidgetAccessoriesButton = new ButtonWidget(13)
            {
                Text          = "T_ACCESSORIES",
                Size          = FontSize.Large,
                TextColor     = new Color4(0.5f, 0.5f, 0.5f, 1f),
                TextOverColor = new Color4(0.4392157f, 0.8392157f, 0.9372549f, 1f),
                TextDownColor = new Color4(0.2f, 0.6078432f, 0.7098039f, 1f),
                Alignment     = QFontAlignment.Justify
            };
            m_owidgetAccessoriesButton.SetPosition(x2, 8);
            m_owidgetAccessoriesButton.SetSize(200, 40);
            m_owidgetAccessoriesButton.SetCallback(new ButtonCallback(MyButtonCallback));
            m_owidgetAccessoriesButton.Init(host, "extendedcontrols3", 0.0f, 384f, 95f, 479f, 128f, 384f, 223f, 479f, 256f, 384f, 351f, 479f, 384f, 384f, 479f, 479f);
            m_owidgetAccessoriesButton.SetGrowableWidth(2, 2, 160);
            m_owidgetAccessoriesButton.ImageAreaWidth = 48;
            m_owidgetAccessoriesButton.ToolTipMessage = host.Locale.T("T_TOOLTIP_ACCESSORIES");
            var x3 = x2 + m_owidgetAccessoriesButton.Width;

            m_owidgetOpenmodelButton = new ButtonWidget(0)
            {
                Text          = "T_OPENFILE",
                Size          = FontSize.Large,
                TextColor     = new Color4(0.5f, 0.5f, 0.5f, 1f),
                TextOverColor = new Color4(0.4392157f, 0.8392157f, 0.9372549f, 1f),
                TextDownColor = new Color4(0.2f, 0.6078432f, 0.7098039f, 1f),
                Alignment     = QFontAlignment.Left
            };
            m_owidgetOpenmodelButton.SetPosition(x3, 0);
            m_owidgetOpenmodelButton.SetSize(200, 50);
            m_owidgetOpenmodelButton.SetCallback(new ButtonCallback(MyButtonCallback));
            m_owidgetOpenmodelButton.Init(host, "guicontrols", 352f, 8f, 511f, 51f, 352f, 72f, 511f, 115f, 352f, 136f, 511f, 179f);
            m_owidgetOpenmodelButton.SetGrowableWidth(2, 2, 160);
            m_owidgetOpenmodelButton.ToolTipMessage = host.Locale.T("T_TOOLTIP_OPENFILE");
            var num = x3 + m_owidgetOpenmodelButton.Width;

            m_owidgetHelpButton = new ButtonWidget(11)
            {
                Text          = "",
                Size          = FontSize.Large,
                TextColor     = new Color4(0.5f, 0.5f, 0.5f, 1f),
                TextOverColor = new Color4(0.4392157f, 0.8392157f, 0.9372549f, 1f),
                TextDownColor = new Color4(0.2f, 0.6078432f, 0.7098039f, 1f),
                Alignment     = QFontAlignment.Left
            };
            m_owidgetHelpButton.SetSize(52, 44);
            m_owidgetHelpButton.SetPosition(-m_owidgetHelpButton.Width, 3);
            m_owidgetHelpButton.SetCallback(new ButtonCallback(MyButtonCallback));
            m_owidgetHelpButton.Init(host, "extendedcontrols", 852f, 196f, 909f, 245f, 852f, 260f, 909f, 309f, 852f, 324f, 909f, 373f);
            m_owidgetHelpButton.SetGrowableWidth(2, 2, 160);
            m_owidgetHelpButton.ToolTipMessage = host.Locale.T("T_TOOLTIP_HELP");
            m_owidgetSettingsButton            = new ButtonWidget(1)
            {
                Text          = "",
                Size          = FontSize.Large,
                TextColor     = new Color4(0.5f, 0.5f, 0.5f, 1f),
                TextOverColor = new Color4(0.4392157f, 0.8392157f, 0.9372549f, 1f),
                TextDownColor = new Color4(0.2f, 0.6078432f, 0.7098039f, 1f),
                Alignment     = QFontAlignment.Left
            };
            m_owidgetSettingsButton.SetSize(58, 50);
            m_owidgetSettingsButton.SetPosition(-(m_owidgetSettingsButton.Width + m_owidgetHelpButton.Width), 0);
            m_owidgetSettingsButton.SetCallback(new ButtonCallback(MyButtonCallback));
            m_owidgetSettingsButton.Init(host, "guicontrols", 192f, 10f, 240f, 53f, 192f, 74f, 240f, 117f, 192f, 138f, 240f, 181f);
            m_owidgetSettingsButton.SetGrowableWidth(2, 2, 160);
            m_owidgetSettingsButton.ToolTipMessage = host.Locale.T("T_TOOLTIP_SETTINGS");
            m_owidgetPrinterButton = new ButtonWidget(12)
            {
                Text          = "NV-00-00-00-00-000-000",
                Size          = FontSize.Large,
                TextColor     = new Color4(0.5f, 0.5f, 0.5f, 1f),
                TextOverColor = new Color4(0.4392157f, 0.8392157f, 0.9372549f, 1f),
                TextDownColor = new Color4(0.2f, 0.6078432f, 0.7098039f, 1f),
                Alignment     = QFontAlignment.Justify
            };
            m_owidgetPrinterButton.SetSize(250, 33);
            m_owidgetPrinterButton.ImageAreaWidth = 55;
            m_owidgetPrinterButton.SetPosition(-(m_owidgetSettingsButton.Width + m_owidgetHelpButton.Width + m_owidgetPrinterButton.Width), 9);
            m_owidgetPrinterButton.SetCallback(new ButtonCallback(MyButtonCallback));
            m_owidgetPrinterButton.Init(host, "guicontrols", 448f, 650f, 525f, 693f, 608f, 650f, 685f, 693f, 768f, 650f, 845f, 693f);
            m_owidgetPrinterButton.ToolTipMessage = host.Locale.T("T_TOOLTIP_MULTIPRINTER");
            AddChildElement(m_owidgetPrinterButton);
            AddChildElement(m_owidgetFilamentButton);
            AddChildElement(m_owidgetAccessoriesButton);
            AddChildElement(m_owidgetOpenmodelButton);
            AddChildElement(m_owidgetSettingsButton);
            AddChildElement(m_owidgetHelpButton);
            loading_frame = new Frame(10);
            loading_frame.SetSize(160, 200);
            loading_frame.CenterHorizontallyInParent = true;
            loading_frame.CenterVerticallyInParent   = true;
            loading_frame.Visible = false;
            loading_progress      = new SpriteAnimationWidget(10);
            loading_progress.Init(host, "guicontrols", 0.0f, 768f, 767f, 1023f, 6, 2, 12, 200U);
            loading_progress.SetSize(160, 135);
            loading_progress.SetPosition(0, 0);
            loading_progress.Visible = true;
            loading_text             = new TextWidget(0)
            {
                Size = FontSize.VeryLarge
            };
            loading_text.SetPosition(0, 135);
            loading_text.SetSize(160, 65);
            loading_text.VAlignment = TextVerticalAlignment.Middle;
            loading_text.Alignment  = QFontAlignment.Centre;
            loading_text.Text       = "Loading....";
            loading_text.Color      = new Color4(byte.MaxValue, 70, 0, byte.MaxValue);
            loading_frame.AddChildElement(loading_text);
            loading_frame.AddChildElement(loading_progress);
            driversInstalling_frame = new XMLFrame();
            driversInstalling_frame.Init(host, Resources.driverInstallDetected, null);
            driversInstalling_frame.SetPosition(50, -50);
            driversInstalling_frame.SetSize(330, 48);
            driversInstalling_frame.Visible = false;
            m_GUIHost.AddControlElement(driversInstalling_frame);
            diagnostics = new TextWidget(7)
            {
                Text  = "",
                Size  = FontSize.Medium,
                Color = new Color4(0.4f, 0.4f, 0.4f, 1f)
            };
            diagnostics.SetPosition(-530, 0);
            diagnostics.Alignment = QFontAlignment.Left;
            diagnostics.SetSize(150, 50);
            diagnostics.Visible = true;
            AddChildElement(diagnostics);
            m_GUIHost.AddControlElement(this);
            m_GUIHost.AddControlElement(loading_frame);
            CreatePopUpDialogs(host, messagebox, infobox, spooler_connection, softwareUpdater);
            message_window       = infobox;
            Sprite.pixel_perfect = true;
            information          = new ButtonWidget(5)
            {
                Text = "",
                Size = FontSize.Medium
            };
            information.SetPosition(4, -36);
            information.SetSize(32, 32);
            information.SetCallback(new ButtonCallback(MyButtonCallback));
            information.Init(host, "guicontrols", 448f, 512f, 511f, 575f, 512f, 512f, 575f, 575f, 576f, 512f, 639f, 575f);
            information.ToolTipMessage = host.Locale.T("T_TOOLTIP_INFORMATION");
            m_GUIHost.AddControlElement(information);
            Sprite.pixel_perfect = false;
            DisableAccessories();
        }
Exemplo n.º 18
0
        public override void Init()
        {
            FontSize fontSize = FontSize.Medium;
            var      color4_1 = new Color4(0.35f, 0.35f, 0.35f, 1f);
            var      color4_2 = new Color4(0.35f, 0.35f, 0.35f, 1f);

            RelativeX      = 0.0f;
            RelativeY      = 0.0f;
            RelativeWidth  = 1f;
            RelativeHeight = 1f;
            var textWidget1 = new TextWidget(11)
            {
                Color         = color4_1,
                Text          = "Clean Nozzle Head",
                RelativeWidth = 1f,
                Size          = fontSize,
                Alignment     = QFontAlignment.Centre
            };

            textWidget1.SetPosition(0, 50);
            AddChildElement(textWidget1);
            var textWidget2 = new TextWidget(12)
            {
                Size       = FontSize.Medium,
                Alignment  = QFontAlignment.Centre,
                VAlignment = TextVerticalAlignment.Middle,
                Text       = "The nozzle may contain unwanted filament.\nPlease remove any excess material from the nozzle.\nBe careful. The nozzle might be hot.",
                Color      = color4_2
            };

            textWidget2.SetPosition(0, 75);
            textWidget2.SetSize(480, 80);
            textWidget2.CenterHorizontallyInParent = true;
            textWidget2.Visible = true;
            AddChildElement(textWidget2);
            var textWidget3 = new TextWidget(0)
            {
                Size       = FontSize.Medium,
                Alignment  = QFontAlignment.Centre,
                VAlignment = TextVerticalAlignment.Middle,
                Text       = "Continuing in",
                Color      = new Color4(100, 100, 100, byte.MaxValue)
            };

            textWidget3.SetSize(140, 30);
            textWidget3.SetPosition(327, 193);
            AddChildElement(textWidget3);
            var spriteAnimationWidget = new SpriteAnimationWidget(1);

            spriteAnimationWidget.Init(Host, "guicontrols", 0.0f, 768f, 767f, 1023f, 6, 2, 12, 200U);
            spriteAnimationWidget.SetSize(128, 108);
            spriteAnimationWidget.SetPosition(488, 150);
            AddChildElement(spriteAnimationWidget);
            clean_nozzle_timer_text = new TextWidget(13)
            {
                Size       = FontSize.VeryLarge,
                Alignment  = QFontAlignment.Centre,
                VAlignment = TextVerticalAlignment.Middle,
                Text       = "30"
            };
            clean_nozzle_timer_text.SetSize(128, 108);
            clean_nozzle_timer_text.SetPosition(488, 150);
            clean_nozzle_timer_text.Color = new Color4(100, 100, 100, byte.MaxValue);
            AddChildElement(clean_nozzle_timer_text);
            var buttonWidget = new ButtonWidget(14);

            buttonWidget.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget.Size = FontSize.Medium;
            buttonWidget.Text = "Continue";
            buttonWidget.SetGrowableWidth(4, 4, 32);
            buttonWidget.SetGrowableHeight(4, 4, 32);
            buttonWidget.SetSize(110, 40);
            buttonWidget.SetPosition(550, -50);
            buttonWidget.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget);
            var imageWidget = new ImageWidget(0);

            imageWidget.Init(Host, "extendedcontrols2", 696f, 100f, 1020f, 350f, 696f, 100f, 1020f, 350f, 696f, 100f, 1020f, 350f);
            imageWidget.SetSize(320, 256);
            imageWidget.SetPosition(0, 140);
            imageWidget.Visible = true;
            AddChildElement(imageWidget);
        }
Exemplo n.º 19
0
        public override void Init()
        {
            var frame       = new Frame(1);
            var color4_1    = new Color4(0.35f, 0.35f, 0.35f, 1f);
            var color4_2    = new Color4(1f, 1f, 1f, 1f);
            var color4_3    = new Color4(246, 246, 246, byte.MaxValue);
            var color4_4    = new Color4(220, 220, 220, byte.MaxValue);
            var textWidget1 = new TextWidget(0)
            {
                Color         = color4_1,
                Text          = "Set new 3D Ink information by cheat code:",
                RelativeWidth = 1f,
                Size          = FontSize.Medium,
                Alignment     = QFontAlignment.Centre
            };

            textWidget1.SetPosition(0, 40);
            AddChildElement(textWidget1);
            var imageWidget = new ImageWidget(0);

            imageWidget.Init(Host, "extendedcontrols", 0.0f, 256f, 290f, 381f, 0.0f, 256f, 448f, 511f, 0.0f, 256f, 448f, 511f);
            imageWidget.Width  = 290;
            imageWidget.Height = 125;
            imageWidget.X      = 100;
            imageWidget.Y      = 40;
            imageWidget.CenterHorizontallyInParent = true;
            frame.AddChildElement(imageWidget);
            var textWidget2 = new TextWidget(1)
            {
                Text = "Enter cheat code or filament type:"
            };

            textWidget2.SetSize(150, 100);
            textWidget2.SetPositionRelative(0.25f, 0.6f);
            textWidget2.Color = color4_1;
            frame.AddChildElement(textWidget2);
            CheatEdit = new MultiBoxEditBoxWidget(13, null);
            CheatEdit.Init(Host, 3, 1);
            CheatEdit.SetSize(150, 32);
            CheatEdit.SetPositionRelative(0.55f, 0.75f);
            CheatEdit.Color = color4_1;
            CheatEdit.SetCallbackEnterKey(new MultiBoxEditBoxWidget.EditBoxCallback(CheatCodeEnterCallBack));
            frame.AddChildElement(CheatEdit);
            var buttonWidget1 = new ButtonWidget(11);

            buttonWidget1.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget1.Size = FontSize.Medium;
            buttonWidget1.Text = "Cancel";
            buttonWidget1.SetGrowableWidth(4, 4, 32);
            buttonWidget1.SetGrowableHeight(4, 4, 32);
            buttonWidget1.SetSize(110, 40);
            buttonWidget1.SetPosition(20, -50);
            buttonWidget1.SetPositionRelative(0.025f, -1000f);
            buttonWidget1.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget1);
            var buttonWidget2 = new ButtonWidget(12);

            buttonWidget2.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget2.Size = FontSize.Medium;
            buttonWidget2.Text = "Next";
            buttonWidget2.SetGrowableWidth(4, 4, 32);
            buttonWidget2.SetGrowableHeight(4, 4, 32);
            buttonWidget2.SetSize(100, 32);
            buttonWidget2.SetPosition(400, -50);
            buttonWidget2.SetPositionRelative(0.8f, -1000f);
            buttonWidget2.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget2);
            frame.BGColor     = color4_3;
            frame.BorderColor = color4_4;
            frame.SetSizeRelative(1f, 0.6f);
            frame.SetPositionRelative(0.0f, 0.15f);
            BGColor = color4_2;
            SetSizeRelative(1f, 0.9f);
            SetPositionRelative(0.0f, 0.05f);
            AddChildElement(frame);
        }
Exemplo n.º 20
0
        private void Init(GUIHost host, SpoolerConnection spooler_connection, Updater softwareUpdater)
        {
            this.host = host;
            Init(host, "guicontrols", 640f, 320f, 704f, 383f, 41, 8, 64, 37, 8, 64);
            SetSize(792, 356);
            var textWidget = new TextWidget(0);

            textWidget.SetPosition(50, 2);
            textWidget.SetSize(500, 35);
            textWidget.Text      = "Settings";
            textWidget.Alignment = QFontAlignment.Left;
            textWidget.Size      = FontSize.Large;
            textWidget.Color     = new Color4(0.5f, 0.5f, 0.5f, 1f);
            AddChildElement(textWidget);
            var yposition1 = 35;

            Sprite.pixel_perfect = true;
            CreateTabButton(2, "T_SettingsTab_UserInterfaceOptions", yposition1);
            var yposition2 = yposition1 + 64;

            CreateTabButton(5, "T_SettingsTab_Calibration", yposition2);
            var yposition3 = yposition2 + 64;

            CreateTabButton(3, "T_SettingsTab_ExpertControls", yposition3);
            var yposition4 = yposition3 + 64;

            CreateTabButton(4, "T_SettingsTab_FilamentOptions", yposition4);
            var yposition5 = yposition4 + 64;

            CreateTabButton(6, "  Pro/Micro+\n  Features", yposition5);
            CreateTabButton(7, "T_SettingsTab_About", yposition5 + 64);
            var buttonWidget = new ButtonWidget(8)
            {
                X = -40,
                Y = 4
            };

            buttonWidget.SetSize(32, 32);
            buttonWidget.Text          = "";
            buttonWidget.TextColor     = new Color4(0.5f, 0.5f, 0.5f, 1f);
            buttonWidget.TextDownColor = new Color4(1f, 1f, 1f, 1f);
            buttonWidget.TextOverColor = new Color4(0.161f, 0.79f, 0.95f, 1f);
            buttonWidget.Alignment     = QFontAlignment.Left;
            buttonWidget.Init(host, "guicontrols", 704f, 320f, 735f, 351f, 736f, 320f, 767f, 351f, 704f, 352f, 735f, 383f);
            buttonWidget.DontMove = true;
            buttonWidget.SetCallback(new ButtonCallback(MyButtonCallback));
            AddChildElement(buttonWidget);
            tab_frame = new Frame(9)
            {
                X = 191,
                Y = 35
            };
            AddChildElement(tab_frame);
            CreateAppearanceFrame(host, softwareUpdater, messagebox);
            CreateManualControlsFrame(host, spooler_connection, settingsManager);
            CreateFilamentProfilesFrame(host, spooler_connection);
            CreateProFeaturesFrame(host, spooler_connection);
            CreateCalibrationFrame(host, spooler_connection);
            CreateAboutFrame(host);
            about_frame.Visible  = true;
            about_frame.Enabled  = true;
            active_frame         = about_frame;
            Sprite.pixel_perfect = false;
            Visible = false;
        }
Exemplo n.º 21
0
        private void Init(GUIHost host, SettingsManager settingsManager, PopupMessageBox messagebox, MessagePopUp infobox)
        {
            base.SetVisible(false);
            Init(host, "guicontrols", 640f, 320f, 704f, 383f, 41, 8, 64, 35, 8, 64);
            SetSize(792, 356);
            var textWidget = new TextWidget(9);

            textWidget.SetPosition(50, 2);
            textWidget.SetSize(500, 35);
            textWidget.Text      = "Manage Filament Page";
            textWidget.Alignment = QFontAlignment.Left;
            textWidget.Size      = FontSize.Large;
            textWidget.Color     = new Color4(0.5f, 0.5f, 0.5f, 1f);
            AddChildElement(textWidget);
            var buttonWidget = new ButtonWidget(4)
            {
                X = -40,
                Y = 4
            };

            buttonWidget.SetSize(32, 32);
            buttonWidget.Text          = "";
            buttonWidget.TextColor     = new Color4(0.5f, 0.5f, 0.5f, 1f);
            buttonWidget.TextDownColor = new Color4(1f, 1f, 1f, 1f);
            buttonWidget.TextOverColor = new Color4(0.161f, 0.79f, 0.95f, 1f);
            buttonWidget.Alignment     = QFontAlignment.Left;
            buttonWidget.Init(host, "guicontrols", 704f, 320f, 735f, 351f, 736f, 320f, 767f, 351f, 704f, 352f, 735f, 383f);
            buttonWidget.DontMove = true;
            buttonWidget.SetCallback(new ButtonCallback(StartupPageButtonCallback));
            AddChildElement(buttonWidget);
            var frame1 = new Frame(0)
            {
                CenterHorizontallyInParent = true,
                CenterVerticallyInParent   = true,
                RelativeHeight             = 0.9f,
                RelativeWidth = 0.9f
            };

            AddChildElement(frame1);
            frames.Add(new FilamentStartupPage(0, host, this, settingsManager, messagebox));
            frames.Add(new FilamentHeatingNozzle(1, host, this, settingsManager, messagebox));
            frames.Add(new FilamentRetractingFilament(2, host, this));
            frames.Add(new FilamentHasRetractedFilament(3, host, this, settingsManager));
            frames.Add(new FilamentInsertNewFilament(4, host, this));
            frames.Add(new FilamentHasFilamentExited(5, host, this, settingsManager, messagebox));
            frames.Add(new FilamentIsThereFilament(6, host, this, settingsManager));
            frames.Add(new FilamentFilamentColor(7, host, this, settingsManager));
            frames.Add(new FilamentWaitingPage(8, host, this, messagebox));
            frames.Add(new FilamentChangeFilamentDetails(9, host, this, settingsManager, messagebox));
            frames.Add(new FilamentPrimingNozzle(10, host, this));
            frames.Add(new FilamentCheatCodePage(11, host, this, settingsManager, messagebox));
            frames.Add(new FilamentRaisingExtruder(12, host, this, settingsManager, messagebox));
            frames.Add(new FilamentFilamentLocation(13, host, this, settingsManager, messagebox));
            frames.Add(new FilamentInternalSpoolInstructions(14, host, this));
            frames.Add(new FilamentCloseBedInstructions(15, host, this));
            frames.Add(new FilamentRemoveInternalSpoolInstructions(16, host, this));
            frames.Add(new FilamentCleanNozzle(17, host, this));
            frames.Add(new FilamentFilamentSpoolSize(18, host, this, settingsManager, messagebox));
            frames.Add(new FilamentIsNewSpoolPage(19, host, this, settingsManager, infobox));
            foreach (Manage3DInkChildWindow frame2 in frames)
            {
                frame2.Init();
                frame2.Visible = false;
                frame1.AddChildElement(frame2);
            }
        }
Exemplo n.º 22
0
        protected void CreateManageFilamentFrame(string mainText, FontSize mainTextSize, Color4 mainTextColor, string subText, FontSize subTextSize, Color4 subTextColor, bool cancelButton, bool yesNoButton, bool createProgressBar, bool createFinishButton, bool createBack, bool createNext, Color4 middleFrameColor, Color4 middleFrameBorderColor)
        {
            RelativeX      = 0.0f;
            RelativeY      = 0.0f;
            RelativeWidth  = 1f;
            RelativeHeight = 1f;
            var textWidget1 = new TextWidget(1)
            {
                Color         = mainTextColor,
                Text          = mainText,
                RelativeWidth = 1f,
                Size          = mainTextSize,
                Alignment     = QFontAlignment.Centre
            };

            textWidget1.SetPosition(0, 50);
            AddChildElement(textWidget1);
            var frame = new Frame(2);

            frame.SetPosition(0, 100);
            frame.RelativeWidth  = 1f;
            frame.RelativeHeight = 0.5f;
            frame.BGColor        = middleFrameColor;
            frame.BorderColor    = middleFrameBorderColor;
            var textWidget2 = new TextWidget(3)
            {
                Color         = subTextColor,
                Text          = subText,
                RelativeWidth = 1f,
                Size          = subTextSize,
                Alignment     = QFontAlignment.Centre
            };

            textWidget2.SetPosition(0, 75);
            frame.AddChildElement(textWidget2);
            if (createProgressBar)
            {
                var progressBarWidget = new ProgressBarWidget(4);
                progressBarWidget.Init(Host, "guicontrols", 944f, 96f, 960f, 144f, 2, 2, 16, 2, 2, 16);
                progressBarWidget.RelativeX = 0.15f;
                progressBarWidget.RelativeY = 0.65f;
                progressBarWidget.SetSize(375, 24);
                progressBarWidget.RelativeWidth   = 0.7f;
                progressBarWidget.PercentComplete = 0.5f;
                progressBarWidget.BarColor        = new Color4(37, 170, 225, byte.MaxValue);
                frame.AddChildElement(progressBarWidget);
            }
            AddChildElement(frame);
            if (yesNoButton)
            {
                var buttonWidget1 = new ButtonWidget(5);
                buttonWidget1.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
                buttonWidget1.Size = FontSize.Medium;
                buttonWidget1.Text = "Yes";
                buttonWidget1.SetGrowableWidth(4, 4, 32);
                buttonWidget1.SetGrowableHeight(4, 4, 32);
                buttonWidget1.SetSize(110, 40);
                buttonWidget1.SetPosition(110, -75);
                buttonWidget1.SetCallback(new ButtonCallback(MyButtonCallback));
                frame.AddChildElement(buttonWidget1);
                var buttonWidget2 = new ButtonWidget(6);
                buttonWidget2.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
                buttonWidget2.Size = FontSize.Medium;
                buttonWidget2.Text = "No";
                buttonWidget2.SetGrowableWidth(4, 4, 32);
                buttonWidget2.SetGrowableHeight(4, 4, 32);
                buttonWidget2.SetSize(110, 40);
                buttonWidget2.SetPosition(-220, -75);
                buttonWidget2.SetCallback(new ButtonCallback(MyButtonCallback));
                frame.AddChildElement(buttonWidget2);
            }
            if (createBack)
            {
                var buttonWidget = new ButtonWidget(7);
                buttonWidget.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
                buttonWidget.Size = FontSize.Medium;
                buttonWidget.Text = "Back";
                buttonWidget.SetGrowableWidth(4, 4, 32);
                buttonWidget.SetGrowableHeight(4, 4, 32);
                buttonWidget.SetSize(110, 40);
                buttonWidget.SetPosition(20, -50);
                buttonWidget.RelativeX = 0.025f;
                buttonWidget.RelativeY = -1000f;
                buttonWidget.SetCallback(new ButtonCallback(MyButtonCallback));
                AddChildElement(buttonWidget);
            }
            if (createNext)
            {
                var buttonWidget = new ButtonWidget(8);
                buttonWidget.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
                buttonWidget.Size = FontSize.Medium;
                buttonWidget.Text = "Next";
                buttonWidget.SetGrowableWidth(4, 4, 32);
                buttonWidget.SetGrowableHeight(4, 4, 32);
                buttonWidget.SetSize(100, 32);
                buttonWidget.SetPosition(400, -50);
                buttonWidget.RelativeX = 0.8f;
                buttonWidget.RelativeY = -1000f;
                buttonWidget.SetCallback(new ButtonCallback(MyButtonCallback));
                AddChildElement(buttonWidget);
            }
            if (cancelButton)
            {
                var buttonWidget = new ButtonWidget(9);
                buttonWidget.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
                buttonWidget.Size = FontSize.Medium;
                buttonWidget.Text = "Cancel";
                buttonWidget.SetGrowableWidth(4, 4, 32);
                buttonWidget.SetGrowableHeight(4, 4, 32);
                buttonWidget.SetSize(110, 40);
                buttonWidget.SetPosition(20, -50);
                buttonWidget.RelativeX = 0.025f;
                buttonWidget.RelativeY = -1000f;
                buttonWidget.SetCallback(new ButtonCallback(MyButtonCallback));
                AddChildElement(buttonWidget);
            }
            if (!createFinishButton)
            {
                return;
            }

            var buttonWidget3 = new ButtonWidget(10);

            buttonWidget3.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget3.Size = FontSize.Medium;
            buttonWidget3.Text = "Finish";
            buttonWidget3.SetGrowableWidth(4, 4, 32);
            buttonWidget3.SetGrowableHeight(4, 4, 32);
            buttonWidget3.SetSize(100, 32);
            buttonWidget3.SetPosition(400, -50);
            buttonWidget3.RelativeX = 0.8f;
            buttonWidget3.RelativeY = -1000f;
            buttonWidget3.SetCallback(new ButtonCallback(MyButtonCallback));
            AddChildElement(buttonWidget3);
        }
Exemplo n.º 23
0
        public override void Init()
        {
            RelativeX      = 0.0f;
            RelativeY      = 0.0f;
            RelativeWidth  = 1f;
            RelativeHeight = 1f;
            var textWidget1 = new TextWidget(1)
            {
                Color         = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text          = "Load Filament into Internal Port",
                RelativeWidth = 1f,
                Size          = FontSize.Medium,
                Alignment     = QFontAlignment.Centre
            };

            textWidget1.SetPosition(0, 25);
            AddChildElement(textWidget1);
            var frame = new Frame(2);

            frame.SetPosition(0, 50);
            frame.RelativeWidth  = 1f;
            frame.RelativeHeight = 0.75f;
            frame.BGColor        = new Color4(246, 246, 246, byte.MaxValue);
            frame.BorderColor    = new Color4(220, 220, 220, byte.MaxValue);
            AddChildElement(frame);
            Sprite.pixel_perfect = true;
            var imageWidget1 = new ImageWidget(0);

            imageWidget1.Init(Host, "extendedcontrols", 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget1.SetSize(120, 102);
            imageWidget1.SetPosition(10, 5);
            frame.AddChildElement(imageWidget1);
            var textWidget2 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "1. Push the print bed backwards to unlock it."
            };

            textWidget2.SetSize(380, 100);
            textWidget2.Size       = FontSize.Medium;
            textWidget2.Alignment  = QFontAlignment.Left;
            textWidget2.VAlignment = TextVerticalAlignment.Top;
            textWidget2.SetPosition(140, 5);
            frame.AddChildElement(textWidget2);
            var imageWidget2 = new ImageWidget(0);

            imageWidget2.Init(Host, "extendedcontrols", 0.0f, 613f, 119f, 713f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget2.SetSize(120, 102);
            imageWidget2.SetPosition(10, 110);
            frame.AddChildElement(imageWidget2);
            var textWidget3 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "2. Lift the print bed up to reveal the compartment underneath."
            };

            textWidget3.SetSize(380, 100);
            textWidget3.Size       = FontSize.Medium;
            textWidget3.Alignment  = QFontAlignment.Left;
            textWidget3.VAlignment = TextVerticalAlignment.Top;
            textWidget3.SetPosition(140, 110);
            frame.AddChildElement(textWidget3);
            var imageWidget3 = new ImageWidget(0);

            imageWidget3.Init(Host, "extendedcontrols", 0.0f, 714f, 119f, 814f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget3.SetSize(120, 102);
            imageWidget3.SetPosition(10, 215);
            frame.AddChildElement(imageWidget3);
            var textWidget4 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "3. Unwrap one meter of filament from a genuine M3D spool so that it comes out counter clockwise and feed it into the filament tube all the way."
            };

            textWidget4.SetSize(380, 100);
            textWidget4.Size       = FontSize.Medium;
            textWidget4.Alignment  = QFontAlignment.Left;
            textWidget4.VAlignment = TextVerticalAlignment.Top;
            textWidget4.SetPosition(140, 215);
            frame.AddChildElement(textWidget4);
            Sprite.pixel_perfect = false;
            var buttonWidget1 = new ButtonWidget(8);

            buttonWidget1.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget1.Size = FontSize.Medium;
            buttonWidget1.Text = "Next";
            buttonWidget1.SetGrowableWidth(4, 4, 32);
            buttonWidget1.SetGrowableHeight(4, 4, 32);
            buttonWidget1.SetSize(100, 32);
            buttonWidget1.SetPosition(400, -50);
            buttonWidget1.RelativeX = 0.8f;
            buttonWidget1.RelativeY = -1000f;
            buttonWidget1.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget1);
            var buttonWidget2 = new ButtonWidget(9);

            buttonWidget2.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget2.Size = FontSize.Medium;
            buttonWidget2.Text = "Cancel";
            buttonWidget2.SetGrowableWidth(4, 4, 32);
            buttonWidget2.SetGrowableHeight(4, 4, 32);
            buttonWidget2.SetSize(110, 40);
            buttonWidget2.SetPosition(20, -50);
            buttonWidget2.RelativeX = 0.025f;
            buttonWidget2.RelativeY = -1000f;
            buttonWidget2.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget2);
        }
Exemplo n.º 24
0
        public void Init(GUIHost host)
        {
            var borderedImageFrame = new BorderedImageFrame(ID, null);

            AddChildElement(borderedImageFrame);
            SetSize(480, 340);
            borderedImageFrame.Init(host, "guicontrols", 640f, 256f, 703f, 319f, 8, 8, 64, 8, 8, 64);
            borderedImageFrame.SetSize(480, 340);
            borderedImageFrame.CenterHorizontallyInParent = true;
            borderedImageFrame.CenterVerticallyInParent   = true;
            var textWidget = new TextWidget(0)
            {
                Size       = FontSize.Medium,
                Alignment  = QFontAlignment.Centre,
                VAlignment = TextVerticalAlignment.Middle,
                Text       = "T_PrintDialog_PrintWillBeginShortly",
                Color      = new Color4(100, 100, 100, byte.MaxValue)
            };

            textWidget.SetPosition(0, 10);
            textWidget.SetSize(480, 80);
            textWidget.CenterHorizontallyInParent = true;
            borderedImageFrame.AddChildElement(textWidget);
            autostart_text = new TextWidget(0)
            {
                Size       = FontSize.Medium,
                Alignment  = QFontAlignment.Centre,
                VAlignment = TextVerticalAlignment.Middle,
                Text       = "T_PrintDialog_AutoStartingIn",
                Color      = new Color4(100, 100, 100, byte.MaxValue)
            };
            autostart_text.SetPosition(87, 193);
            autostart_text.SetSize(140, 30);
            borderedImageFrame.AddChildElement(autostart_text);
            timer_progress = new SpriteAnimationWidget(1);
            timer_progress.Init(host, "guicontrols", 0.0f, 768f, 767f, 1023f, 6, 2, 12, 200U);
            timer_progress.SetSize(128, 108);
            timer_progress.SetPosition(238, 150);
            borderedImageFrame.AddChildElement(timer_progress);
            timer_text = new TextWidget(0)
            {
                Size       = FontSize.VeryLarge,
                Alignment  = QFontAlignment.Centre,
                VAlignment = TextVerticalAlignment.Middle,
                Text       = "30"
            };
            timer_text.SetSize(128, 108);
            timer_text.SetPosition(238, 150);
            timer_text.Color = new Color4(100, 100, 100, byte.MaxValue);
            borderedImageFrame.AddChildElement(timer_text);
            continue_button = new ButtonWidget(1);
            continue_button.Init(host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            continue_button.Size = FontSize.Medium;
            continue_button.Text = "T_PrintDialog_StartNow";
            continue_button.SetGrowableWidth(4, 4, 32);
            continue_button.SetGrowableHeight(4, 4, 32);
            continue_button.SetSize(100, 32);
            continue_button.SetPosition(100, -46);
            continue_button.SetCallback(new ButtonCallback(MyButtonCallback));
            borderedImageFrame.AddChildElement(continue_button);
            cancel_button = new ButtonWidget(0);
            cancel_button.Init(host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            cancel_button.Size = FontSize.Medium;
            cancel_button.Text = "T_Cancel";
            cancel_button.SetGrowableWidth(4, 4, 32);
            cancel_button.SetGrowableHeight(4, 4, 32);
            cancel_button.SetSize(100, 32);
            cancel_button.SetPosition(-204, -46);
            cancel_button.CenterHorizontallyInParent = false;
            cancel_button.SetCallback(new ButtonCallback(MyButtonCallback));
            borderedImageFrame.AddChildElement(cancel_button);
            estimated_time_label = new TextWidget(0)
            {
                Text      = "T_PrintDialog_EstimatedTime",
                Size      = FontSize.Medium,
                Alignment = QFontAlignment.Left
            };
            estimated_time_label.SetPosition(54, 96);
            estimated_time_label.SetSize(164, 24);
            estimated_time_label.Color = new Color4(0.9922f, 0.3765f, 0.2471f, 1f);
            estimated_time             = new TextWidget(0)
            {
                Text      = "The minions are working",
                Size      = FontSize.Medium,
                Alignment = QFontAlignment.Left
            };
            estimated_time.SetPosition(220, 96);
            estimated_time.SetSize(275, 24);
            estimated_time.Color     = new Color4(0.25f, 0.25f, 0.25f, 1f);
            estimated_filament_label = new TextWidget(0)
            {
                Text      = "T_PrintDialog_EstimatedFilament",
                Size      = FontSize.Medium,
                Alignment = QFontAlignment.Left
            };
            estimated_filament_label.SetPosition(54, 122);
            estimated_filament_label.SetSize(164, 24);
            estimated_filament_label.Color = new Color4(0.9922f, 0.3765f, 0.2471f, 1f);
            estimated_filament             = new TextWidget(0)
            {
                Text      = "The minions are working",
                Size      = FontSize.Medium,
                Alignment = QFontAlignment.Left
            };
            estimated_filament.SetPosition(220, 122);
            estimated_filament.SetSize(275, 24);
            estimated_filament.Color = new Color4(0.25f, 0.25f, 0.25f, 1f);
            borderedImageFrame.AddChildElement(estimated_time_label);
            borderedImageFrame.AddChildElement(estimated_time);
            borderedImageFrame.AddChildElement(estimated_filament_label);
            borderedImageFrame.AddChildElement(estimated_filament);
        }