Example #1
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);
        }
Example #2
0
        private XMLFrame CreateMainFrame(GUIHost host)
        {
            var xmlFrame         = new XMLFrame(0);
            var calibrationPanel = Resources.BedOffsetCalibrationPanel;

            xmlFrame.Init(host, calibrationPanel, new ButtonCallback(MyButtonCallback));
            xmlFrame.SetPosition(0, 0);
            xmlFrame.RelativeWidth  = 1f;
            xmlFrame.RelativeHeight = 1f;
            ZO_Text  = (TextWidget)xmlFrame.FindChildElement(121);
            FRO_Text = (TextWidget)xmlFrame.FindChildElement(122);
            FLO_Text = (TextWidget)xmlFrame.FindChildElement(123);
            BRO_Text = (TextWidget)xmlFrame.FindChildElement(124);
            BLO_Text = (TextWidget)xmlFrame.FindChildElement(125);
            return(xmlFrame);
        }
Example #3
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();
        }