Exemple #1
0
        public void SetRotationValues(float x, float y, float z)
        {
            if (printerview.SelectedModelTransformPair == null)
            {
                return;
            }

            if (editmode == ModelAdjustmentsDialog.EditMode.Rotation)
            {
                X_Slider.SetTrackPosition(x);
                Y_Slider.SetTrackPosition(y);
                Z_Slider.SetTrackPosition(z);
            }
            printerview.ObjectTransformed = true;
        }
Exemple #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;
 }
Exemple #3
0
        public override void Refresh()
        {
            bool flag1;
            bool flag2;

            if (ShowScrollbar == GenericScrollFrame <T> .ScrollBarState.Off)
            {
                flag1 = false;
                flag2 = false;
            }
            else if (ShowScrollbar == GenericScrollFrame <T> .ScrollBarState.On)
            {
                flag1 = true;
                flag2 = true;
            }
            else
            {
                flag1 = ScollableChildframe.Width > Width;
                flag2 = ScollableChildframe.Height > Height;
            }
            m_frameDrawableRegion.Width  = (flag2 ? Width - scrollbar_width : Width) - 4;
            m_frameDrawableRegion.Height = (flag1 ? Height - scrollbar_width : Height) - 4;
            if (flag2)
            {
                var height = flag1 ? Height - scrollbar_width : Height;
                verticalSlider.SetPosition(-scrollbar_width, 0);
                verticalSlider.SetSize(scrollbar_width, height);
                var num = ScollableChildframe.Height - m_frameDrawableRegion.Height;
                if (num < 0)
                {
                    num = 0;
                }

                verticalSlider.Visible = true;
                verticalSlider.Enabled = true;
                verticalSlider.SetRange(0.0f, ScollableChildframe.Height - Height);
                verticalSlider.PushButtonStep = (int)Math.Ceiling((double)num / 10.0);
            }
            else
            {
                if (verticalSlider.Visible)
                {
                    verticalSlider.SetTrackPosition(0.0f);
                }

                verticalSlider.Visible = false;
                verticalSlider.Enabled = false;
            }
            if (flag1)
            {
                var width = flag2 ? Width - scrollbar_width : Width;
                horizonalSlider.SetPosition(0, -scrollbar_width);
                horizonalSlider.SetSize(width, scrollbar_width);
                var num = ScollableChildframe.Width - m_frameDrawableRegion.Width;
                if (num < 0)
                {
                    num = 0;
                }

                horizonalSlider.Visible = true;
                horizonalSlider.Enabled = true;
                horizonalSlider.SetRange(0.0f, ScollableChildframe.Width - Width);
                horizonalSlider.PushButtonStep = 1f;
                horizonalSlider.PushButtonStep = (int)Math.Ceiling((double)num / 10.0);
            }
            else
            {
                if (horizonalSlider.Visible)
                {
                    horizonalSlider.SetTrackPosition(0.0f);
                }

                horizonalSlider.Visible = false;
                horizonalSlider.Enabled = false;
            }
        }