コード例 #1
0
 public void UpdateLeave()
 {
     if (_keeppress == false | (_keeppress == true & _ispressed == false))
     {
         _showbase   = _tempshowbase;
         _buttonMode = 0;
         mouse       = false;
     }
 }
コード例 #2
0
        protected override void OnMouseDown(MouseEventArgs mevent)
        {
            _showbase   = e_showbase.Yes;
            _buttonMode = 2;
            xmouse      = PointToClient(Cursor.Position).X;
            ymouse      = PointToClient(Cursor.Position).Y;
            mouse       = true;

            base.OnMouseDown(mevent);
        }
コード例 #3
0
        protected override void OnMouseEnter(EventArgs e)
        {
            mouse         = true;
            _buttonMode   = 1;
            xmouse        = PointToClient(Cursor.Position).X;
            _tempshowbase = _showbase;
            _showbase     = e_showbase.Yes;

            base.OnMouseEnter(e);
        }
コード例 #4
0
 protected override void OnMouseDown(MouseEventArgs mevent)
 {
     base.OnMouseDown(mevent);
     R0           = ColorPress.R; G0 = ColorPress.G; B0 = ColorPress.B;
     _colorStroke = ColorPressStroke;
     _showbase    = e_showbase.Yes;
     i_mode       = 2;
     xmouse       = PointToClient(Cursor.Position).X;
     ymouse       = PointToClient(Cursor.Position).Y;
     mouse        = true;
 }
コード例 #5
0
 protected override void OnMouseEnter(EventArgs e)
 {
     base.OnMouseEnter(e);
     _colorStroke  = ColorOnStroke;
     _tempshowbase = _showbase;
     _showbase     = e_showbase.Yes;
     i_mode        = 1;
     xmouse        = PointToClient(Cursor.Position).X;
     mouse         = true;
     A0            = 200;
     if (i_factor == 0)
     {
         R0 = _onColor.R; G0 = _onColor.G; B0 = _onColor.B;
     }
     timer1.Start();
 }
コード例 #6
0
 public void UpdateLeave()
 {
     if (_keeppress == false | (_keeppress == true & _ispressed == false))
     {
         _colorStroke = ColorBaseStroke;
         _showbase    = _tempshowbase;
         i_mode       = 0;
         mouse        = false;
         if (i_factor == 0)
         {
             R0 = _baseColor.R; G0 = _baseColor.G; B0 = _baseColor.B;
             this.Refresh();
         }
         else
         {
             timer1.Stop();
             timer1.Start();
         }
     }
 }
コード例 #7
0
        protected override void OnMouseUp(MouseEventArgs mevent)
        {
            _showbase = e_showbase.Yes;
            _buttonMode = 1;
            mouse = true;

            #region ClickSplit
            if (_imagelocation == EImagelocation.Left & xmouse > this.Width - _splitdistance & _splitbutton == e_splitbutton.Yes)
            {
                if (_arrow == e_arrow.ToDown)
                {
                    if (this.ContextMenuStrip != null)
                    {
                        this.ContextMenuStrip.Opacity = 1.0;
                        this.ContextMenuStrip.Show(this, 0, this.Height);
                    }

                }
                else if (_arrow == e_arrow.ToRight)
                {
                    if (this.ContextMenuStrip != null)
                    {
                        ContextMenuStrip menu = this.ContextMenuStrip;
                        this.ContextMenuStrip.Opacity = 1.0;
                        if (this.MenuPos.Y == 0)
                        {
                            this.ContextMenuStrip.Show(this, this.Width + 2, -this.Height);
                        }
                        else
                        {
                            this.ContextMenuStrip.Show(this, this.Width + 2, this.MenuPos.Y);
                        }
                    }

                }
            }
            else if (_imagelocation == EImagelocation.Top & ymouse > this.Height - _splitdistance & _splitbutton == e_splitbutton.Yes)
            {
                if (_arrow == e_arrow.ToDown)
                {
                    if (this.ContextMenuStrip != null)
                        this.ContextMenuStrip.Show(this, 0, this.Height);
                }
            }
            #endregion
            else
            {
                base.OnMouseUp(mevent);

                #region Keep Press
                if (_keeppress)
                {
                    _ispressed = true;

                    try
                    {
                        foreach (Control _control in this.Parent.Controls)
                        {
                            if (typeof(ButtonW) == _control.GetType() & _control.Name != this.Name)
                            {
                                ((ButtonW)(_control))._ispressed = false;
                                ((ButtonW)(_control)).UpdateLeave();
                                ((ButtonW)(_control)).Refresh();
                            }
                        }
                    }
                    catch { }
                }
                #endregion

            }
        }
コード例 #8
0
        protected override void OnMouseDown(MouseEventArgs mevent)
        {
            _showbase = e_showbase.Yes;
            _buttonMode = 2;
            xmouse = PointToClient(Cursor.Position).X;
            ymouse = PointToClient(Cursor.Position).Y;
            mouse = true;

            base.OnMouseDown(mevent);
        }
コード例 #9
0
        public void UpdateLeave()
        {
            if (_keeppress == false | (_keeppress == true & _ispressed == false))
            {
                _showbase = _tempshowbase;
                _buttonMode = 0;
                mouse = false;

            }
        }
コード例 #10
0
        protected override void OnMouseEnter(EventArgs e)
        {
            mouse = true;
            _buttonMode = 1;
            xmouse = PointToClient(Cursor.Position).X;
            _tempshowbase = _showbase;
            _showbase = e_showbase.Yes;

            base.OnMouseEnter(e);
        }
コード例 #11
0
        protected override void OnMouseUp(MouseEventArgs mevent)
        {
            _showbase   = e_showbase.Yes;
            _buttonMode = 1;
            mouse       = true;

            #region ClickSplit
            if (_imagelocation == EImagelocation.Left & xmouse > this.Width - _splitdistance & _splitbutton == e_splitbutton.Yes)
            {
                if (_arrow == e_arrow.ToDown)
                {
                    if (this.ContextMenuStrip != null)
                    {
                        this.ContextMenuStrip.Opacity = 1.0;
                        this.ContextMenuStrip.Show(this, 0, this.Height);
                    }
                }
                else if (_arrow == e_arrow.ToRight)
                {
                    if (this.ContextMenuStrip != null)
                    {
                        ContextMenuStrip menu = this.ContextMenuStrip;
                        this.ContextMenuStrip.Opacity = 1.0;
                        if (this.MenuPos.Y == 0)
                        {
                            this.ContextMenuStrip.Show(this, this.Width + 2, -this.Height);
                        }
                        else
                        {
                            this.ContextMenuStrip.Show(this, this.Width + 2, this.MenuPos.Y);
                        }
                    }
                }
            }
            else if (_imagelocation == EImagelocation.Top & ymouse > this.Height - _splitdistance & _splitbutton == e_splitbutton.Yes)
            {
                if (_arrow == e_arrow.ToDown)
                {
                    if (this.ContextMenuStrip != null)
                    {
                        this.ContextMenuStrip.Show(this, 0, this.Height);
                    }
                }
            }
            #endregion
            else
            {
                base.OnMouseUp(mevent);

                #region Keep Press
                if (_keeppress)
                {
                    _ispressed = true;

                    try
                    {
                        foreach (Control _control in this.Parent.Controls)
                        {
                            if (typeof(ButtonW) == _control.GetType() & _control.Name != this.Name)
                            {
                                ((ButtonW)(_control))._ispressed = false;
                                ((ButtonW)(_control)).UpdateLeave();
                                ((ButtonW)(_control)).Refresh();
                            }
                        }
                    }
                    catch { }
                }
                #endregion
            }
        }
コード例 #12
0
 protected override void OnMouseEnter(EventArgs e)
 {
     base.OnMouseEnter(e);
     _colorStroke = ColorOnStroke;
     _tempshowbase = _showbase;
     _showbase = e_showbase.Yes;
     i_mode = 1;
     xmouse = PointToClient(Cursor.Position).X;
     mouse = true;
     A0 = 200;
     if (i_factor == 0)
     {
         R0 = _onColor.R; G0 = _onColor.G; B0 = _onColor.B;
     }
     timer1.Start();
 }
コード例 #13
0
 protected override void OnMouseDown(MouseEventArgs mevent)
 {
     base.OnMouseDown(mevent);
     R0 = ColorPress.R; G0 = ColorPress.G; B0 = ColorPress.B;
     _colorStroke = ColorPressStroke;
     _showbase = e_showbase.Yes;
     i_mode = 2;
     xmouse = PointToClient(Cursor.Position).X;
     ymouse = PointToClient(Cursor.Position).Y;
     mouse = true;
 }
コード例 #14
0
 public void UpdateLeave()
 {
     if (_keeppress == false | (_keeppress == true & _ispressed == false))
     {
         _colorStroke = ColorBaseStroke;
         _showbase = _tempshowbase;
         i_mode = 0;
         mouse = false;
         if (i_factor == 0)
         {
             R0 = _baseColor.R; G0 = _baseColor.G; B0 = _baseColor.B;
             this.Refresh();
         }
         else
         {
             timer1.Stop();
             timer1.Start();
         }
     }
 }
コード例 #15
0
ファイル: RibbonMenuButton.cs プロジェクト: gburca/DreamBeam
        public void Check()
        {
            #region Keep Press
            if (_keeppress)
            {
                if (_singlepressbutton)
                {
                    _ispressed = true;
                    _Checked   = true;
                }
                else
                {
                    _ispressed = true;
                    _Checked   = true;
                    try
                    {
                        foreach (Control _control in this.Parent.Controls)
                        {
                            if (typeof(RibbonMenuButton) == _control.GetType() & _control.Name != this.Name & !this._singlepressbutton)
                            {
                                ((RibbonMenuButton)(_control))._ispressed = false;
                                ((RibbonMenuButton)(_control))._Checked   = false;
                                ((RibbonMenuButton)(_control)).UpdateLeave();
                            }
                        }
                    }
                    catch { }
                }
            }
            #endregion

            R0           = ColorOn.R; G0 = ColorOn.G; B0 = ColorOn.B;
            _colorStroke = ColorOnStroke;
            _showbase    = e_showbase.Yes;
            i_mode       = 1;
            mouse        = true;

            #region ClickSplit
            if (_imagelocation == e_imagelocation.Left & xmouse > this.Width - _splitdistance & _splitbutton == e_splitbutton.Yes)
            {
                if (_arrow == e_arrow.ToDown)
                {
                    if (this.ContextMenuStrip != null)
                    {
                        this.ContextMenuStrip.Opacity = 1.0;
                    }
                    this.ContextMenuStrip.Show(this, 0, this.Height);
                }
                else if (_arrow == e_arrow.ToRight)
                {
                    if (this.ContextMenuStrip != null)
                    {
                        ContextMenuStrip menu = this.ContextMenuStrip;
                        this.ContextMenuStrip.Opacity = 1.0;
                        if (this.MenuPos.Y == 0)
                        {
                            this.ContextMenuStrip.Show(this, this.Width + 2, -this.Height);
                        }
                        else
                        {
                            this.ContextMenuStrip.Show(this, this.Width + 2, this.MenuPos.Y);
                        }
                    }
                }
            }
            else if (_imagelocation == e_imagelocation.Top & ymouse > this.Height - _splitdistance & _splitbutton == e_splitbutton.Yes)
            {
                if (_arrow == e_arrow.ToDown)
                {
                    if (this.ContextMenuStrip != null)
                    {
                        this.ContextMenuStrip.Show(this, 0, this.Height);
                    }
                }
            }
            #endregion


            this.Refresh();
        }
コード例 #16
0
        protected override void OnMouseUp(MouseEventArgs mevent)
        {
            R0 = ColorOn.R; G0 = ColorOn.G; B0 = ColorOn.B;
              _colorStroke = ColorOnStroke;
              _showbase = e_showbase.Yes;
              i_mode = 1;
              mouse = true;

              if(this.ContextMenuStrip != null && _arrow != e_arrow.None &&
            (_splitbutton == e_splitbutton.No
              || (_splitbutton == e_splitbutton.Yes & _imagelocation == e_imagelocation.Left & xmouse > this.Width - _splitdistance)
              || (_splitbutton == e_splitbutton.Yes & _imagelocation == e_imagelocation.Top & xmouse > this.Height - _splitdistance)
            ))
              {
            if(_arrow == e_arrow.ToDown)
            {
              this.ContextMenuStrip.Opacity = 1.0;
              this.ContextMenuStrip.Show(this, 0, this.Height);
            }
            else if(_arrow == e_arrow.ToRight)
            {
              this.ContextMenuStrip.Opacity = 1.0;
              if(this.MenuPos.Y == 0)
            this.ContextMenuStrip.Show(this, this.Width + 2, -this.Height);
              else
            this.ContextMenuStrip.Show(this, this.Width + 2, this.MenuPos.Y);
            }
              }
              else
              {
            base.OnMouseUp(mevent);

            #region Keep Press
            if(_keeppress)
            {
              _ispressed = true;
              try
              {
            foreach(Control _control in this.Parent.Controls)
            {
              if(typeof(RibbonMenuButton) == _control.GetType() & _control.Name != this.Name)
              {
                ((RibbonMenuButton)(_control))._ispressed = false;
                ((RibbonMenuButton)(_control)).UpdateLeave();
              }
            }
              }
              catch { }
            }
            #endregion
              }
        }