예제 #1
0
        private void CreateStandardElements()
        {
            SetSize(750, 500);
            var borderedImageFrame = new BorderedImageFrame(ID, null);

            borderedImageFrame.Init(host, "guicontrols", 640f, 320f, 704f, 383f, 41, 8, 64, 35, 8, 64);
            borderedImageFrame.SetSize(750, 500);
            borderedImageFrame.CenterHorizontallyInParent = true;
            borderedImageFrame.CenterVerticallyInParent   = true;
            AddChildElement(borderedImageFrame);
            AutoCenterYOffset          = 0;
            CenterHorizontallyInParent = true;
            CenterVerticallyInParent   = true;
            var textWidget = new TextWidget(600);

            textWidget.SetPosition(50, 2);
            textWidget.SetSize(500, 35);
            textWidget.Text      = "Advanced Print Settings";
            textWidget.Alignment = QFontAlignment.Left;
            textWidget.Size      = FontSize.Large;
            textWidget.Color     = new Color4(0.5f, 0.5f, 0.5f, 1f);
            AddChildElement(textWidget);
            var x = 10;

            AddChildElement(CreateUserOptionButton(host, "OK", AdvancedPrintSettingsFrame.AdvanceSettingsButtons.OK, x, -42, 100, 32, ""));
            int num;

            AddChildElement(CreateUserOptionButton(host, "Cancel", AdvancedPrintSettingsFrame.AdvanceSettingsButtons.Cancel, num = x + 110, -42, 100, 32, ""));
            AddChildElement(CreateUserOptionButton(host, "Reset", AdvancedPrintSettingsFrame.AdvanceSettingsButtons.Reset, -110, -42, 100, 32, ""));
            OK_Button = FindChildElement(613) as ButtonWidget;
        }
예제 #2
0
파일: SlicingFrame.cs 프로젝트: ye-man/M3D
        public void Init(GUIHost host)
        {
            var borderedImageFrame = new BorderedImageFrame(ID, null);

            AddChildElement(borderedImageFrame);
            SetSize(480, 340);
            borderedImageFrame.Init(host, "guicontrols", 640f, 256f, 703f, 319f, 8, 8, 64, 8, 8, 64);
            borderedImageFrame.SetSize(480, 340);
            borderedImageFrame.CenterHorizontallyInParent = true;
            borderedImageFrame.CenterVerticallyInParent   = true;
            var textWidget = new TextWidget(0)
            {
                Size       = FontSize.Medium,
                Alignment  = QFontAlignment.Centre,
                VAlignment = TextVerticalAlignment.Middle,
                Text       = "T_PrintDialog_SlicingWarning",
                Color      = new Color4(100, 100, 100, byte.MaxValue)
            };

            textWidget.SetPosition(0, 10);
            textWidget.SetSize(480, 80);
            textWidget.CenterHorizontallyInParent = true;
            borderedImageFrame.AddChildElement(textWidget);
            pleasewait_text = new TextWidget(0)
            {
                Size       = FontSize.Medium,
                Alignment  = QFontAlignment.Centre,
                VAlignment = TextVerticalAlignment.Middle,
                Text       = "T_PrintDialog_SlicingPleaseWait",
                Color      = new Color4(100, 100, 100, byte.MaxValue)
            };
            pleasewait_text.SetPosition(0, 109);
            pleasewait_text.SetSize(247, 50);
            pleasewait_text.CenterHorizontallyInParent = true;
            borderedImageFrame.AddChildElement(pleasewait_text);
            progressbar = new ProgressBarWidget(0);
            progressbar.Init(host, "guicontrols", 944f, 96f, 960f, 144f, 2, 2, 16, 2, 2, 16);
            progressbar.SetPosition(42, 185);
            progressbar.SetSize(401, 24);
            progressbar.PercentComplete = 0.0f;
            borderedImageFrame.AddChildElement(progressbar);
            cancel_button = new ButtonWidget(0);
            cancel_button.Init(host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            cancel_button.Size = FontSize.Medium;
            cancel_button.Text = "Cancel";
            cancel_button.SetGrowableWidth(4, 4, 32);
            cancel_button.SetGrowableHeight(4, 4, 32);
            cancel_button.SetSize(100, 32);
            cancel_button.SetPosition(0, -46);
            cancel_button.CenterHorizontallyInParent = true;
            cancel_button.SetCallback(new ButtonCallback(MyButtonCallback));
            borderedImageFrame.AddChildElement(cancel_button);
        }
예제 #3
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);
        }
예제 #4
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);
 }
예제 #5
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);
        }