Esempio n. 1
0
        public override void Init()
        {
            CreateManageFilamentFrame("Filament Currently in use:", "", true, false, false, false, false, false);
            var childElement = (Frame)FindChildElement(2);

            if (childElement != null)
            {
                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 = "INSERT FILAMENT (INTERNAL)";
                buttonWidget1.SetGrowableWidth(4, 4, 32);
                buttonWidget1.SetGrowableHeight(4, 4, 32);
                buttonWidget1.SetSize(192, 60);
                buttonWidget1.SetPosition(60, -100);
                buttonWidget1.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
                childElement.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 = "INSERT FILAMENT (EXTERNAL)";
                buttonWidget2.SetGrowableWidth(4, 4, 32);
                buttonWidget2.SetGrowableHeight(4, 4, 32);
                buttonWidget2.SetSize(192, 60);
                buttonWidget2.SetPosition(-252, -100);
                buttonWidget2.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
                childElement.AddChildElement(buttonWidget2);
            }
            PopulateStartupControlsList();
        }
Esempio n. 2
0
 private void AddButton(ButtonWidget button)
 {
     button.SetPosition(0, next_button_y);
     button.SetSize(50, 48);
     buttonframe.AddChildElement(button);
     next_button_y += 48;
     SetSize(55, 8 + next_button_y);
 }
Esempio n. 3
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);
        }
Esempio n. 4
0
        private ButtonWidget CreateUserOptionButton(GUIHost host, string content, AdvancedPrintSettingsFrame.AdvanceSettingsButtons id, int x, int y, int width = 100, int height = 32, string tooltip = "")
        {
            var buttonWidget = new ButtonWidget((int)id);

            buttonWidget.Init(host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget.ID = (int)id;
            buttonWidget.SetPosition(x, y);
            buttonWidget.SetSize(width, height);
            buttonWidget.Text           = content;
            buttonWidget.Alignment      = QFontAlignment.Centre;
            buttonWidget.Size           = FontSize.Medium;
            buttonWidget.ToolTipMessage = tooltip;
            buttonWidget.SetCallback(new ButtonCallback(MyTabButtonCallback));
            return(buttonWidget);
        }
Esempio n. 5
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);
        }
Esempio n. 6
0
        private void CreateTabButton(string Header, ref int tagIDBuilder, int YPos, int width, int height)
        {
            var buttonWidget = new ButtonWidget(tagIDBuilder++);

            buttonWidget.Init(host, "guicontrols", 448f, 256f, 628f, 319f, 448f, 256f, 628f, 319f, 448f, 384f, 628f, 447f);
            buttonWidget.tag  = GetTabButtonTag(Header);
            buttonWidget.Text = "  " + Header;
            buttonWidget.SetPosition(0, YPos);
            buttonWidget.SetSize(width, height);
            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.DontMove      = true;
            buttonWidget.ClickType     = ButtonType.Checkable;
            buttonWidget.GroupID       = 89405;
            buttonWidget.SetCallback(new ButtonCallback(MyTabButtonCallback));
            AddChildElement(buttonWidget);
            buttonElements.Add(buttonWidget);
            var imageWidget1 = new ImageWidget(tagIDBuilder++)
            {
                tag = GetWarningImageTag(Header)
            };

            imageWidget1.Init(host, "extendedcontrols", 0.0f, 0.0f, 37f, 30f);
            imageWidget1.SetSize(24, 20);
            imageWidget1.SetPosition(width - (imageWidget1.Width + 10), YPos + 3);
            imageWidget1.Visible = false;
            AddChildElement(imageWidget1);
            buttonElements.Add(imageWidget1);
            var imageWidget2 = new ImageWidget(tagIDBuilder++)
            {
                tag = GetErrorImageTag(Header)
            };

            imageWidget2.Init(host, "extendedcontrols", 38f, 0.0f, 72f, 30f);
            imageWidget2.SetSize(24, 20);
            imageWidget2.SetPosition(width - (imageWidget2.Width + 10), YPos + 3);
            imageWidget2.Visible = false;
            AddChildElement(imageWidget2);
            buttonElements.Add(imageWidget2);
        }
Esempio n. 7
0
        private ButtonWidget CreateTabButton(int ID, string text)
        {
            var buttonWidget = new ButtonWidget(ID);

            buttonWidget.SetPosition(0, 0);
            buttonWidget.SetSize(181, 64);
            buttonWidget.Text          = 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", 448f, 256f, 628f, 319f, 448f, 256f, 628f, 319f, 448f, 384f, 628f, 447f);
            buttonWidget.DontMove  = true;
            buttonWidget.ClickType = ButtonType.Checkable;
            buttonWidget.GroupID   = 18303;
            buttonWidget.Checked   = false;
            buttonWidget.SetCallback(new ButtonCallback(MyButtonCallback));
            m_oTabButtonsVerticalLayout.AddChildElement(buttonWidget);
            return(buttonWidget);
        }
Esempio n. 8
0
        private ButtonWidget CreateFeatureButton(GUIHost host, KeyValuePair <string, int> featureNameSlotPair, SupportedFeatures.Status status)
        {
            var buttonWidget = new ButtonWidget(featureNameSlotPair.Value);

            buttonWidget.SetSize(300, 29);
            buttonWidget.ImageAreaWidth = 29;
            buttonWidget.Alignment      = QFontAlignment.Justify;
            buttonWidget.Size           = FontSize.Medium;
            buttonWidget.Text           = "  " + featureNameSlotPair.Key;
            buttonWidget.SetCallback(new ButtonCallback(MyButtonCallback));
            var u0 = 0.0f;
            var v0 = 0.0f;
            var u1 = 0.0f;
            var v1 = 0.0f;

            switch (status)
            {
            case SupportedFeatures.Status.Unavailable:
                u0 = 63f;
                v0 = 65f;
                u1 = 91f;
                v1 = 94f;
                break;

            case SupportedFeatures.Status.DevelopmentalFeature:
                u0 = 32f;
                v0 = 65f;
                u1 = 60f;
                v1 = 94f;
                break;

            case SupportedFeatures.Status.Available:
                u0 = 1f;
                v0 = 65f;
                u1 = 29f;
                v1 = 94f;
                break;
            }
            buttonWidget.Init(host, "extendedcontrols", u0, v0, u1, v1);
            return(buttonWidget);
        }
Esempio n. 9
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);
 }
Esempio n. 10
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();
        }
Esempio n. 11
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;
        }
Esempio n. 12
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;
        }
Esempio n. 13
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);
        }
Esempio n. 14
0
        public void Init(GUIHost host)
        {
            X                    = 0;
            Y                    = 0;
            RelativeWidth        = 1f;
            RelativeHeight       = 1f;
            calibration_settings = new ButtonWidget(0, null)
            {
                Text          = "Calibration",
                TextColor     = new Color4(0.71f, 0.71f, 0.71f, 1f),
                TextOverColor = new Color4(1f, 1f, 1f, 1f),
                TextDownColor = new Color4(1f, 1f, 1f, 1f),
                Size          = FontSize.Medium
            };
            calibration_settings.SetCallback(new ButtonCallback(MyButtonCallback));
            calibration_settings.Init(host, "guicontrols", 513f, 64f, 575f, sbyte.MaxValue, 513f, 128f, 575f, 191f, 513f, 192f, 575f, byte.MaxValue);
            calibration_settings.SetGrowableWidth(16, 16, 48);
            calibration_settings.DontMove = true;
            calibration_settings.SetPosition(10, 10);
            calibration_settings.SetSize(200, 32);
            calibration_settings.ClickType = ButtonType.Checkable;
            calibration_settings.GroupID   = 1234;
            advancedcalibration_button     = new ButtonWidget(1, null)
            {
                Text          = "Advanced Calibration",
                TextColor     = new Color4(0.71f, 0.71f, 0.71f, 1f),
                TextOverColor = new Color4(1f, 1f, 1f, 1f),
                TextDownColor = new Color4(1f, 1f, 1f, 1f),
                Size          = FontSize.Medium
            };
            advancedcalibration_button.SetCallback(new ButtonCallback(MyButtonCallback));
            advancedcalibration_button.Init(host, "guicontrols", 576f, 64f, 639f, sbyte.MaxValue, 576f, 128f, 639f, 191f, 576f, 192f, 639f, byte.MaxValue);
            advancedcalibration_button.SetGrowableWidth(16, 16, 48);
            advancedcalibration_button.DontMove  = true;
            advancedcalibration_button.ClickType = ButtonType.Checkable;
            advancedcalibration_button.GroupID   = 1234;
            advancedcalibration_button.SetPosition(210, 10);
            advancedcalibration_button.SetSize(200, 32);
            AddChildElement(calibration_settings);
            AddChildElement(advancedcalibration_button);
            var frame = new Frame(3)
            {
                X              = 0,
                Y              = 50,
                RelativeWidth  = 1f,
                RelativeHeight = 0.85f,
                Enabled        = true,
                IgnoreMouse    = false
            };

            advanced_calibration_tab = new AdvancedCalibrationTab(1001, main_controller, messagebox, spooler_connection);
            advanced_calibration_tab.Init(host);
            advanced_calibration_tab.Visible        = false;
            advanced_calibration_tab.Enabled        = false;
            advanced_calibration_tab.RelativeWidth  = 1f;
            advanced_calibration_tab.RelativeHeight = 1f;
            advanced_calibration_tab.BGColor        = new Color4(246, 246, 246, byte.MaxValue);
            advanced_calibration_tab.BorderColor    = new Color4(220, 220, 220, byte.MaxValue);
            frame.AddChildElement(advanced_calibration_tab);
            calibration_tab = new CatScreenTab(1002, main_controller, spooler_connection, messagebox);
            calibration_tab.Init(host);
            calibration_tab.Visible        = true;
            calibration_tab.Enabled        = true;
            calibration_tab.RelativeWidth  = 1f;
            calibration_tab.RelativeHeight = 1f;
            frame.AddChildElement(calibration_tab);
            calibration_tab.BGColor     = new Color4(246, 246, 246, byte.MaxValue);
            calibration_tab.BorderColor = new Color4(220, 220, 220, byte.MaxValue);
            AddChildElement(frame);
            calibration_settings.SetChecked(true);
            active_frame = calibration_tab;
        }
Esempio n. 15
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);
        }
Esempio n. 16
0
        public void Init(GUIHost host)
        {
            Sprite.pixel_perfect = false;
            m_host = host;
            Sprite.texture_height_pixels = 1024;
            Sprite.texture_width_pixels  = 1024;
            Init(host, "guicontrols", 640f, 256f, 703f, 319f, 12, 12, 64, 12, 12, 64);
            CenterHorizontallyInParent = true;
            CenterVerticallyInParent   = true;
            SetSize(750, 450);
            MinHeight = 450;
            MaxHeight = 600;
            MinWidth  = 750;
            MaxWidth  = 900;
            var frame = new Frame(0)
            {
                CenterHorizontallyInParent = true,
                CenterVerticallyInParent   = true,
                BGColor        = new Color4(246, 246, 246, byte.MaxValue),
                BorderColor    = new Color4(220, 220, 220, byte.MaxValue),
                RelativeWidth  = 0.95f,
                RelativeHeight = 0.8f
            };

            AddChildElement(frame);
            var textWidget1 = new TextWidget(0)
            {
                Size = FontSize.VeryLarge,
                X    = 0,
                Y    = 30
            };

            textWidget1.SetSize(frame.Width, 50);
            textWidget1.RelativeWidth = 0.95f;
            textWidget1.CenterHorizontallyInParent = true;
            textWidget1.Alignment  = QFontAlignment.Centre;
            textWidget1.VAlignment = TextVerticalAlignment.Top;
            textWidget1.Text       = "Thank you for choosing M3D.";
            textWidget1.Color      = new Color4(byte.MaxValue, 147, 0, byte.MaxValue);
            frame.AddChildElement(textWidget1);
            var textWidget2 = new TextWidget(0)
            {
                Size = FontSize.Medium,
                X    = 0,
                Y    = 80
            };

            textWidget2.SetSize(frame.Width, 30);
            textWidget2.RelativeWidth = 0.95f;
            textWidget2.CenterHorizontallyInParent = true;
            textWidget2.Alignment  = QFontAlignment.Centre;
            textWidget2.VAlignment = TextVerticalAlignment.Top;
            textWidget2.Text       = "Here are some features new to this release.";
            textWidget2.Color      = new Color4(100, 100, 100, byte.MaxValue);
            frame.AddChildElement(textWidget2);
            var listBoxWidget = new ListBoxWidget(0);

            listBoxWidget.Init(host, "guicontrols", 944f, 96f, 960f, 144f, 944f, 96f, 960f, 144f, 4, 4, 16, 4, 4, 48, 24, 24);
            listBoxWidget.ScrollBar.InitTrack(host, "guicontrols", 809f, 80f, 831f, 87f, 2, 8);
            listBoxWidget.ScrollBar.InitButton(host, "guicontrols", 1000f, 0.0f, 1023f, 23f, 1000f, 24f, 1023f, 47f, 1000f, 48f, 1023f, 71f, 4, 4, 24);
            listBoxWidget.ScrollBar.InitMinus(host, "guicontrols", 928f, 48f, 951f, 71f, 952f, 48f, 975f, 71f, 976f, 48f, 999f, 71f);
            listBoxWidget.ScrollBar.InitPlus(host, "guicontrols", 928f, 72f, 951f, 95f, 952f, 72f, 975f, 95f, 976f, 72f, 999f, 95f);
            listBoxWidget.ScrollBar.SetButtonSize(24f);
            listBoxWidget.ScrollBar.ShowPushButtons = true;
            listBoxWidget.ShowScrollbar             = ListBoxWidget.ScrollBarState.On;
            listBoxWidget.Y = 110;
            listBoxWidget.CenterHorizontallyInParent = true;
            listBoxWidget.SetSize(650, 190);
            listBoxWidget.Items.Add("Release " + Version.VersionTextNoDate);
            listBoxWidget.Items.Add("- Performance improvements for untethered printing (Micro+, Pro)");
            listBoxWidget.Items.Add("- Power outage recovery (Micro+, Pro)");
            listBoxWidget.Items.Add("- Improved \"on the fly\" backlash processing (Micro+, Pro)");
            listBoxWidget.Items.Add("- New \"Accessories\" menu helps automate print settings (Pro)");
            listBoxWidget.Items.Add("- Improved \"cat screen\" for quicker calibration adjustments (all models)");
            listBoxWidget.Items.Add("- Remedied false alarms for \"Error 1006\" heater panics (Pro)");
            listBoxWidget.Items.Add("- Numerous additional user interface and printer behavior improvements");
            listBoxWidget.Items.Add("  (all models)");
            listBoxWidget.Items.Add("- For full release notes, please see website");
            listBoxWidget.NoSelect = true;
            frame.AddChildElement(listBoxWidget);
            var imageWidget = new ImageWidget(0);

            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      = -40;
            imageWidget.CenterHorizontallyInParent = true;
            imageWidget.SandBoxing = false;
            frame.AddChildElement(imageWidget);
            continue_button = new ButtonWidget(0);
            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 = "Continue";
            continue_button.SetGrowableWidth(4, 4, 32);
            continue_button.SetGrowableHeight(4, 4, 32);
            continue_button.SetSize(100, 32);
            continue_button.SetPosition(-150, -40);
            continue_button.SetCallback(new ButtonCallback(MyButtonCallback));
            continue_button.CenterHorizontallyInParent = true;
            AddChildElement(continue_button);
            frame.SetSize(frame.Width, frame.Height);
            frame.SetSize(660, 360);
            SetSize(750, 450);
            m_host.Refresh();
        }
Esempio n. 17
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);
        }
Esempio n. 18
0
        public override void Init()
        {
            CreateManageFilamentFrame("Filament Currently in use:", "", true, false, false, false, false, false);
            var childElement = (Frame)FindChildElement(2);

            if (childElement != null)
            {
                var textWidget1 = new TextWidget(11)
                {
                    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:"
                };
                childElement.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.55f,
                    RelativeY      = 0.1f,
                    Alignment      = QFontAlignment.Left,
                    VAlignment     = TextVerticalAlignment.Middle,
                    Text           = "purple"
                };
                childElement.AddChildElement(textWidget2);
                var textWidget3 = new TextWidget(13)
                {
                    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:"
                };
                childElement.AddChildElement(textWidget3);
                var textWidget4 = new TextWidget(14)
                {
                    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"
                };
                childElement.AddChildElement(textWidget4);
                var textWidget5 = new TextWidget(15)
                {
                    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:"
                };
                childElement.AddChildElement(textWidget5);
                var textWidget6 = new TextWidget(16)
                {
                    Color          = new Color4(0.35f, 0.35f, 0.35f, 1f),
                    RelativeWidth  = 0.45f,
                    RelativeHeight = 0.2f,
                    RelativeX      = 0.55f,
                    RelativeY      = 0.5f,
                    Alignment      = QFontAlignment.Left,
                    VAlignment     = TextVerticalAlignment.Middle,
                    Text           = "9001"
                };
                childElement.AddChildElement(textWidget6);
                var textWidget7 = new TextWidget(17)
                {
                    Color          = new Color4(0.35f, 0.35f, 0.35f, 1f),
                    RelativeWidth  = 0.45f,
                    RelativeHeight = 0.2f,
                    RelativeX      = 0.0f,
                    RelativeY      = 0.7f,
                    Alignment      = QFontAlignment.Right,
                    VAlignment     = TextVerticalAlignment.Middle,
                    Text           = "3D Ink Used (mm):"
                };
                childElement.AddChildElement(textWidget7);
                var textWidget8 = new TextWidget(18)
                {
                    Color          = new Color4(0.35f, 0.35f, 0.35f, 1f),
                    RelativeWidth  = 0.45f,
                    RelativeHeight = 0.2f,
                    RelativeX      = 0.55f,
                    RelativeY      = 0.7f,
                    Alignment      = QFontAlignment.Left,
                    VAlignment     = TextVerticalAlignment.Middle,
                    Text           = "0"
                };
                childElement.AddChildElement(textWidget8);
                var buttonWidget1 = new ButtonWidget(19);
                buttonWidget1.Init(Host, "guicontrols", 194f, 1f, 253f, 64f, 194f, 65f, 253f, 128f, 194f, 129f, 253f, 192f);
                buttonWidget1.Size = FontSize.Large;
                buttonWidget1.SetGrowableHeight(4, 4, 32);
                buttonWidget1.SetGrowableWidth(4, 4, 32);
                buttonWidget1.SetSize(60, 60);
                buttonWidget1.SetPosition(-60, 0);
                buttonWidget1.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
                childElement.AddChildElement(buttonWidget1);
                var buttonWidget2 = new ButtonWidget(20);
                buttonWidget2.Init(Host, "guicontrols", 200f, 705f, 220f, 725f, 200f, 705f, 220f, 725f, 200f, 705f, 220f, 725f, 200f, 705f, 220f, 725f);
                buttonWidget2.Size = FontSize.Medium;
                buttonWidget2.Text = "CLICK HERE IF NOT CORRECT.";
                buttonWidget2.SetGrowableWidth(4, 4, 32);
                buttonWidget2.SetGrowableHeight(4, 4, 32);
                buttonWidget2.SetSize(300, 40);
                buttonWidget2.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
                buttonWidget2.SetPosition(-300, -40);
                buttonWidget2.TextColor     = new Color4(0.3529412f, 0.7450981f, 0.8627451f, 1f);
                buttonWidget2.TextOverColor = new Color4(0.4392157f, 0.8392157f, 0.9372549f, 1f);
                buttonWidget2.TextDownColor = new Color4(0.2f, 0.6078432f, 0.7098039f, 1f);
                childElement.AddChildElement(buttonWidget2);
                var buttonWidget3 = new ButtonWidget(21);
                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 = "INSERT FILAMENT";
                buttonWidget3.SetGrowableWidth(4, 4, 32);
                buttonWidget3.SetGrowableHeight(4, 4, 32);
                buttonWidget3.SetSize(192, 60);
                buttonWidget3.SetPosition(-270, -100);
                buttonWidget3.CenterHorizontallyInParent = true;
                buttonWidget3.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
                AddChildElement(buttonWidget3);
                var buttonWidget4 = new ButtonWidget(22);
                buttonWidget4.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
                buttonWidget4.Size = FontSize.Medium;
                buttonWidget4.Text = "REMOVE FILAMENT";
                buttonWidget4.SetGrowableWidth(4, 4, 32);
                buttonWidget4.SetGrowableHeight(4, 4, 32);
                buttonWidget4.SetSize(192, 60);
                buttonWidget4.SetPosition(-270, -100);
                buttonWidget4.CenterHorizontallyInParent = true;
                buttonWidget4.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
                AddChildElement(buttonWidget4);
                var spriteAnimationWidget = new SpriteAnimationWidget(23);
                spriteAnimationWidget.Init(Host, "guicontrols", 0.0f, 768f, 767f, 1023f, 6, 2, 12, 200U);
                spriteAnimationWidget.SetPosition(0, -100);
                spriteAnimationWidget.SetSize(96, 81);
                spriteAnimationWidget.CenterHorizontallyInParent = true;
                AddChildElement(spriteAnimationWidget);
            }
            PopulateStartupControlsList();
        }
Esempio n. 19
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;
        }
Esempio n. 20
0
 public void Init(GUIHost host)
 {
     Sprite.texture_height_pixels = 1024;
     Sprite.texture_width_pixels  = 1024;
     Sprite.pixel_perfect         = true;
     Init(host, "guicontrols", 896f, 384f, 1023f, 511f, 64, 32, 64, 16, 16, 64);
     WrapOnNegativeY = false;
     X_Text          = new ImageWidget(0);
     X_Text.SetPosition(6, 7);
     X_Text.SetSize(56, 56);
     X_Text.Init(host, "guicontrols", 64f, 192f, 119f, 247f, 64f, 192f, 119f, 247f, 64f, 192f, 119f, 247f);
     X_Text.Text = "";
     AddChildElement(X_Text);
     Y_Text = new ImageWidget(0);
     Y_Text.SetPosition(6, 63);
     Y_Text.SetSize(56, 56);
     Y_Text.Init(host, "guicontrols", 192f, 192f, 247f, 247f, 192f, 192f, 247f, 247f, 192f, 192f, 247f, 247f);
     Y_Text.Text = "";
     AddChildElement(Y_Text);
     Z_Text = new ImageWidget(0);
     Z_Text.SetPosition(6, 119);
     Z_Text.SetSize(56, 56);
     Z_Text.Init(host, "guicontrols", 320f, 192f, 375f, 247f, 320f, 192f, 375f, 247f, 320f, 192f, 375f, 247f);
     Z_Text.Text = "";
     AddChildElement(Z_Text);
     XPitch_Text = new ImageWidget(0);
     XPitch_Text.SetPosition(6, 7);
     XPitch_Text.SetSize(56, 56);
     XPitch_Text.Init(host, "guicontrols", 0.0f, 192f, 55f, 247f, 0.0f, 192f, 55f, 247f, 0.0f, 192f, 55f, 247f);
     XPitch_Text.Text    = "";
     XPitch_Text.Visible = true;
     AddChildElement(XPitch_Text);
     YRoll_Text = new ImageWidget(0);
     YRoll_Text.SetPosition(6, 63);
     YRoll_Text.SetSize(56, 56);
     YRoll_Text.Init(host, "guicontrols", 128f, 192f, 183f, 247f, 128f, 192f, 183f, 247f, 128f, 192f, 183f, 247f);
     YRoll_Text.Text    = "";
     YRoll_Text.Visible = true;
     AddChildElement(YRoll_Text);
     ZYaw_Text = new ImageWidget(0);
     ZYaw_Text.SetPosition(6, 119);
     ZYaw_Text.SetSize(56, 56);
     ZYaw_Text.Init(host, "guicontrols", 256f, 192f, 311f, 247f, 256f, 192f, 311f, 247f, 256f, 192f, 311f, 247f);
     ZYaw_Text.Text    = "";
     ZYaw_Text.Visible = true;
     AddChildElement(ZYaw_Text);
     X_Edit = new EditBoxWidget(8006);
     X_Edit.Init(host, "guicontrols", 384f, 192f, 447f, 247f);
     X_Edit.SetTextWindowBorders(6, 6, 19, 17);
     X_Edit.SetGrowableWidth(40, 16, 68);
     X_Edit.Size  = FontSize.Medium;
     X_Edit.Color = new Color4(0.51f, 0.51f, 0.51f, 1f);
     X_Edit.Hint  = "";
     X_Edit.Text  = "0.0";
     X_Edit.SetPosition(51, 7);
     X_Edit.SetSize(68, 56);
     X_Edit.tabIndex = 1;
     AddChildElement(X_Edit);
     Y_Edit = new EditBoxWidget(8007);
     Y_Edit.Init(host, "guicontrols", 384f, 192f, 447f, 247f);
     Y_Edit.SetTextWindowBorders(6, 6, 19, 17);
     Y_Edit.SetGrowableWidth(40, 16, 68);
     Y_Edit.Size  = FontSize.Medium;
     Y_Edit.Color = new Color4(0.51f, 0.51f, 0.51f, 1f);
     Y_Edit.Hint  = "";
     Y_Edit.Text  = "0.0";
     Y_Edit.SetPosition(51, 63);
     Y_Edit.SetSize(68, 56);
     Y_Edit.tabIndex = 2;
     AddChildElement(Y_Edit);
     Z_Edit = new EditBoxWidget(8008);
     Z_Edit.Init(host, "guicontrols", 384f, 192f, 447f, 247f);
     Z_Edit.SetTextWindowBorders(6, 6, 19, 17);
     Z_Edit.SetGrowableWidth(40, 16, 68);
     Z_Edit.Size  = FontSize.Medium;
     Z_Edit.Color = new Color4(0.51f, 0.51f, 0.51f, 1f);
     Z_Edit.Hint  = "";
     Z_Edit.Text  = "0.0";
     Z_Edit.SetPosition(51, 119);
     Z_Edit.SetSize(68, 56);
     Z_Edit.tabIndex = 3;
     AddChildElement(Z_Edit);
     Sprite.pixel_perfect = false;
     top_bracket_image    = new ImageWidget(0);
     top_bracket_image.Init(host, "extendedcontrols3", 0.0f, 0.0f, 22f, 31f, 0.0f, 0.0f, 22f, 31f, 0.0f, 0.0f, 22f, 31f);
     top_bracket_image.SetSize(22, 30);
     top_bracket_image.SetPosition(131, 33);
     top_bracket_image.Visible = true;
     AddChildElement(top_bracket_image);
     link_image = new ImageWidget(1);
     link_image.Init(host, "extendedcontrols3", 24f, 0.0f, 48f, 9f, 0.0f, 0.0f, 48f, 9f, 0.0f, 0.0f, 48f, 9f, 24f, 12f, 48f, 20f);
     link_image.SetSize(20, 10);
     link_image.SetPosition(124, 69);
     link_image.Visible = false;
     AddChildElement(link_image);
     linkScaling_button = new ButtonWidget(8015);
     linkScaling_button.Init(host, "guicontrols", 640f, 448f, 671f, 479f, 672f, 448f, 703f, 479f, 640f, 480f, 671f, 511f, 672f, 480f, 703f, 511f);
     linkScaling_button.Size = FontSize.Small;
     linkScaling_button.Text = "";
     linkScaling_button.SetGrowableWidth(5, 5, 16);
     linkScaling_button.SetGrowableHeight(5, 5, 16);
     linkScaling_button.SetSize(24, 24);
     linkScaling_button.SetPosition(122, 82);
     linkScaling_button.SetCallback(new ButtonCallback(MyButtonCallback));
     linkScaling_button.DontMove           = true;
     linkScaling_button.ClickType          = ButtonType.Checkable;
     linkScaling_button.CanClickOff        = true;
     linkScaling_button.Checked            = true;
     linkScaling_button.Visible            = false;
     linkScaling_button.ImageHasFocusColor = new Color4(100, 230, byte.MaxValue, byte.MaxValue);
     linkScaling_button.tabIndex           = 4;
     AddChildElement(linkScaling_button);
     middle_bracket_image = new ImageWidget(2);
     middle_bracket_image.Init(host, "extendedcontrols3", 5f, 0.0f, 22f, 5f, 0.0f, 0.0f, 22f, 31f, 0.0f, 0.0f, 22f, 31f);
     middle_bracket_image.SetSize(11, 5);
     middle_bracket_image.SetPosition(150, 88);
     middle_bracket_image.Visible = true;
     AddChildElement(middle_bracket_image);
     bottom_bracket_image = new ImageWidget(3);
     bottom_bracket_image.Init(host, "extendedcontrols3", 0.0f, 85f, 22f, 115f, 0.0f, 85f, 22f, 115f, 0.0f, 85f, 22f, 115f);
     bottom_bracket_image.SetSize(22, 35);
     bottom_bracket_image.SetPosition(131, 113);
     bottom_bracket_image.Visible = true;
     AddChildElement(bottom_bracket_image);
     X_Slider = new HorizontalSliderWidget(8009);
     X_Slider.InitTrack(host, "guicontrols", 809f, 72f, 831f, 95f, 4, 24);
     X_Slider.InitButton(host, "guicontrols", 808f, 0.0f, 831f, 23f, 808f, 24f, 831f, 47f, 808f, 48f, 831f, 71f, 4, 4, 24);
     X_Slider.InitMinus(host, "guicontrols", 736f, 0.0f, 759f, 23f, 760f, 0.0f, 783f, 23f, 784f, 0.0f, 808f, 23f);
     X_Slider.InitPlus(host, "guicontrols", 736f, 24f, 759f, 47f, 760f, 24f, 783f, 47f, 784f, 24f, 808f, 47f);
     X_Slider.SetButtonSize(24f);
     X_Slider.ShowPushButtons = true;
     X_Slider.SetSize(167, 24);
     X_Slider.SetPosition(155, 23);
     X_Slider.SetRange(-360f, 360f);
     X_Slider.PushButtonStep = 15f;
     X_Slider.SetTrackPosition(0.0f);
     AddChildElement(X_Slider);
     Y_Slider = new HorizontalSliderWidget(8010);
     Y_Slider.InitTrack(host, "guicontrols", 809f, 72f, 831f, 95f, 4, 24);
     Y_Slider.InitButton(host, "guicontrols", 904f, 0.0f, 927f, 23f, 904f, 24f, 927f, 47f, 904f, 48f, 927f, 71f, 4, 4, 24);
     Y_Slider.InitMinus(host, "guicontrols", 832f, 0.0f, 855f, 23f, 856f, 0.0f, 879f, 23f, 880f, 0.0f, 904f, 23f);
     Y_Slider.InitPlus(host, "guicontrols", 832f, 24f, 855f, 47f, 856f, 24f, 879f, 47f, 880f, 24f, 904f, 47f);
     Y_Slider.SetButtonSize(24f);
     Y_Slider.ShowPushButtons = true;
     Y_Slider.SetSize(167, 24);
     Y_Slider.SetPosition(155, 78);
     Y_Slider.SetRange(-360f, 360f);
     Y_Slider.PushButtonStep = 15f;
     Y_Slider.SetTrackPosition(0.0f);
     AddChildElement(Y_Slider);
     Z_Slider = new HorizontalSliderWidget(8011);
     Z_Slider.InitTrack(host, "guicontrols", 809f, 72f, 831f, 95f, 4, 24);
     Z_Slider.InitButton(host, "guicontrols", 1000f, 0.0f, 1023f, 23f, 1000f, 24f, 1023f, 47f, 1000f, 48f, 1023f, 71f, 4, 4, 24);
     Z_Slider.InitMinus(host, "guicontrols", 928f, 0.0f, 951f, 23f, 952f, 0.0f, 975f, 23f, 976f, 0.0f, 999f, 23f);
     Z_Slider.InitPlus(host, "guicontrols", 928f, 24f, 951f, 47f, 952f, 24f, 975f, 47f, 976f, 24f, 999f, 47f);
     Z_Slider.SetButtonSize(24f);
     Z_Slider.ShowPushButtons = true;
     Z_Slider.SetSize(167, 24);
     Z_Slider.SetPosition(155, 133);
     Z_Slider.SetRange(-360f, 360f);
     Z_Slider.PushButtonStep = 15f;
     Z_Slider.SetTrackPosition(0.0f);
     AddChildElement(Z_Slider);
     Sprite.pixel_perfect         = true;
     Sprite.texture_height_pixels = 1024;
     Sprite.texture_width_pixels  = 1024;
     Sprite.pixel_perfect         = false;
 }
Esempio n. 21
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);
        }
Esempio 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);
        }
Esempio n. 23
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);
            }
        }
Esempio n. 24
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;
        }
        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);
        }
Esempio n. 26
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);
        }