示例#1
0
        private void CreatePreviewImageWidget(object data)
        {
            var texture = (string)data;

            preview_image = new ImageWidget(0);
            if (!preview_image.Init(m_host, texture))
            {
                preview_image = null;
            }
            else
            {
                if (preview_image == null)
                {
                    return;
                }

                preview_image.SetSize(120, 80);
                preview_image.SetPosition(10, 10);
                status_dialog_frame.AddChildElement(preview_image);
                quad_overlay = new QuadWidget(1);
                quad_overlay.SetSize(120, 80);
                quad_overlay.SetPosition(10, 10);
                quad_overlay.Color   = new Color4(0.99f, 0.54f, 0.35f, 0.75f);
                quad_overlay.Visible = false;
                status_dialog_frame.AddChildElement(quad_overlay);
                status_dialog_frame.X = status_dialog_frame.X;
            }
        }
示例#2
0
        public void Init(GUIHost host)
        {
            var scrollFrame = new ScrollFrame(0, this);

            scrollFrame.Init(host);
            scrollFrame.RelativeWidth  = 1f;
            scrollFrame.RelativeHeight = 1f;
            AddChildElement(scrollFrame);
            var imageWidget = new ImageWidget(0, scrollFrame);

            imageWidget.Init(host, "guicontrols", 0.0f, 737f, 128f, 767f, 0.0f, 737f, 128f, 767f, 0.0f, 737f, 128f, 767f);
            imageWidget.Width      = 129;
            imageWidget.Height     = 31;
            imageWidget.Y          = 10;
            imageWidget.X          = 10;
            imageWidget.SandBoxing = false;
            scrollFrame.AddChildElement(imageWidget);
            var versionText = Version.VersionText;
            var textWidget  = new TextWidget(0, scrollFrame)
            {
                Text       = Locale.GlobalLocale.T("T_AboutText") + versionText,
                Size       = FontSize.Medium,
                Alignment  = QFontAlignment.Left,
                VAlignment = TextVerticalAlignment.Top,
                Color      = new Color4(0.5f, 0.5f, 0.5f, 1f)
            };

            textWidget.SetPosition(10, 60);
            textWidget.Height        = 300;
            textWidget.RelativeWidth = 0.8f;
            scrollFrame.AddChildElement(textWidget);
            textWidget.IgnoreMouse = false;
        }
示例#3
0
        public void Init(GUIHost host, string texture, float normal_u0, float normal_v0, float normal_u1, float normal_v1, int leftbordersize_pixels, int rightbordersize_pixels, int minimumwidth, int topbordersize_pixels, int bottombordersize_pixels, int minimumheight)
        {
            var imageWidget = new ImageWidget(ID);

            imageWidget.SetPosition(0, 0);
            imageWidget.RelativeWidth  = 1f;
            imageWidget.RelativeHeight = 1f;
            imageWidget.Init(host, texture, normal_u0, normal_v0, normal_u1, normal_v1);
            imageWidget.SetGrowableWidth(leftbordersize_pixels, rightbordersize_pixels, minimumwidth);
            imageWidget.SetGrowableHeight(topbordersize_pixels, bottombordersize_pixels, minimumheight);
            AddFirstChild(imageWidget);
        }
示例#4
0
        private void CreateTabButton(string Header, ref int tagIDBuilder, int YPos, int width, int height)
        {
            var buttonWidget = new ButtonWidget(tagIDBuilder++);

            buttonWidget.Init(host, "guicontrols", 448f, 256f, 628f, 319f, 448f, 256f, 628f, 319f, 448f, 384f, 628f, 447f);
            buttonWidget.tag  = GetTabButtonTag(Header);
            buttonWidget.Text = "  " + Header;
            buttonWidget.SetPosition(0, YPos);
            buttonWidget.SetSize(width, height);
            buttonWidget.TextColor     = new Color4(0.5f, 0.5f, 0.5f, 1f);
            buttonWidget.TextDownColor = new Color4(1f, 1f, 1f, 1f);
            buttonWidget.TextOverColor = new Color4(0.161f, 0.79f, 0.95f, 1f);
            buttonWidget.Alignment     = QFontAlignment.Left;
            buttonWidget.DontMove      = true;
            buttonWidget.ClickType     = ButtonType.Checkable;
            buttonWidget.GroupID       = 89405;
            buttonWidget.SetCallback(new ButtonCallback(MyTabButtonCallback));
            AddChildElement(buttonWidget);
            buttonElements.Add(buttonWidget);
            var imageWidget1 = new ImageWidget(tagIDBuilder++)
            {
                tag = GetWarningImageTag(Header)
            };

            imageWidget1.Init(host, "extendedcontrols", 0.0f, 0.0f, 37f, 30f);
            imageWidget1.SetSize(24, 20);
            imageWidget1.SetPosition(width - (imageWidget1.Width + 10), YPos + 3);
            imageWidget1.Visible = false;
            AddChildElement(imageWidget1);
            buttonElements.Add(imageWidget1);
            var imageWidget2 = new ImageWidget(tagIDBuilder++)
            {
                tag = GetErrorImageTag(Header)
            };

            imageWidget2.Init(host, "extendedcontrols", 38f, 0.0f, 72f, 30f);
            imageWidget2.SetSize(24, 20);
            imageWidget2.SetPosition(width - (imageWidget2.Width + 10), YPos + 3);
            imageWidget2.Visible = false;
            AddChildElement(imageWidget2);
            buttonElements.Add(imageWidget2);
        }
示例#5
0
 public void Init(GUIHost host)
 {
     Sprite.texture_height_pixels = 1024;
     Sprite.texture_width_pixels  = 1024;
     Sprite.pixel_perfect         = true;
     colorframe = new Frame();
     colorframe.SetPosition(1, 4);
     colorframe.BGColor = new Color4(0.5f, 0.5f, 0.5f, 0.56f);
     AddChildElement(colorframe);
     buttonframe = new Frame();
     buttonframe.SetPosition(1, 4);
     AddChildElement(buttonframe);
     frameborder = new ImageWidget();
     frameborder.Init(host, "extendedcontrols2", 8f, 939f, 58f, 994f);
     frameborder.SetGrowableHeight(8, 8, 32);
     frameborder.SetGrowableWidth(1, 8, 32);
     frameborder.SetPosition(0, 0);
     frameborder.RelativeWidth  = 1f;
     frameborder.RelativeHeight = 1f;
     frameborder.Color          = new Color4(1f, 1f, 1f, 0.5f);
     AddChildElement(frameborder);
     CreateChildToolWindows(host);
     AddDefaultButtons(host);
 }
        public override void Init()
        {
            RelativeX      = 0.0f;
            RelativeY      = 0.0f;
            RelativeWidth  = 1f;
            RelativeHeight = 1f;
            var textWidget1 = new TextWidget(1)
            {
                Color         = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text          = "Load Filament into Internal Port",
                RelativeWidth = 1f,
                Size          = FontSize.Medium,
                Alignment     = QFontAlignment.Centre
            };

            textWidget1.SetPosition(0, 25);
            AddChildElement(textWidget1);
            var frame = new Frame(2);

            frame.SetPosition(0, 50);
            frame.RelativeWidth  = 1f;
            frame.RelativeHeight = 0.75f;
            frame.BGColor        = new Color4(246, 246, 246, byte.MaxValue);
            frame.BorderColor    = new Color4(220, 220, 220, byte.MaxValue);
            AddChildElement(frame);
            Sprite.pixel_perfect = true;
            var imageWidget1 = new ImageWidget(0);

            imageWidget1.Init(Host, "extendedcontrols", 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget1.SetSize(120, 102);
            imageWidget1.SetPosition(10, 5);
            frame.AddChildElement(imageWidget1);
            var textWidget2 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "1. Push the print bed backwards to unlock it."
            };

            textWidget2.SetSize(380, 100);
            textWidget2.Size       = FontSize.Medium;
            textWidget2.Alignment  = QFontAlignment.Left;
            textWidget2.VAlignment = TextVerticalAlignment.Top;
            textWidget2.SetPosition(140, 5);
            frame.AddChildElement(textWidget2);
            var imageWidget2 = new ImageWidget(0);

            imageWidget2.Init(Host, "extendedcontrols", 0.0f, 613f, 119f, 713f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget2.SetSize(120, 102);
            imageWidget2.SetPosition(10, 110);
            frame.AddChildElement(imageWidget2);
            var textWidget3 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "2. Lift the print bed up to reveal the compartment underneath."
            };

            textWidget3.SetSize(380, 100);
            textWidget3.Size       = FontSize.Medium;
            textWidget3.Alignment  = QFontAlignment.Left;
            textWidget3.VAlignment = TextVerticalAlignment.Top;
            textWidget3.SetPosition(140, 110);
            frame.AddChildElement(textWidget3);
            var imageWidget3 = new ImageWidget(0);

            imageWidget3.Init(Host, "extendedcontrols", 0.0f, 714f, 119f, 814f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget3.SetSize(120, 102);
            imageWidget3.SetPosition(10, 215);
            frame.AddChildElement(imageWidget3);
            var textWidget4 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "3. Unwrap one meter of filament from a genuine M3D spool so that it comes out counter clockwise and feed it into the filament tube all the way."
            };

            textWidget4.SetSize(380, 100);
            textWidget4.Size       = FontSize.Medium;
            textWidget4.Alignment  = QFontAlignment.Left;
            textWidget4.VAlignment = TextVerticalAlignment.Top;
            textWidget4.SetPosition(140, 215);
            frame.AddChildElement(textWidget4);
            Sprite.pixel_perfect = false;
            var buttonWidget1 = new ButtonWidget(8);

            buttonWidget1.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget1.Size = FontSize.Medium;
            buttonWidget1.Text = "Next";
            buttonWidget1.SetGrowableWidth(4, 4, 32);
            buttonWidget1.SetGrowableHeight(4, 4, 32);
            buttonWidget1.SetSize(100, 32);
            buttonWidget1.SetPosition(400, -50);
            buttonWidget1.RelativeX = 0.8f;
            buttonWidget1.RelativeY = -1000f;
            buttonWidget1.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget1);
            var buttonWidget2 = new ButtonWidget(9);

            buttonWidget2.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget2.Size = FontSize.Medium;
            buttonWidget2.Text = "Cancel";
            buttonWidget2.SetGrowableWidth(4, 4, 32);
            buttonWidget2.SetGrowableHeight(4, 4, 32);
            buttonWidget2.SetSize(110, 40);
            buttonWidget2.SetPosition(20, -50);
            buttonWidget2.RelativeX = 0.025f;
            buttonWidget2.RelativeY = -1000f;
            buttonWidget2.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget2);
        }
示例#7
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);
        }
示例#8
0
        public void Init(GUIHost host)
        {
            Sprite.pixel_perfect = false;
            m_host = host;
            Sprite.texture_height_pixels = 1024;
            Sprite.texture_width_pixels  = 1024;
            Init(host, "guicontrols", 640f, 256f, 703f, 319f, 12, 12, 64, 12, 12, 64);
            CenterHorizontallyInParent = true;
            CenterVerticallyInParent   = true;
            SetSize(750, 450);
            MinHeight = 450;
            MaxHeight = 600;
            MinWidth  = 750;
            MaxWidth  = 900;
            var frame = new Frame(0)
            {
                CenterHorizontallyInParent = true,
                CenterVerticallyInParent   = true,
                BGColor        = new Color4(246, 246, 246, byte.MaxValue),
                BorderColor    = new Color4(220, 220, 220, byte.MaxValue),
                RelativeWidth  = 0.95f,
                RelativeHeight = 0.8f
            };

            AddChildElement(frame);
            var textWidget1 = new TextWidget(0)
            {
                Size = FontSize.VeryLarge,
                X    = 0,
                Y    = 30
            };

            textWidget1.SetSize(frame.Width, 50);
            textWidget1.RelativeWidth = 0.95f;
            textWidget1.CenterHorizontallyInParent = true;
            textWidget1.Alignment  = QFontAlignment.Centre;
            textWidget1.VAlignment = TextVerticalAlignment.Top;
            textWidget1.Text       = "Thank you for choosing M3D.";
            textWidget1.Color      = new Color4(byte.MaxValue, 147, 0, byte.MaxValue);
            frame.AddChildElement(textWidget1);
            var textWidget2 = new TextWidget(0)
            {
                Size = FontSize.Medium,
                X    = 0,
                Y    = 80
            };

            textWidget2.SetSize(frame.Width, 30);
            textWidget2.RelativeWidth = 0.95f;
            textWidget2.CenterHorizontallyInParent = true;
            textWidget2.Alignment  = QFontAlignment.Centre;
            textWidget2.VAlignment = TextVerticalAlignment.Top;
            textWidget2.Text       = "Here are some features new to this release.";
            textWidget2.Color      = new Color4(100, 100, 100, byte.MaxValue);
            frame.AddChildElement(textWidget2);
            var listBoxWidget = new ListBoxWidget(0);

            listBoxWidget.Init(host, "guicontrols", 944f, 96f, 960f, 144f, 944f, 96f, 960f, 144f, 4, 4, 16, 4, 4, 48, 24, 24);
            listBoxWidget.ScrollBar.InitTrack(host, "guicontrols", 809f, 80f, 831f, 87f, 2, 8);
            listBoxWidget.ScrollBar.InitButton(host, "guicontrols", 1000f, 0.0f, 1023f, 23f, 1000f, 24f, 1023f, 47f, 1000f, 48f, 1023f, 71f, 4, 4, 24);
            listBoxWidget.ScrollBar.InitMinus(host, "guicontrols", 928f, 48f, 951f, 71f, 952f, 48f, 975f, 71f, 976f, 48f, 999f, 71f);
            listBoxWidget.ScrollBar.InitPlus(host, "guicontrols", 928f, 72f, 951f, 95f, 952f, 72f, 975f, 95f, 976f, 72f, 999f, 95f);
            listBoxWidget.ScrollBar.SetButtonSize(24f);
            listBoxWidget.ScrollBar.ShowPushButtons = true;
            listBoxWidget.ShowScrollbar             = ListBoxWidget.ScrollBarState.On;
            listBoxWidget.Y = 110;
            listBoxWidget.CenterHorizontallyInParent = true;
            listBoxWidget.SetSize(650, 190);
            listBoxWidget.Items.Add("Release " + Version.VersionTextNoDate);
            listBoxWidget.Items.Add("- Performance improvements for untethered printing (Micro+, Pro)");
            listBoxWidget.Items.Add("- Power outage recovery (Micro+, Pro)");
            listBoxWidget.Items.Add("- Improved \"on the fly\" backlash processing (Micro+, Pro)");
            listBoxWidget.Items.Add("- New \"Accessories\" menu helps automate print settings (Pro)");
            listBoxWidget.Items.Add("- Improved \"cat screen\" for quicker calibration adjustments (all models)");
            listBoxWidget.Items.Add("- Remedied false alarms for \"Error 1006\" heater panics (Pro)");
            listBoxWidget.Items.Add("- Numerous additional user interface and printer behavior improvements");
            listBoxWidget.Items.Add("  (all models)");
            listBoxWidget.Items.Add("- For full release notes, please see website");
            listBoxWidget.NoSelect = true;
            frame.AddChildElement(listBoxWidget);
            var imageWidget = new ImageWidget(0);

            imageWidget.Init(host, "guicontrols", 0.0f, 737f, 128f, 767f, 0.0f, 737f, 128f, 767f, 0.0f, 737f, 128f, 767f);
            imageWidget.Width  = 129;
            imageWidget.Height = 31;
            imageWidget.Y      = -40;
            imageWidget.CenterHorizontallyInParent = true;
            imageWidget.SandBoxing = false;
            frame.AddChildElement(imageWidget);
            continue_button = new ButtonWidget(0);
            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 = "Continue";
            continue_button.SetGrowableWidth(4, 4, 32);
            continue_button.SetGrowableHeight(4, 4, 32);
            continue_button.SetSize(100, 32);
            continue_button.SetPosition(-150, -40);
            continue_button.SetCallback(new ButtonCallback(MyButtonCallback));
            continue_button.CenterHorizontallyInParent = true;
            AddChildElement(continue_button);
            frame.SetSize(frame.Width, frame.Height);
            frame.SetSize(660, 360);
            SetSize(750, 450);
            m_host.Refresh();
        }
示例#9
0
 public void Init(GUIHost host)
 {
     Sprite.texture_height_pixels = 1024;
     Sprite.texture_width_pixels  = 1024;
     Sprite.pixel_perfect         = true;
     Init(host, "guicontrols", 896f, 384f, 1023f, 511f, 64, 32, 64, 16, 16, 64);
     WrapOnNegativeY = false;
     X_Text          = new ImageWidget(0);
     X_Text.SetPosition(6, 7);
     X_Text.SetSize(56, 56);
     X_Text.Init(host, "guicontrols", 64f, 192f, 119f, 247f, 64f, 192f, 119f, 247f, 64f, 192f, 119f, 247f);
     X_Text.Text = "";
     AddChildElement(X_Text);
     Y_Text = new ImageWidget(0);
     Y_Text.SetPosition(6, 63);
     Y_Text.SetSize(56, 56);
     Y_Text.Init(host, "guicontrols", 192f, 192f, 247f, 247f, 192f, 192f, 247f, 247f, 192f, 192f, 247f, 247f);
     Y_Text.Text = "";
     AddChildElement(Y_Text);
     Z_Text = new ImageWidget(0);
     Z_Text.SetPosition(6, 119);
     Z_Text.SetSize(56, 56);
     Z_Text.Init(host, "guicontrols", 320f, 192f, 375f, 247f, 320f, 192f, 375f, 247f, 320f, 192f, 375f, 247f);
     Z_Text.Text = "";
     AddChildElement(Z_Text);
     XPitch_Text = new ImageWidget(0);
     XPitch_Text.SetPosition(6, 7);
     XPitch_Text.SetSize(56, 56);
     XPitch_Text.Init(host, "guicontrols", 0.0f, 192f, 55f, 247f, 0.0f, 192f, 55f, 247f, 0.0f, 192f, 55f, 247f);
     XPitch_Text.Text    = "";
     XPitch_Text.Visible = true;
     AddChildElement(XPitch_Text);
     YRoll_Text = new ImageWidget(0);
     YRoll_Text.SetPosition(6, 63);
     YRoll_Text.SetSize(56, 56);
     YRoll_Text.Init(host, "guicontrols", 128f, 192f, 183f, 247f, 128f, 192f, 183f, 247f, 128f, 192f, 183f, 247f);
     YRoll_Text.Text    = "";
     YRoll_Text.Visible = true;
     AddChildElement(YRoll_Text);
     ZYaw_Text = new ImageWidget(0);
     ZYaw_Text.SetPosition(6, 119);
     ZYaw_Text.SetSize(56, 56);
     ZYaw_Text.Init(host, "guicontrols", 256f, 192f, 311f, 247f, 256f, 192f, 311f, 247f, 256f, 192f, 311f, 247f);
     ZYaw_Text.Text    = "";
     ZYaw_Text.Visible = true;
     AddChildElement(ZYaw_Text);
     X_Edit = new EditBoxWidget(8006);
     X_Edit.Init(host, "guicontrols", 384f, 192f, 447f, 247f);
     X_Edit.SetTextWindowBorders(6, 6, 19, 17);
     X_Edit.SetGrowableWidth(40, 16, 68);
     X_Edit.Size  = FontSize.Medium;
     X_Edit.Color = new Color4(0.51f, 0.51f, 0.51f, 1f);
     X_Edit.Hint  = "";
     X_Edit.Text  = "0.0";
     X_Edit.SetPosition(51, 7);
     X_Edit.SetSize(68, 56);
     X_Edit.tabIndex = 1;
     AddChildElement(X_Edit);
     Y_Edit = new EditBoxWidget(8007);
     Y_Edit.Init(host, "guicontrols", 384f, 192f, 447f, 247f);
     Y_Edit.SetTextWindowBorders(6, 6, 19, 17);
     Y_Edit.SetGrowableWidth(40, 16, 68);
     Y_Edit.Size  = FontSize.Medium;
     Y_Edit.Color = new Color4(0.51f, 0.51f, 0.51f, 1f);
     Y_Edit.Hint  = "";
     Y_Edit.Text  = "0.0";
     Y_Edit.SetPosition(51, 63);
     Y_Edit.SetSize(68, 56);
     Y_Edit.tabIndex = 2;
     AddChildElement(Y_Edit);
     Z_Edit = new EditBoxWidget(8008);
     Z_Edit.Init(host, "guicontrols", 384f, 192f, 447f, 247f);
     Z_Edit.SetTextWindowBorders(6, 6, 19, 17);
     Z_Edit.SetGrowableWidth(40, 16, 68);
     Z_Edit.Size  = FontSize.Medium;
     Z_Edit.Color = new Color4(0.51f, 0.51f, 0.51f, 1f);
     Z_Edit.Hint  = "";
     Z_Edit.Text  = "0.0";
     Z_Edit.SetPosition(51, 119);
     Z_Edit.SetSize(68, 56);
     Z_Edit.tabIndex = 3;
     AddChildElement(Z_Edit);
     Sprite.pixel_perfect = false;
     top_bracket_image    = new ImageWidget(0);
     top_bracket_image.Init(host, "extendedcontrols3", 0.0f, 0.0f, 22f, 31f, 0.0f, 0.0f, 22f, 31f, 0.0f, 0.0f, 22f, 31f);
     top_bracket_image.SetSize(22, 30);
     top_bracket_image.SetPosition(131, 33);
     top_bracket_image.Visible = true;
     AddChildElement(top_bracket_image);
     link_image = new ImageWidget(1);
     link_image.Init(host, "extendedcontrols3", 24f, 0.0f, 48f, 9f, 0.0f, 0.0f, 48f, 9f, 0.0f, 0.0f, 48f, 9f, 24f, 12f, 48f, 20f);
     link_image.SetSize(20, 10);
     link_image.SetPosition(124, 69);
     link_image.Visible = false;
     AddChildElement(link_image);
     linkScaling_button = new ButtonWidget(8015);
     linkScaling_button.Init(host, "guicontrols", 640f, 448f, 671f, 479f, 672f, 448f, 703f, 479f, 640f, 480f, 671f, 511f, 672f, 480f, 703f, 511f);
     linkScaling_button.Size = FontSize.Small;
     linkScaling_button.Text = "";
     linkScaling_button.SetGrowableWidth(5, 5, 16);
     linkScaling_button.SetGrowableHeight(5, 5, 16);
     linkScaling_button.SetSize(24, 24);
     linkScaling_button.SetPosition(122, 82);
     linkScaling_button.SetCallback(new ButtonCallback(MyButtonCallback));
     linkScaling_button.DontMove           = true;
     linkScaling_button.ClickType          = ButtonType.Checkable;
     linkScaling_button.CanClickOff        = true;
     linkScaling_button.Checked            = true;
     linkScaling_button.Visible            = false;
     linkScaling_button.ImageHasFocusColor = new Color4(100, 230, byte.MaxValue, byte.MaxValue);
     linkScaling_button.tabIndex           = 4;
     AddChildElement(linkScaling_button);
     middle_bracket_image = new ImageWidget(2);
     middle_bracket_image.Init(host, "extendedcontrols3", 5f, 0.0f, 22f, 5f, 0.0f, 0.0f, 22f, 31f, 0.0f, 0.0f, 22f, 31f);
     middle_bracket_image.SetSize(11, 5);
     middle_bracket_image.SetPosition(150, 88);
     middle_bracket_image.Visible = true;
     AddChildElement(middle_bracket_image);
     bottom_bracket_image = new ImageWidget(3);
     bottom_bracket_image.Init(host, "extendedcontrols3", 0.0f, 85f, 22f, 115f, 0.0f, 85f, 22f, 115f, 0.0f, 85f, 22f, 115f);
     bottom_bracket_image.SetSize(22, 35);
     bottom_bracket_image.SetPosition(131, 113);
     bottom_bracket_image.Visible = true;
     AddChildElement(bottom_bracket_image);
     X_Slider = new HorizontalSliderWidget(8009);
     X_Slider.InitTrack(host, "guicontrols", 809f, 72f, 831f, 95f, 4, 24);
     X_Slider.InitButton(host, "guicontrols", 808f, 0.0f, 831f, 23f, 808f, 24f, 831f, 47f, 808f, 48f, 831f, 71f, 4, 4, 24);
     X_Slider.InitMinus(host, "guicontrols", 736f, 0.0f, 759f, 23f, 760f, 0.0f, 783f, 23f, 784f, 0.0f, 808f, 23f);
     X_Slider.InitPlus(host, "guicontrols", 736f, 24f, 759f, 47f, 760f, 24f, 783f, 47f, 784f, 24f, 808f, 47f);
     X_Slider.SetButtonSize(24f);
     X_Slider.ShowPushButtons = true;
     X_Slider.SetSize(167, 24);
     X_Slider.SetPosition(155, 23);
     X_Slider.SetRange(-360f, 360f);
     X_Slider.PushButtonStep = 15f;
     X_Slider.SetTrackPosition(0.0f);
     AddChildElement(X_Slider);
     Y_Slider = new HorizontalSliderWidget(8010);
     Y_Slider.InitTrack(host, "guicontrols", 809f, 72f, 831f, 95f, 4, 24);
     Y_Slider.InitButton(host, "guicontrols", 904f, 0.0f, 927f, 23f, 904f, 24f, 927f, 47f, 904f, 48f, 927f, 71f, 4, 4, 24);
     Y_Slider.InitMinus(host, "guicontrols", 832f, 0.0f, 855f, 23f, 856f, 0.0f, 879f, 23f, 880f, 0.0f, 904f, 23f);
     Y_Slider.InitPlus(host, "guicontrols", 832f, 24f, 855f, 47f, 856f, 24f, 879f, 47f, 880f, 24f, 904f, 47f);
     Y_Slider.SetButtonSize(24f);
     Y_Slider.ShowPushButtons = true;
     Y_Slider.SetSize(167, 24);
     Y_Slider.SetPosition(155, 78);
     Y_Slider.SetRange(-360f, 360f);
     Y_Slider.PushButtonStep = 15f;
     Y_Slider.SetTrackPosition(0.0f);
     AddChildElement(Y_Slider);
     Z_Slider = new HorizontalSliderWidget(8011);
     Z_Slider.InitTrack(host, "guicontrols", 809f, 72f, 831f, 95f, 4, 24);
     Z_Slider.InitButton(host, "guicontrols", 1000f, 0.0f, 1023f, 23f, 1000f, 24f, 1023f, 47f, 1000f, 48f, 1023f, 71f, 4, 4, 24);
     Z_Slider.InitMinus(host, "guicontrols", 928f, 0.0f, 951f, 23f, 952f, 0.0f, 975f, 23f, 976f, 0.0f, 999f, 23f);
     Z_Slider.InitPlus(host, "guicontrols", 928f, 24f, 951f, 47f, 952f, 24f, 975f, 47f, 976f, 24f, 999f, 47f);
     Z_Slider.SetButtonSize(24f);
     Z_Slider.ShowPushButtons = true;
     Z_Slider.SetSize(167, 24);
     Z_Slider.SetPosition(155, 133);
     Z_Slider.SetRange(-360f, 360f);
     Z_Slider.PushButtonStep = 15f;
     Z_Slider.SetTrackPosition(0.0f);
     AddChildElement(Z_Slider);
     Sprite.pixel_perfect         = true;
     Sprite.texture_height_pixels = 1024;
     Sprite.texture_width_pixels  = 1024;
     Sprite.pixel_perfect         = false;
 }
示例#10
0
文件: LibraryView.cs 项目: ye-man/M3D
        public LibraryView(int ID, Element2D parent, GLControl glControl, GUIHost host, MessagePopUp infobox, ModelLoadingManager model_loading_manager)
            : base(ID, parent)
        {
            bUpdateWhenNotVisible        = true;
            m_gui_host                   = host;
            Sprite.texture_height_pixels = 1024;
            Sprite.texture_width_pixels  = 1024;
            m_gui_host.SetFontProperty(FontSize.VeryLarge, 20f);
            m_gui_host.SetFontProperty(FontSize.Large, 14f);
            m_gui_host.SetFontProperty(FontSize.Medium, 11f);
            m_gui_host.SetFontProperty(FontSize.Small, 8f);
            RelativeX      = 0.51f;
            RelativeY      = 0.11f;
            RelativeWidth  = 0.423f;
            RelativeHeight = 0.83f;
            var imageWidget1 = new ImageWidget(1008, null);

            imageWidget1.Init(host, "extendedcontrols3", 3f, 288f, 84f, 374f, 3f, 288f, 84f, 374f, 3f, 288f, 84f, 374f);
            imageWidget1.Text           = "Remove From List";
            imageWidget1.Color          = new Color4(0.5f, 0.5f, 0.5f, 1f);
            imageWidget1.VAlignment     = TextVerticalAlignment.Bottom;
            imageWidget1.TextAreaHeight = 32;
            imageWidget1.ImageAreaWidth = 80;
            imageWidget1.SetSize(80, 115);
            imageWidget1.Visible = false;
            AddChildElement(imageWidget1);
            imageWidget1.SetPosition(-12, -115);
            var imageWidget2 = new ImageWidget(1009, null);

            imageWidget2.Init(host, "extendedcontrols3", 92f, 285f, 173f, 346f, 92f, 285f, 173f, 346f, 92f, 285f, 173f, 346f);
            imageWidget2.Text           = "Save";
            imageWidget2.Color          = new Color4(0.5f, 0.5f, 0.5f, 1f);
            imageWidget2.VAlignment     = TextVerticalAlignment.Bottom;
            imageWidget2.TextAreaHeight = 20;
            imageWidget2.ImageAreaWidth = 81;
            imageWidget2.SetSize(81, 85);
            imageWidget2.Visible = false;
            AddChildElement(imageWidget2);
            imageWidget2.SetPosition(-12, -240);
            search_filter = "";
            var editBoxWidget = new EditBoxWidget(1001, null);

            editBoxWidget.Init(host, "guicontrols", 513f, 0.0f, 608f, 63f);
            editBoxWidget.SetGrowableWidth(40, 16, 64);
            editBoxWidget.Size  = FontSize.Large;
            editBoxWidget.Color = new Color4(0.71f, 0.71f, 0.71f, 1f);
            editBoxWidget.SetTextWindowBorders(48, 16, 22, 16);
            editBoxWidget.SetToolTipRegion(0, 48, 0, 60);
            editBoxWidget.ToolTipMessage = host.Locale.T("T_TOOLTIP_SEARCH");
            editBoxWidget.Hint           = m_gui_host.Locale.T("T_SEARCH");
            tabsFrame = new HorizontalLayout(0, null)
            {
                FixedColumnWidth = true,
                BorderWidth      = 0,
                BorderHeight     = 0,
                RelativeWidth    = 1f
            };
            navigation      = new Frame(0, null);
            navigation_left = new ButtonWidget(1005, null)
            {
                Text   = "",
                X      = 16,
                Y      = 0,
                Width  = 32,
                Height = 32
            };
            navigation_left.SetCallback(new ButtonCallback(MyButtonCallback));
            navigation_left.Init(host, "guicontrols", 608f, 0.0f, 639f, 31f, 640f, 0.0f, 671f, 31f, 672f, 0.0f, 703f, 31f, 704f, 0.0f, 735f, 31f);
            navigation_right = new ButtonWidget(1006, null)
            {
                Text   = "",
                X      = -48,
                Y      = 0,
                Width  = 32,
                Height = 32
            };
            navigation_right.SetCallback(new ButtonCallback(MyButtonCallback));
            navigation_right.Init(host, "guicontrols", 608f, 32f, 639f, 63f, 640f, 32f, 671f, 63f, 672f, 32f, 703f, 63f, 704f, 32f, 735f, 63f);
            pagebuttons = new ButtonWidget[32];
            for (var ID1 = 1032; ID1 <= 1063; ++ID1)
            {
                var index = ID1 - 1032;
                pagebuttons[index] = new ButtonWidget(ID1, null)
                {
                    Text   = "",
                    X      = 48 + (ID1 - 1032) * 24,
                    Y      = 8,
                    Width  = 16,
                    Height = 16
                };
                pagebuttons[index].SetCallback(new ButtonCallback(MyButtonCallback));
                pagebuttons[index].Init(host, "guicontrols", 448f, 192f, 463f, 208f, 480f, 192f, 495f, 208f, 464f, 192f, 479f, 208f);
                pagebuttons[index].DontMove  = true;
                pagebuttons[index].GroupID   = 1;
                pagebuttons[index].ClickType = ButtonType.Checkable;
                pagebuttons[index].Visible   = false;
                navigation.AddChildElement(pagebuttons[index]);
            }
            navigation.AddChildElement(navigation_left);
            navigation.AddChildElement(navigation_right);
            LibraryGrid = new GridLayout(1)
            {
                ColumnWidth  = 130,
                RowHeight    = 150,
                BorderWidth  = 0,
                BorderHeight = 0
            };
            var verticalLayout = new VerticalLayout(0)
            {
                RelativeHeight = 1f,
                RelativeWidth  = 1f,
                BorderHeight   = 10
            };

            verticalLayout.AddChildElement(editBoxWidget, 0, 64 + verticalLayout.BorderHeight);
            verticalLayout.AddChildElement(tabsFrame, 1, 64 + verticalLayout.BorderHeight);
            verticalLayout.AddChildElement(navigation, 2, 32 + verticalLayout.BorderHeight);
            verticalLayout.AddChildElement(LibraryGrid, 3, -1);
            AddChildElement(verticalLayout);
            library_status = new TextWidget(1007)
            {
                Text           = m_gui_host.Locale.T("T_NOMODELS"),
                Size           = FontSize.VeryLarge,
                Alignment      = QFontAlignment.Centre,
                RelativeHeight = 1f,
                RelativeWidth  = 1f,
                X     = 0,
                Y     = 0,
                Color = new Color4(0.9922f, 0.3765f, 0.2471f, 1f)
            };
            AddChildElement(library_status);
            recentModelsTab = new RecentModelTab(this, model_loading_manager, infobox, glControl);
            ButtonWidget buttonWidget = AddTabButton(host, recentModelsTab, LibraryView.TabButtonStyle.Left, m_gui_host.Locale.T("T_RECENT_MODELS"), 1002);

            recentPrintsTab = new RecentPrintsTab(this, model_loading_manager);
            AddTabButton(host, recentPrintsTab, LibraryView.TabButtonStyle.Right, m_gui_host.Locale.T("T_RECENT_PRINTS"), 1004);
            var num = 1;

            buttonWidget.SetChecked(num != 0);
            ShowView(true);
            viewstate = ViewState.Active;
        }
示例#11
0
        public override void Init()
        {
            var frame       = new Frame(1);
            var color4_1    = new Color4(0.35f, 0.35f, 0.35f, 1f);
            var color4_2    = new Color4(1f, 1f, 1f, 1f);
            var color4_3    = new Color4(246, 246, 246, byte.MaxValue);
            var color4_4    = new Color4(220, 220, 220, byte.MaxValue);
            var textWidget1 = new TextWidget(0)
            {
                Color         = color4_1,
                Text          = "Set new 3D Ink information by cheat code:",
                RelativeWidth = 1f,
                Size          = FontSize.Medium,
                Alignment     = QFontAlignment.Centre
            };

            textWidget1.SetPosition(0, 40);
            AddChildElement(textWidget1);
            var imageWidget = new ImageWidget(0);

            imageWidget.Init(Host, "extendedcontrols", 0.0f, 256f, 290f, 381f, 0.0f, 256f, 448f, 511f, 0.0f, 256f, 448f, 511f);
            imageWidget.Width  = 290;
            imageWidget.Height = 125;
            imageWidget.X      = 100;
            imageWidget.Y      = 40;
            imageWidget.CenterHorizontallyInParent = true;
            frame.AddChildElement(imageWidget);
            var textWidget2 = new TextWidget(1)
            {
                Text = "Enter cheat code or filament type:"
            };

            textWidget2.SetSize(150, 100);
            textWidget2.SetPositionRelative(0.25f, 0.6f);
            textWidget2.Color = color4_1;
            frame.AddChildElement(textWidget2);
            CheatEdit = new MultiBoxEditBoxWidget(13, null);
            CheatEdit.Init(Host, 3, 1);
            CheatEdit.SetSize(150, 32);
            CheatEdit.SetPositionRelative(0.55f, 0.75f);
            CheatEdit.Color = color4_1;
            CheatEdit.SetCallbackEnterKey(new MultiBoxEditBoxWidget.EditBoxCallback(CheatCodeEnterCallBack));
            frame.AddChildElement(CheatEdit);
            var buttonWidget1 = new ButtonWidget(11);

            buttonWidget1.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget1.Size = FontSize.Medium;
            buttonWidget1.Text = "Cancel";
            buttonWidget1.SetGrowableWidth(4, 4, 32);
            buttonWidget1.SetGrowableHeight(4, 4, 32);
            buttonWidget1.SetSize(110, 40);
            buttonWidget1.SetPosition(20, -50);
            buttonWidget1.SetPositionRelative(0.025f, -1000f);
            buttonWidget1.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget1);
            var buttonWidget2 = new ButtonWidget(12);

            buttonWidget2.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget2.Size = FontSize.Medium;
            buttonWidget2.Text = "Next";
            buttonWidget2.SetGrowableWidth(4, 4, 32);
            buttonWidget2.SetGrowableHeight(4, 4, 32);
            buttonWidget2.SetSize(100, 32);
            buttonWidget2.SetPosition(400, -50);
            buttonWidget2.SetPositionRelative(0.8f, -1000f);
            buttonWidget2.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget2);
            frame.BGColor     = color4_3;
            frame.BorderColor = color4_4;
            frame.SetSizeRelative(1f, 0.6f);
            frame.SetPositionRelative(0.0f, 0.15f);
            BGColor = color4_2;
            SetSizeRelative(1f, 0.9f);
            SetPositionRelative(0.0f, 0.05f);
            AddChildElement(frame);
        }
示例#12
0
        public override void Init()
        {
            RelativeX      = 0.0f;
            RelativeY      = 0.0f;
            RelativeWidth  = 1f;
            RelativeHeight = 1f;
            var textWidget1 = new TextWidget(1)
            {
                Color         = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text          = "Re-insert Print Bed",
                RelativeWidth = 1f,
                Size          = FontSize.Medium,
                Alignment     = QFontAlignment.Centre
            };

            textWidget1.SetPosition(0, 25);
            AddChildElement(textWidget1);
            var frame = new Frame(2);

            frame.SetPosition(0, 50);
            frame.RelativeWidth  = 1f;
            frame.RelativeHeight = 0.75f;
            frame.BGColor        = new Color4(246, 246, 246, byte.MaxValue);
            frame.BorderColor    = new Color4(220, 220, 220, byte.MaxValue);
            AddChildElement(frame);
            Sprite.pixel_perfect = true;
            var imageWidget1 = new ImageWidget(0);

            imageWidget1.Init(Host, "extendedcontrols", 240f, 512f, 359f, 612f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget1.SetSize(120, 102);
            imageWidget1.SetPosition(10, 5);
            frame.AddChildElement(imageWidget1);
            var textWidget2 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "1. Wrap extra filament back on the spool and place the filament spool into the compartment. Make sure the label filament can unravel counter-clockwise."
            };

            textWidget2.SetSize(380, 100);
            textWidget2.Size       = FontSize.Medium;
            textWidget2.Alignment  = QFontAlignment.Left;
            textWidget2.VAlignment = TextVerticalAlignment.Top;
            textWidget2.SetPosition(140, 5);
            frame.AddChildElement(textWidget2);
            var imageWidget2 = new ImageWidget(0);

            imageWidget2.Init(Host, "extendedcontrols", 120f, 613f, 239f, 713f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget2.SetSize(120, 102);
            imageWidget2.SetPosition(10, 110);
            frame.AddChildElement(imageWidget2);
            var textWidget3 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "2. Re-insert the print bed"
            };

            textWidget3.SetSize(380, 100);
            textWidget3.Size       = FontSize.Medium;
            textWidget3.Alignment  = QFontAlignment.Left;
            textWidget3.VAlignment = TextVerticalAlignment.Top;
            textWidget3.SetPosition(140, 110);
            frame.AddChildElement(textWidget3);
            var imageWidget3 = new ImageWidget(0);

            imageWidget3.Init(Host, "extendedcontrols", 120f, 512f, 239f, 612f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget3.SetSize(120, 102);
            imageWidget3.SetPosition(10, 215);
            frame.AddChildElement(imageWidget3);
            var textWidget4 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "3. Make sure the print bed is secure and pull it forward to lock it."
            };

            textWidget4.SetSize(380, 100);
            textWidget4.Size       = FontSize.Medium;
            textWidget4.Alignment  = QFontAlignment.Left;
            textWidget4.VAlignment = TextVerticalAlignment.Top;
            textWidget4.SetPosition(140, 215);
            frame.AddChildElement(textWidget4);
            Sprite.pixel_perfect = false;
            var buttonWidget = new ButtonWidget(8);

            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 = "Next";
            buttonWidget.SetGrowableWidth(4, 4, 32);
            buttonWidget.SetGrowableHeight(4, 4, 32);
            buttonWidget.SetSize(100, 32);
            buttonWidget.SetPosition(400, -50);
            buttonWidget.RelativeX = 0.8f;
            buttonWidget.RelativeY = -1000f;
            buttonWidget.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget);
        }