protected override bool OnMouseMove(MouseEventArgs eventArgs) { Point point = new Point(eventArgs.X, eventArgs.Y); this.Refresh(); this.UpdateTransparency(point); string text = string.Empty; bool isButtonDragged = this.IsButtonDragged; if (!this.IsButtonDragged) { for (int i = this.actions.Count - 1; i >= 0; i--) { DynamicAction action = this.actions[i]; Rectangle actionBounds = this.GetActionBounds(i); for (int j = 0; j < action.Buttons.Count; j++) { ActionButton button = action.Buttons[j]; if (actionBounds.Contains(point)) { bool flag2 = this.GetButtonBounds(i, j).Contains(point); if (flag2 && (text.Length == 0)) { text = button.Description; } if ((button.State != ActionButton.States.Disabled) && (button.State != ActionButton.States.Pressed)) { if (flag2) { button.State = ActionButton.States.Highlight; } else { button.State = ActionButton.States.Normal; } } isButtonDragged = true; } else if (button.State == ActionButton.States.Highlight) { button.State = ActionButton.States.Normal; } } } } WorkflowView parentView = base.ParentView; if (text.Length > 0) { this.infoTipSet = true; parentView.ShowInfoTip(text); return(isButtonDragged); } if (this.infoTipSet) { parentView.ShowInfoTip(string.Empty); this.infoTipSet = false; } return(isButtonDragged); }
private void ShowInfoTip(string infoTip) { WorkflowView service = this.serviceProvider.GetService(typeof(WorkflowView)) as WorkflowView; if (service != null) { service.ShowInfoTip(string.Empty, infoTip); } }
protected override bool OnMouseMove(MouseEventArgs eventArgs) { Point clientPoint = new Point(eventArgs.X, eventArgs.Y); Refresh(); UpdateTransparency(clientPoint); string infoTip = String.Empty; bool retval = IsButtonDragged; if (!IsButtonDragged) { for (int i = this.actions.Count - 1; i >= 0; i--) { DynamicAction action = this.actions[i]; Rectangle actionBounds = GetActionBounds(i); for (int j = 0; j < action.Buttons.Count; j++) { ActionButton actionButton = action.Buttons[j]; if (actionBounds.Contains(clientPoint)) { Rectangle buttonBounds = GetButtonBounds(i, j); bool buttonContainsPoint = buttonBounds.Contains(clientPoint); if (buttonContainsPoint && infoTip.Length == 0) { infoTip = actionButton.Description; } if (actionButton.State != ActionButton.States.Disabled && actionButton.State != ActionButton.States.Pressed) { if (buttonContainsPoint) { actionButton.State = ActionButton.States.Highlight; } else { actionButton.State = ActionButton.States.Normal; } } retval = true; } else { if (actionButton.State == ActionButton.States.Highlight) { actionButton.State = ActionButton.States.Normal; } } } } } WorkflowView parentView = ParentView; if (infoTip.Length > 0) { this.infoTipSet = true; parentView.ShowInfoTip(infoTip); } else if (this.infoTipSet) { parentView.ShowInfoTip(String.Empty); this.infoTipSet = false; } return(retval); }