Ejemplo n.º 1
0
        public override void Init()
        {
            var color4_1 = new Color4(246, 246, 246, byte.MaxValue);
            var color4_2 = new Color4(220, 220, 220, byte.MaxValue);
            var color4_3 = new Color4(0.15f, 0.15f, 0.15f, 1f);
            var frame    = new Frame(0)
            {
                BorderColor = color4_2,
                BGColor     = color4_1
            };
            var textWidget1 = new TextWidget(11)
            {
                Color = color4_3
            };

            textWidget1.SetSize(500, 50);
            textWidget1.SetPosition(0, 25);
            textWidget1.Alignment  = QFontAlignment.Centre;
            textWidget1.VAlignment = TextVerticalAlignment.Middle;
            textWidget1.CenterHorizontallyInParent = true;
            textWidget1.Text = "Change Current Temperature Settings:";
            AddChildElement(textWidget1);
            var textWidget2 = new TextWidget(12)
            {
                Color          = new Color4(0.35f, 0.35f, 0.35f, 1f),
                RelativeWidth  = 0.45f,
                RelativeHeight = 0.2f,
                RelativeX      = 0.0f,
                RelativeY      = 0.1f,
                Alignment      = QFontAlignment.Right,
                VAlignment     = TextVerticalAlignment.Middle,
                Text           = "Color:"
            };

            frame.AddChildElement(textWidget2);
            textColor = new TextWidget(14)
            {
                Color          = new Color4(0.35f, 0.35f, 0.35f, 1f),
                RelativeWidth  = 0.45f,
                RelativeHeight = 0.2f,
                RelativeX      = 0.55f,
                RelativeY      = 0.1f,
                Alignment      = QFontAlignment.Left,
                VAlignment     = TextVerticalAlignment.Middle,
                Text           = ""
            };
            frame.AddChildElement(textColor);
            var textWidget3 = new TextWidget(15)
            {
                Color          = new Color4(0.35f, 0.35f, 0.35f, 1f),
                RelativeWidth  = 0.45f,
                RelativeHeight = 0.2f,
                RelativeX      = 0.0f,
                RelativeY      = 0.3f,
                Alignment      = QFontAlignment.Right,
                VAlignment     = TextVerticalAlignment.Middle,
                Text           = "Material:"
            };

            frame.AddChildElement(textWidget3);
            textMaterial = new TextWidget(16)
            {
                Color          = new Color4(0.35f, 0.35f, 0.35f, 1f),
                RelativeWidth  = 0.45f,
                RelativeHeight = 0.2f,
                RelativeX      = 0.55f,
                RelativeY      = 0.3f,
                Alignment      = QFontAlignment.Left,
                VAlignment     = TextVerticalAlignment.Middle,
                Text           = "PLA"
            };
            frame.AddChildElement(textMaterial);
            var textWidget4 = new TextWidget(17)
            {
                Color          = new Color4(0.35f, 0.35f, 0.35f, 1f),
                RelativeWidth  = 0.45f,
                RelativeHeight = 0.2f,
                RelativeX      = 0.0f,
                RelativeY      = 0.5f,
                Alignment      = QFontAlignment.Right,
                VAlignment     = TextVerticalAlignment.Middle,
                Text           = "Temperature:"
            };

            frame.AddChildElement(textWidget4);
            custom_temperature_edit = new EditBoxWidget(13);
            custom_temperature_edit.Init(Host, "guicontrols", 898f, 104f, 941f, 135f);
            custom_temperature_edit.SetGrowableWidth(3, 3, 32);
            custom_temperature_edit.Text    = "";
            custom_temperature_edit.Enabled = true;
            custom_temperature_edit.SetSize(100, 24);
            custom_temperature_edit.Color = color4_3;
            custom_temperature_edit.SetTextWindowBorders(4, 4, 4, 4);
            custom_temperature_edit.RelativeX = 0.55f;
            custom_temperature_edit.RelativeY = 0.55f;
            custom_temperature_edit.SetVisible(true);
            custom_temperature_edit.SetCallbackEnterKey(new EditBoxWidget.EditBoxCallback(TemperatureEditEnterCallback));
            frame.AddChildElement(custom_temperature_edit);
            var buttonWidget1 = new ButtonWidget(20);

            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 = "Reset";
            buttonWidget1.SetSize(70, 24);
            buttonWidget1.RelativeX = 0.63f;
            buttonWidget1.RelativeY = 0.55f;
            buttonWidget1.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            frame.AddChildElement(buttonWidget1);
            var buttonWidget2 = new ButtonWidget(18, this);

            buttonWidget2.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget2.Color = new Color4(0.5f, 0.5f, 0.5f, 1f);
            buttonWidget2.Size  = FontSize.Large;
            buttonWidget2.SetSize(100, 32);
            buttonWidget2.RelativeX = 0.35f;
            buttonWidget2.RelativeY = 0.8f;
            buttonWidget2.SetGrowableHeight(4, 4, 32);
            buttonWidget2.SetGrowableWidth(4, 4, 32);
            buttonWidget2.Text = "Cancel";
            buttonWidget2.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget2);
            var buttonWidget3 = new ButtonWidget(19, this);

            buttonWidget3.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget3.Color = color4_3;
            buttonWidget3.Size  = FontSize.Large;
            buttonWidget3.SetSize(100, 32);
            buttonWidget3.RelativeX = 0.55f;
            buttonWidget3.RelativeY = 0.8f;
            buttonWidget3.SetGrowableHeight(4, 4, 32);
            buttonWidget3.SetGrowableWidth(4, 4, 32);
            buttonWidget3.Text = "Save";
            buttonWidget3.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget3);
            SetPosition(0, 0);
            RelativeWidth        = 1f;
            RelativeHeight       = 1f;
            frame.RelativeX      = 0.0f;
            frame.RelativeY      = 0.2f;
            frame.RelativeWidth  = 1f;
            frame.RelativeHeight = 0.5f;
            AddChildElement(frame);
        }
Ejemplo n.º 2
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;
 }