Beispiel #1
0
        public SlideBar(float minV, float maxV, float value, ETypeOrientation type)
        {
            this.minV = minV;
            MaxV_ = maxV;
            Type = type;
            Value = value;

            if (Type == ETypeOrientation.Horizontal)
            {
                Slider_ = new SlideBarSlider(ETypeOrientation.Horizontal);
                HorizontalStyle = EElementStyle.Stretch;
                VerticalStyle = EElementStyle.Fit;
                Size.width = 10;
                Size.height = 20;
                Slider_.Size.width = (uint)Math.Max((Size.width - 4) * 0.1f, 4);
                Slider_.Size.height = 16;
                Slider_.Position.X = (int)(((Size.width - 4) - Slider_.Size.width) * Value + 2);
                Slider_.Position.Y = 2;
                Slider_.SetSlideBar(this);
            }
            else
            {
                Slider_ = new SlideBarSlider(ETypeOrientation.Vertical);
                HorizontalStyle = EElementStyle.Fit;
                VerticalStyle = EElementStyle.Stretch;
                Size.width = 20;
                Size.height = 10;
                Slider_.Size.width = 16;
                Slider_.Size.height = (uint)Math.Max((Size.height - 4) * 0.1f, 4);
                Slider_.Position.X = 2;
                Slider_.Position.Y = (int)(((Size.height - 4) - Slider_.Size.height) * Value + 2);
                Slider_.SetSlideBar(this);
            }
        }
Beispiel #2
0
        public SlideBar(float minV, float maxV, float value, ETypeOrientation type)
        {
            this.minV = minV;
            MaxV_     = maxV;
            Type      = type;
            Value     = value;

            if (Type == ETypeOrientation.Horizontal)
            {
                Slider_             = new SlideBarSlider(ETypeOrientation.Horizontal);
                HorizontalStyle     = EElementStyle.Stretch;
                VerticalStyle       = EElementStyle.Fit;
                Size.width          = 10;
                Size.height         = 20;
                Slider_.Size.width  = (uint)Math.Max((Size.width - 4) * 0.1f, 4);
                Slider_.Size.height = 16;
                Slider_.Position.X  = (int)(((Size.width - 4) - Slider_.Size.width) * Value + 2);
                Slider_.Position.Y  = 2;
                Slider_.SetSlideBar(this);
            }
            else
            {
                Slider_             = new SlideBarSlider(ETypeOrientation.Vertical);
                HorizontalStyle     = EElementStyle.Fit;
                VerticalStyle       = EElementStyle.Stretch;
                Size.width          = 20;
                Size.height         = 10;
                Slider_.Size.width  = 16;
                Slider_.Size.height = (uint)Math.Max((Size.height - 4) * 0.1f, 4);
                Slider_.Position.X  = 2;
                Slider_.Position.Y  = (int)(((Size.height - 4) - Slider_.Size.height) * Value + 2);
                Slider_.SetSlideBar(this);
            }
        }
        public override void PaintSlideBarSlider(SlideBarSlider component)
        {
            Position origin = UI.Instance.GetOrigin();

            GL.Disable(EnableCap.Texture2D);
            GL.Color3((byte)46, (byte)55, (byte)53);
            GL.Begin(BeginMode.Quads);
            GL.Vertex2(origin.X + component.Position.X, origin.Y + component.Position.Y);
            GL.Vertex2(origin.X + component.Position.X + component.Size.width, origin.Y + component.Position.Y);
            GL.Vertex2(origin.X + component.Position.X + component.Size.width, origin.Y + component.Position.Y + component.Size.height);
            GL.Vertex2(origin.X + component.Position.X, origin.Y + component.Position.Y + component.Size.height);
            GL.End();
        }
Beispiel #4
0
 public abstract void PaintSlideBarSlider(SlideBarSlider component);