Example #1
0
        protected internal override void Draw(int X, int Y)
        {
            int position = this.GetPosition(this.Width);

            if (this.m_State == GVolumeSlider.State.LargeScrollUp)
            {
                if (position > 0)
                {
                    int x = this.PointToClient(new Point(Engine.m_xMouse, Engine.m_yMouse)).X;
                    if (position > x)
                    {
                        this.Value -= this.LargeOffset;
                    }
                    else
                    {
                        this.m_State = GVolumeSlider.State.Inactive;
                    }
                }
            }
            else if (this.m_State == GVolumeSlider.State.LargeScrollDown && this.Width - position - this.m_Texture.Width > 0)
            {
                this.Value += this.LargeOffset;
                int x = this.PointToClient(new Point(Engine.m_xMouse, Engine.m_yMouse)).X;
                if (position + this.m_Texture.Width < x)
                {
                    this.Value += this.LargeOffset;
                }
                else
                {
                    this.m_State = GVolumeSlider.State.Inactive;
                }
            }
            this.m_Texture.Draw(X + position - this.m_Texture.Width / 2, Y + (this.Height - this.m_Texture.Height) / 2);
        }
Example #2
0
 protected internal override void OnMouseUp(int X, int Y, MouseButtons mb)
 {
     if (Gumps.Capture == this && this.m_State == GVolumeSlider.State.Normal)
     {
         this.Value = this.GetValue(X, this.Width);
     }
     else if (mb == MouseButtons.Right)
     {
         Gumps.Destroy(this.Parent);
     }
     this.m_State  = GVolumeSlider.State.Inactive;
     Gumps.Capture = (Gump)null;
 }
Example #3
0
        protected internal override void OnMouseDown(int X, int Y, MouseButtons mb)
        {
            if (mb != MouseButtons.Left)
            {
                return;
            }
            int num      = this.m_Texture.Width;
            int position = this.GetPosition(this.Width);

            this.m_State  = GVolumeSlider.State.Normal;
            this.m_Offset = X - position;
            this.Value    = this.GetValue(X, this.Width);
            Gumps.Capture = (Gump)this;
        }