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

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

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

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

            m_oMainFrame_G32Calibration.Init(host, calibrationGantryPanel, new ButtonCallback(MyButtonCallback));
            m_oMainFrame_G32Calibration.Visible = false;
            m_oMainFrame_G32Calibration.Enabled = false;
            m_oMainFrame_G32Calibration.SetPosition(0, 0);
            m_oMainFrame_G32Calibration.RelativeWidth  = 1f;
            m_oMainFrame_G32Calibration.RelativeHeight = 1f;
            AddChildElement(m_oMainFrame_G32Calibration);
            m_obwCalibrateBedOrientation_button = (ButtonWidget)m_oMainFrame_G32Calibration.FindChildElement(3);
            m_oMainFrame_Busy = new Frame(0);
            m_oMainFrame_Busy.SetPosition(0, 0);
            m_oMainFrame_Busy.RelativeWidth  = 1f;
            m_oMainFrame_Busy.RelativeHeight = 1f;
            m_otwStatusText = new TextWidget(1001)
            {
                Text       = "",
                Size       = FontSize.Medium,
                Alignment  = QFontAlignment.Left,
                VAlignment = TextVerticalAlignment.Top
            };
            m_otwStatusText.SetPosition(16, 16);
            m_otwStatusText.SetSize(500, 320);
            m_otwStatusText.Color   = new Color4(0.25f, 0.25f, 0.25f, 1f);
            m_otwStatusText.Visible = false;
            m_otwStatusText.Enabled = false;
            m_oMainFrame_Busy.AddChildElement(m_otwStatusText);
            m_osawProgressWidget = new SpriteAnimationWidget(1);
            m_osawProgressWidget.Init(host, "guicontrols", 0.0f, 768f, 767f, 1023f, 6, 2, 12, 200U);
            m_osawProgressWidget.SetSize(128, 108);
            m_osawProgressWidget.SetPosition(14, 192);
            m_osawProgressWidget.Visible = false;
            m_osawProgressWidget.CenterHorizontallyInParent = true;
            m_osawProgressWidget.CenterVerticallyInParent   = true;
            m_oMainFrame_Busy.AddChildElement(m_osawProgressWidget);
            AddChildElement(m_oMainFrame_Busy);
        }
Ejemplo n.º 3
0
        public override void Init()
        {
            CreateManageFilamentFrame("Please wait. The printer is busy perfoming the requested actions.", "", false, false, false, false, false, false);
            WaitingText = (TextWidget)FindChildElement(1);
            var childElement = (Frame)FindChildElement(2);

            if (childElement == null)
            {
                return;
            }

            var spriteAnimationWidget = new SpriteAnimationWidget(11);

            spriteAnimationWidget.Init(Host, "guicontrols", 0.0f, 768f, 767f, 1023f, 6, 2, 12, 200U);
            spriteAnimationWidget.SetSize(128, 108);
            spriteAnimationWidget.CenterVerticallyInParent   = true;
            spriteAnimationWidget.CenterHorizontallyInParent = true;
            childElement.AddChildElement(spriteAnimationWidget);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
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();
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
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);
 }
Ejemplo n.º 8
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();
        }
Ejemplo n.º 9
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);
        }