/// <summary> /// </summary> /// <param name="mouse"></param> /// <param name="but"></param> /// <param name="act"></param> /// <returns></returns> public override NuGenMiniBarButtonState Action(Point mouse, MouseButtons but, NuGenMiniBarUpdateAction act) { if (this.ClientRectangle.Contains(mouse)) { if (act == NuGenMiniBarUpdateAction.MouseDown) _click = true; else if (act == NuGenMiniBarUpdateAction.MouseUp && _click) { if (this.Owner != null) this.Owner.ClickButton(this); _click = false; } return _click ? NuGenMiniBarButtonState.Pressed : NuGenMiniBarButtonState.Hot; } else return NuGenMiniBarButtonState.Normal; }
/// <summary> /// </summary> public void UpdateButtons(NuGenMiniBarUpdateAction act) { NuGenMiniBarButtonState st; Point pt = this.PointToClient(Control.MousePosition); MouseButtons but = Control.MouseButtons; int i = 0; foreach (NuGenMiniBarControl btn in _coll) { st = btn.Action(pt, but, act); if (st != _btnStates[i]) { _btnStates[i] = st; this.Invalidate(Rectangle.Inflate(btn.ClientRectangle, 1, 1)); this.Update(); } i++; } }
/// <summary> /// </summary> public abstract NuGenMiniBarButtonState Action(Point mouse, MouseButtons but, NuGenMiniBarUpdateAction act);
/// <summary> /// </summary> /// <param name="mouse"></param> /// <param name="but"></param> /// <param name="act"></param> /// <returns></returns> public override NuGenMiniBarButtonState Action(Point mouse, MouseButtons but, NuGenMiniBarUpdateAction act) { if (this.ClientRectangle.Contains(mouse)) { if (act == NuGenMiniBarUpdateAction.MouseDown) { _click = true; } else if (act == NuGenMiniBarUpdateAction.MouseUp && _click) { if (this.Owner != null) { this.Owner.ClickButton(this); } _click = false; } return(_click ? NuGenMiniBarButtonState.Pressed : NuGenMiniBarButtonState.Hot); } else { return(NuGenMiniBarButtonState.Normal); } }
/// <summary> /// </summary> /// <param name="mouse"></param> /// <param name="but"></param> /// <param name="act"></param> /// <returns></returns> public override NuGenMiniBarButtonState Action(Point mouse, MouseButtons but, NuGenMiniBarUpdateAction act) { return(NState); }
/// <summary> /// </summary> /// <param name="mouse"></param> /// <param name="but"></param> /// <param name="act"></param> /// <returns></returns> public override NuGenMiniBarButtonState Action(Point mouse, MouseButtons but, NuGenMiniBarUpdateAction act) { return NState; }