Ejemplo n.º 1
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;
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
0
        private static void XMLOnShow(PopupMessageBox parentFrame, XMLFrame childFrame, GUIHost host, object data)
        {
            var featuresDialogData = data as FeaturesDialog.ProFeaturesDialogData;

            ((TextWidget)childFrame.FindChildElement("FeaturePanel::Title")).Text = string.Format("{0} Features", featuresDialogData.printer.MyPrinterProfile.ProfileName);
            ((TextWidget)childFrame.FindChildElement("FeaturePanel::Desc")).Text  = string.Format("Here are the {0} features currently available for your printer.", featuresDialogData.printer.MyPrinterProfile.ProfileName);
            FeaturesDialog.featurePanel = new FeaturePanel(1004, host, featuresDialogData.spoolerConnection, featuresDialogData.printer)
            {
                Visible = true,
                Enabled = true
            };
            childFrame.FindChildElement(1003).AddChildElement(FeaturesDialog.featurePanel);
        }
Ejemplo n.º 4
0
        private void XMLButtonCallback(ButtonWidget button, SpoolerMessage message, PopupMessageBox parentFrame, XMLFrame childFrame, object data)
        {
            var childElement = (ButtonWidget)childFrame.FindChildElement(301);

            if (button.ID == 301)
            {
                return;
            }

            settings.Settings.miscSettings.FileAssociations.ShowFileAssociationsDialog = !childElement.Checked;
            switch (button.ID)
            {
            case 101:
                FileAssociations.Set3DFileAssociation(".stl", "STL_M3D_Printer_GUI_file", ExecutablePath, "M3D file (.stl)", IconPath);
                FileAssociations.Set3DFileAssociation(".obj", "OBJ_M3D_Printer_GUI_file", ExecutablePath, "M3D file (.obj)", IconPath);
                break;

            case 102:
                FileAssociations.Delete3DFileAssociation(".stl", "STL_M3D_Printer_GUI_file");
                FileAssociations.Delete3DFileAssociation(".obj", "OBJ_M3D_Printer_GUI_file");
                break;
            }
            parentFrame.AllowMessages = allow_messages;
            parentFrame.CloseCurrent();
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
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.º 7
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);
        }
Ejemplo n.º 8
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();
        }
Ejemplo n.º 9
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);
        }
Ejemplo n.º 10
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);
        }