protected override void OnMouseMove(MouseEventArgs e) { switch (fMode) { case ChartControlMode.Default: TreeChartPerson mPers; MouseAction mAct = GetMouseAction(e, MouseEvent.meMove, out mPers); if (mAct == MouseAction.Highlight) { SetHighlight(mPers); } else { SetHighlight(null); ITreeControl ctl = fTreeControls.Contains(e.X, e.Y); if (ctl != null) { fMode = ChartControlMode.ControlsVisible; ctl.UpdateState(); ctl.Visible = true; ctl.MouseMove(e.X, e.Y); fActiveControl = ctl; fToolTip.Show(ctl.Tip, this, e.X + Left, e.Y + Top, 1500); } } break; case ChartControlMode.DragImage: Point pt = e.Location; AdjustScroll(-(pt.X - fMouseX), -(pt.Y - fMouseY)); fMouseX = pt.X; fMouseY = pt.Y; break; case ChartControlMode.ControlsVisible: if (fActiveControl != null) { if (!(fActiveControl.Contains(e.X, e.Y) || fActiveControl.MouseCaptured)) { fMode = ChartControlMode.Default; fActiveControl.Visible = false; fToolTip.Hide(this); fActiveControl = null; } else { fActiveControl.MouseMove(e.X, e.Y); } } break; } base.OnMouseMove(e); }
protected override void OnMouseMove(MouseEventArgs e) { switch (fMode) { case ChartControlMode.ccmDefault: var mAct = GetMouseAction(e, MouseEvent.meMove); if (mAct.Action == MouseAction.maHighlight) { SetHighlight(mAct.Person); } else { SetHighlight(null); ITreeControl ctl = fTreeControls.Contains(e.X, e.Y); if (ctl != null) { fMode = ChartControlMode.ccmControlsVisible; ctl.Visible = true; ctl.MouseMove(e.X, e.Y); fActiveControl = ctl; var pt = new Point(e.X + Left, e.Y + Top); fToolTip.Show(ctl.Tip, this, pt, 1500); } } break; case ChartControlMode.ccmDragImage: AdjustScroll(-(e.X - fMouseX), -(e.Y - fMouseY)); fMouseX = e.X; fMouseY = e.Y; break; case ChartControlMode.ccmControlsVisible: if (fActiveControl != null) { if (!(fActiveControl.Contains(e.X, e.Y) || fActiveControl.MouseCaptured)) { fMode = ChartControlMode.ccmDefault; fActiveControl.Visible = false; fToolTip.Hide(this); fActiveControl = null; } else { fActiveControl.MouseMove(e.X, e.Y); } } break; } base.OnMouseMove(e); }
protected override void OnMouseMove(MouseEventArgs e) { //Point ctPt = new Point((int)e.Location.X, (int)e.Location.Y); Point scrPt = GetScrollRelativeLocation(e.Location); switch (fMode) { case ChartControlMode.ccmDefault: TreeChartPerson mPers; MouseAction mAct = GetMouseAction(e, MouseEvent.meMove, out mPers); if (mAct == MouseAction.maHighlight) { SetHighlight(mPers); } else { SetHighlight(null); ITreeControl ctl = fTreeControls.Contains(scrPt.X, scrPt.Y); if (ctl != null) { fMode = ChartControlMode.ccmControlsVisible; ctl.Visible = true; ctl.MouseMove(scrPt.X, scrPt.Y); fActiveControl = ctl; //pt = new Point(pt.X + Left, pt.Y + Top); //fToolTip.Show(ctl.Tip, this, pt, 1500); ToolTip = ctl.Tip; } } break; case ChartControlMode.ccmDragImage: Point pt = new Point(e.Location); AdjustScroll(-(pt.X - fMouseX), -(pt.Y - fMouseY)); fMouseX = pt.X; fMouseY = pt.Y; break; case ChartControlMode.ccmControlsVisible: if (fActiveControl != null) { if (!(fActiveControl.Contains(scrPt.X, scrPt.Y) || fActiveControl.MouseCaptured)) { fMode = ChartControlMode.ccmDefault; fActiveControl.Visible = false; //fToolTip.Hide(this); ToolTip = ""; fActiveControl = null; } else { fActiveControl.MouseMove(scrPt.X, scrPt.Y); } } break; } e.Handled = true; base.OnMouseMove(e); }