public GenericScrollFrame(int ID, Element2D parent) : base(ID, parent) { verticalSlider = new VerticalSliderWidget(0, this); horizonalSlider = new HorizontalSliderWidget(1, this); m_frameDrawableRegion = new Frame { Clipping = true }; m_frameDrawableRegion.SetPosition(2, 2); ScollableChildframe = Activator.CreateInstance <T>(); ScollableChildframe.ID = 2; ScollableChildframe.Parent = (this); ScollableChildframe.always_contains_point = true; m_frameDrawableRegion.AddChildElement(ScollableChildframe); }
public HorizontalSliderWidget(HorizontalSliderWidget source, int ID, Element2D parent) : base(ID, parent) { CopySliderProperties(source); }
public HorizontalSliderWidget(HorizontalSliderWidget source, int ID) : this(source, ID, null) { }
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; }