protected override void OnMouseDown(MouseEventArgs mevent) { base.OnMouseDown(mevent); this.R0 = (int)this.ColorPress.R; this.G0 = (int)this.ColorPress.G; this.B0 = (int)this.ColorPress.B; this._colorStroke = this.ColorPressStroke; this._showbase = RibbonMenuButton.e_showbase.Yes; this.i_mode = 2; this.xmouse = base.PointToClient(Cursor.Position).X; this.ymouse = base.PointToClient(Cursor.Position).Y; this.mouse = true; }
protected override void OnMouseEnter(EventArgs e) { base.OnMouseEnter(e); this._colorStroke = this.ColorOnStroke; this._tempshowbase = this._showbase; this._showbase = RibbonMenuButton.e_showbase.Yes; this.i_mode = 1; this.xmouse = base.PointToClient(Cursor.Position).X; this.mouse = true; this.A0 = 200; if (this.i_factor == 0) { this.R0 = (int)this._onColor.R; this.G0 = (int)this._onColor.G; this.B0 = (int)this._onColor.B; } this.timer1.Start(); }
public void UpdateLeave() { if (!this._keeppress | (this._keeppress & !this._ispressed)) { this._colorStroke = this.ColorBaseStroke; this._showbase = this._tempshowbase; this.i_mode = 0; this.mouse = false; if (this.i_factor == 0) { this.R0 = (int)this._baseColor.R; this.G0 = (int)this._baseColor.G; this.B0 = (int)this._baseColor.B; this.Refresh(); } else { this.timer1.Stop(); this.timer1.Start(); } } }
protected override void OnMouseUp(MouseEventArgs mevent) { this.R0 = (int)this.ColorOn.R; this.G0 = (int)this.ColorOn.G; this.B0 = (int)this.ColorOn.B; this._colorStroke = this.ColorOnStroke; this._showbase = RibbonMenuButton.e_showbase.Yes; this.i_mode = 1; this.mouse = true; if (this._imagelocation == RibbonMenuButton.e_imagelocation.Left & this.xmouse > base.Width - this._splitdistance & this._splitbutton == RibbonMenuButton.e_splitbutton.Yes) { if (this._arrow == RibbonMenuButton.e_arrow.ToDown) { if (this.ContextMenuStrip != null) { this.ContextMenuStrip.Opacity = 1.0; } this.ContextMenuStrip.Show(this, 0, base.Height); } else if (this._arrow == RibbonMenuButton.e_arrow.ToRight) { if (this.ContextMenuStrip != null) { ContextMenuStrip contextMenuStrip = this.ContextMenuStrip; this.ContextMenuStrip.Opacity = 1.0; if (this.MenuPos.Y == 0) { this.ContextMenuStrip.Show(this, base.Width + 2, -base.Height); } else { this.ContextMenuStrip.Show(this, base.Width + 2, this.MenuPos.Y); } } } } else if (this._imagelocation == RibbonMenuButton.e_imagelocation.Top & this.ymouse > base.Height - this._splitdistance & this._splitbutton == RibbonMenuButton.e_splitbutton.Yes) { if (this._arrow == RibbonMenuButton.e_arrow.ToDown) { if (this.ContextMenuStrip != null) { this.ContextMenuStrip.Show(this, 0, base.Height); } } } else { base.OnMouseUp(mevent); if (this._keeppress) { this._ispressed = true; try { foreach (Control control in base.Parent.Controls) { if (typeof(RibbonMenuButton) == control.GetType() & control.Name != base.Name) { ((RibbonMenuButton)control)._ispressed = false; ((RibbonMenuButton)control).UpdateLeave(); } } } catch { } } } }