Beispiel #1
0
        private void CreateFilamentProfilesFrame()
        {
            var filamentprofilesframe = Resources.filamentprofilesframe;

            filamentProfilesFrame = new XMLFrame();
            filamentProfilesFrame.Init(host, filamentprofilesframe, new ButtonCallback(CustomTempButtonCallback));
            type_edit              = (EditBoxWidget)filamentProfilesFrame.FindChildElement(1001);
            color_edit             = (EditBoxWidget)filamentProfilesFrame.FindChildElement(1002);
            temperature_edit       = (EditBoxWidget)filamentProfilesFrame.FindChildElement(1003);
            add_button             = (ButtonWidget)filamentProfilesFrame.FindChildElement(1005);
            remove_button          = (ButtonWidget)filamentProfilesFrame.FindChildElement(1006);
            TemperatureEditButton  = (ButtonWidget)filamentProfilesFrame.FindChildElement(1007);
            TemperatureSaveButton  = (ButtonWidget)filamentProfilesFrame.FindChildElement(1008);
            TemperatureResetButton = (ButtonWidget)filamentProfilesFrame.FindChildElement(1010);
            filamentprofile_list   = (ListBoxWidget)filamentProfilesFrame.FindChildElement(1009);
            filamentprofile_list.SetOnChangeCallback(new ListBoxWidget.OnChangeCallback(MyOnChangeProfileCallback));
            addfilament_frame = new AddFilamentProfileDialog(0, settingsManager, this);
            addfilament_frame.Init(host);
            addfilament_frame.SetSize(320, 300);
            addfilament_frame.CenterHorizontallyInParent = true;
            addfilament_frame.CenterVerticallyInParent   = true;
            host.AddControlElement(addfilament_frame);
            addfilament_frame.Visible = false;
            addfilament_frame.Enabled = false;
            filamentProfilesFrame.ID  = 1001;
            filamentProfilesFrame.CenterHorizontallyInParent = true;
            filamentProfilesFrame.RelativeY      = 0.1f;
            filamentProfilesFrame.RelativeWidth  = 0.99f;
            filamentProfilesFrame.RelativeHeight = 0.9f;
            filamentProfilesFrame.BGColor        = new Color4(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
            filamentProfilesFrame.Visible        = false;
            filamentProfilesFrame.Enabled        = false;
            childFrame.AddChildElement(filamentProfilesFrame);
            filamentProfilesFrame.Refresh();
        }
Beispiel #2
0
        private void CreateAdvancedFilamentSettingsFrame()
        {
            var advancedfilamentsettings = Resources.advancedfilamentsettings;

            filamentSettingsFrame = new XMLFrame();
            filamentSettingsFrame.Init(host, advancedfilamentsettings, new ButtonCallback(CustomTempButtonCallback));
            filamentSettingsFrame.ID = 1002;
            filamentSettingsFrame.CenterHorizontallyInParent = true;
            filamentSettingsFrame.RelativeY      = 0.1f;
            filamentSettingsFrame.RelativeWidth  = 0.95f;
            filamentSettingsFrame.RelativeHeight = 0.9f;
            filamentSettingsFrame.BGColor        = new Color4(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
            filamentSettingsFrame.Visible        = true;
            filamentSettingsFrame.Enabled        = true;
            childFrame.AddChildElement(filamentSettingsFrame);
            filamentSettingsFrame.Refresh();
            track_filament = (ButtonWidget)filamentSettingsFrame.FindChildElement(1100);
            if (track_filament != null)
            {
                track_filament.SetCallback(new ButtonCallback(FilamentSettingsFrameButtonCallback));
                track_filament.Checked = settingsManager.CurrentFilamentSettings.TrackFilament;
            }
            clean_nozzle = (ButtonWidget)filamentSettingsFrame.FindChildElement(1102);
            if (clean_nozzle == null)
            {
                return;
            }

            clean_nozzle.SetCallback(new ButtonCallback(FilamentSettingsFrameButtonCallback));
            clean_nozzle.Checked = settingsManager.CurrentFilamentSettings.CleanNozzleAfterInsert;
        }
Beispiel #3
0
        private void CreateAdvancedFrame(GUIHost host)
        {
            var interfaceframeAdvanced = Resources.interfaceframe_advanced;

            advancedFrame = new XMLFrame();
            advancedFrame.Init(host, interfaceframeAdvanced, new ButtonCallback(AdvancedFrameButtonCallback));
            advancedFrame.ID = 1003;
            advancedFrame.CenterHorizontallyInParent = true;
            advancedFrame.RelativeY      = 0.1f;
            advancedFrame.RelativeWidth  = 0.95f;
            advancedFrame.RelativeHeight = 0.9f;
            advancedFrame.BGColor        = new Color4(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
            advancedFrame.Visible        = false;
            advancedFrame.Enabled        = false;
            childFrame.AddChildElement(advancedFrame);
            advancedFrame.Refresh();
            softwareupdate_options = (ComboBoxWidget)advancedFrame.FindChildElement(303);
            updateSoftware_button  = (ButtonWidget)advancedFrame.FindChildElement(305);
            download_progress      = (SpriteAnimationWidget)advancedFrame.FindChildElement(306);
            update_text            = (TextWidget)advancedFrame.FindChildElement(304);
            softwareupdate_options.TextChangedCallback = new ComboBoxWidget.ComboBoxTextChangedCallback(AdvancedSettingsComboBoxCallback);
            softwareupdate_options.AddItem(Locale.GlobalLocale.T("T_UpdateOp_DownloadInstall"));
            softwareupdate_options.AddItem(Locale.GlobalLocale.T("T_UpdateOp_DownloadNoInstall"));
            softwareupdate_options.AddItem(Locale.GlobalLocale.T("T_UpdateOp_TakeNoAction"));
            softwareupdate_options.Select  = softwareUpdater.UpdaterMode != Updater.UpdateSettings.DownloadNotInstall ? (softwareUpdater.UpdaterMode != Updater.UpdateSettings.NoAction ? 0 : 2) : 1;
            update_text.Visible            = false;
            download_progress.Visible      = false;
            updateSoftware_button.Enabled  = true;
            updateSoftware_button.Visible  = false;
            advancedFrame.DoOnUpdate       = new ElementStandardDelegate(AdvancedSettingsOnUpdate);
            useMultipleModelsCheckbox      = (ButtonWidget)advancedFrame.FindChildElement(313);
            showRemoveModelWarningCheckbox = (ButtonWidget)advancedFrame.FindChildElement(315);
            autoDetectUnitsCheckbox        = (ButtonWidget)advancedFrame.FindChildElement(317);
        }
Beispiel #4
0
        public void Init(GUIHost host)
        {
            m_oMainFrame_BasicCalibration = new XMLFrame();
            var calibrationPanel = Resources.AdvancedCalibrationPanel;

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

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

            appearanceFrame = new XMLFrame();
            appearanceFrame.Init(host, interfaceframeAppearance, new ButtonCallback(AppearanceFrameButtonCallback));
            appearanceFrame.ID = 1001;
            appearanceFrame.CenterHorizontallyInParent = true;
            appearanceFrame.RelativeY                = 0.1f;
            appearanceFrame.RelativeWidth            = 0.95f;
            appearanceFrame.RelativeHeight           = 0.9f;
            appearanceFrame.BGColor                  = new Color4(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
            appearanceFrame.Visible                  = true;
            appearanceFrame.Enabled                  = true;
            printercolorCombobox                     = (ComboBoxWidget)appearanceFrame.FindChildElement(104);
            printercolorCombobox.Select              = 0;
            printercolorCombobox.TextChangedCallback = new ComboBoxWidget.ComboBoxTextChangedCallback(ColorComboboxChanged);
            modelcolorCombobox        = (ComboBoxWidget)appearanceFrame.FindChildElement(106);
            modelcolorCombobox.Select = 0;
            modelcolorCombobox.TextChangedCallback = new ComboBoxWidget.ComboBoxTextChangedCallback(ColorComboboxChanged);
            iconcolorCombobox        = (ComboBoxWidget)appearanceFrame.FindChildElement(108);
            iconcolorCombobox.Select = 0;
            iconcolorCombobox.TextChangedCallback = new ComboBoxWidget.ComboBoxTextChangedCallback(ColorComboboxChanged);
            var childElement = (TextWidget)appearanceFrame.FindChildElement(100);

            mm_button           = (ButtonWidget)appearanceFrame.FindChildElement(101);
            inches_button       = (ButtonWidget)appearanceFrame.FindChildElement(102);
            pro_button          = (ButtonWidget)appearanceFrame.FindChildElement(110);
            m1_button           = (ButtonWidget)appearanceFrame.FindChildElement(111);
            rendermode_combobox = (ComboBoxWidget)appearanceFrame.FindChildElement(207);
            rendermode_combobox.TextChangedCallback = new ComboBoxWidget.ComboBoxTextChangedCallback(RenderModeChanged);
            switch (OpenGLRendererObject.openGLRenderMode)
            {
            case OpenGLRendererObject.OpenGLRenderMode.VBOs:
                rendermode_combobox.Select = 0;
                break;

            case OpenGLRendererObject.OpenGLRenderMode.ARBVBOs:
                rendermode_combobox.Select = 1;
                break;

            case OpenGLRendererObject.OpenGLRenderMode.ImmediateMode:
                rendermode_combobox.Select = 1;
                break;
            }
            childFrame.AddChildElement(appearanceFrame);
            appearanceFrame.Refresh();
        }
Beispiel #6
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);
        }
Beispiel #7
0
        private void CreateMessagesFrame(GUIHost host)
        {
            var interfaceframeMessages = Resources.interfaceframe_messages;

            messagesFrame = new XMLFrame();
            messagesFrame.Init(host, interfaceframeMessages, new ButtonCallback(MessagesFrameButtonCallback));
            messagesFrame.ID = 1002;
            messagesFrame.CenterHorizontallyInParent = true;
            messagesFrame.RelativeY      = 0.1f;
            messagesFrame.RelativeWidth  = 0.95f;
            messagesFrame.RelativeHeight = 0.9f;
            messagesFrame.BGColor        = new Color4(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
            messagesFrame.Visible        = false;
            messagesFrame.Enabled        = false;
            childFrame.AddChildElement(messagesFrame);
            messagesFrame.Refresh();
            startFullScreenButton = (ButtonWidget)messagesFrame.FindChildElement(201);
            showAllWarningsButton = (ButtonWidget)messagesFrame.FindChildElement(203);
            printerMismatchButton = (ButtonWidget)messagesFrame.FindChildElement(209);
            var childElement1 = (ButtonWidget)messagesFrame.FindChildElement(205);
            var childElement2 = (TextWidget)messagesFrame.FindChildElement(204);
            IFileAssociations fileAssociations = settings.FileAssociations;

            if (fileAssociations == null)
            {
                return;
            }

            var str1 = fileAssociations.ExtensionOpenWith(".stl");
            var str2 = fileAssociations.ExtensionOpenWith(".obj");

            if (str1 != null && str2 != null && (str1.Contains(Application.ExecutablePath) && str2.Contains(Application.ExecutablePath)))
            {
                childElement1.Checked = true;
            }

            childElement1.ImageHasFocusColor = new Color4(100, 230, byte.MaxValue, byte.MaxValue);
        }
Beispiel #8
0
        public void Init(GUIHost host)
        {
            var printToFileDialog = Resources.PrintToFileDialog;
            var xmlFrame          = new XMLFrame(ID)
            {
                RelativeWidth  = 1f,
                RelativeHeight = 1f
            };

            AddChildElement(xmlFrame);
            xmlFrame.Init(host, printToFileDialog, new ButtonCallback(MyButtonCallback));
            status_text = (TextWidget)xmlFrame.FindChildElement("statustext");
            var childElement = (Frame)xmlFrame.FindChildElement(1005);

            this.progressbar = new ProgressBarWidget(0);
            this.progressbar.Init(host, "guicontrols", 944f, 96f, 960f, 144f, 2, 2, 16, 2, 2, 16);
            this.progressbar.SetPosition(32, 64);
            this.progressbar.SetSize(280, 24);
            this.progressbar.PercentComplete = 0.0f;
            ProgressBarWidget progressbar = this.progressbar;

            childElement.AddChildElement(progressbar);
            SetSize(480, 200);
        }
Beispiel #9
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();
        }
Beispiel #10
0
        public PrintDialogFrame(int ID, GUIHost host, PrinterView printerview, SpoolerConnection spooler_connection, PopupMessageBox message_box, ModelLoadingManager modelloadingmanager, SettingsManager settings, PrintDialogMainWindow printDialogWindow)
            : base(ID, printDialogWindow)
        {
            this.modelloadingmanager = modelloadingmanager;
            this.message_box         = message_box;
            this.spooler_connection  = spooler_connection;
            this.printerview         = printerview;
            settingsManager          = settings;
            this.host = host;
            CenterHorizontallyInParent = true;
            CenterVerticallyInParent   = true;
            SetSize(750, 550);
            var printdialog = Resources.printdialog;
            var xmlFrame    = new XMLFrame(ID)
            {
                RelativeWidth  = 1f,
                RelativeHeight = 1f
            };

            AddChildElement(xmlFrame);
            xmlFrame.Init(host, printdialog, new ButtonCallback(MyButtonCallback));
            mPrintQualityButtons = new Dictionary <PrintQuality, ButtonWidget>
            {
                { PrintQuality.Expert, (ButtonWidget)FindChildElement(111) },
                { PrintQuality.VeryHighQuality, (ButtonWidget)FindChildElement(116) },
                { PrintQuality.HighQuality, (ButtonWidget)FindChildElement(112) },
                { PrintQuality.MediumQuality, (ButtonWidget)FindChildElement(113) },
                { PrintQuality.FastPrint, (ButtonWidget)FindChildElement(114) },
                { PrintQuality.VeryFastPrint, (ButtonWidget)FindChildElement(115) },
                { PrintQuality.Custom, (ButtonWidget)FindChildElement(118) }
            };
            mFillDensityButtons = new Dictionary <FillQuality, ButtonWidget>
            {
                { FillQuality.ExtraHigh, (ButtonWidget)FindChildElement(220) },
                { FillQuality.High, (ButtonWidget)FindChildElement(221) },
                { FillQuality.Medium, (ButtonWidget)FindChildElement(222) },
                { FillQuality.Low, (ButtonWidget)FindChildElement(223) },
                { FillQuality.HollowThickWalls, (ButtonWidget)FindChildElement(224) },
                { FillQuality.HollowThinWalls, (ButtonWidget)FindChildElement(225) },
                { FillQuality.Solid, (ButtonWidget)FindChildElement(227) },
                { FillQuality.Custom, (ButtonWidget)FindChildElement(228) }
            };
            print_button            = (ButtonWidget)FindChildElement(401);
            quality_scroll_list     = (HorizontalLayoutScrollList)FindChildElement(110);
            density_scroll_list     = (HorizontalLayoutScrollList)FindChildElement(219);
            printQualityPrev_button = (ButtonWidget)FindChildElement(109);
            printQualityPrev_button.SetCallback(new ButtonCallback(MyButtonCallback));
            printQualityNext_button = (ButtonWidget)FindChildElement(117);
            printQualityNext_button.SetCallback(new ButtonCallback(MyButtonCallback));
            fillDensityPrev_button = (ButtonWidget)FindChildElement(218);
            fillDensityPrev_button.SetCallback(new ButtonCallback(MyButtonCallback));
            fillDensityNext_button = (ButtonWidget)FindChildElement(226);
            fillDensityNext_button.SetCallback(new ButtonCallback(MyButtonCallback));
            support_checkbutton       = (ButtonWidget)FindChildElement(301);
            support_everywhere        = (ButtonWidget)FindChildElement(303);
            support_printbedonly      = (ButtonWidget)FindChildElement(313);
            UseWaveBonding            = (ButtonWidget)FindChildElement(305);
            raft_checkbutton          = (ButtonWidget)FindChildElement(307);
            verifybed_checkbutton     = (ButtonWidget)FindChildElement(309);
            verifybed_text            = (TextWidget)FindChildElement(310);
            printQuality_editbox      = (EditBoxWidget)FindChildElement(108);
            fillDensity_editbox       = (EditBoxWidget)FindChildElement(217);
            enableskirt_checkbutton   = (ButtonWidget)FindChildElement(311);
            heatedBedButton_checkbox  = (ButtonWidget)FindChildElement(315);
            heatedBedButton_text      = (TextWidget)FindChildElement(316);
            untetheredButton_checkbox = (ButtonWidget)FindChildElement(317);
            sdOnlyButton_checkbox     = (ButtonWidget)FindChildElement(319);
            sdOnlyButton_text         = (TextWidget)FindChildElement(320);
            sdCheckboxesFrame         = (XMLFrame)FindChildElement(321);
            mPrintQualityButtons[PrintQuality.Custom].Visible = false;
            mFillDensityButtons[FillQuality.Custom].Visible   = false;
            LoadSettings();
        }