private void UpdateQuickCustumisationIconState(Point p) { var vi = ViewInfo as CommonGridViewInfo; if (vi != null && !vi.AllowQuickCustomisation) { return; } var hi = ViewInfo.CalcHitInfo(p); if (hi.HitTest == GridHitTest.ColumnButton) { if (vi != null && vi.IsQuickCustomisationButton(p)) { if (vi.QuickCustomisationIconStatus == QuickCustomisationIconStatusEnum.Hot) { return; } vi.QuickCustomisationIconStatus = QuickCustomisationIconStatusEnum.Hot; ViewInfo.View.Invalidate(); return; } if (vi == null || vi.QuickCustomisationIconStatus == QuickCustomisationIconStatusEnum.Enabled) { return; } vi.QuickCustomisationIconStatus = QuickCustomisationIconStatusEnum.Enabled; ViewInfo.View.Invalidate(); } else if (vi != null && vi.QuickCustomisationIconStatus != QuickCustomisationIconStatusEnum.Hidden) { vi.QuickCustomisationIconStatus = QuickCustomisationIconStatusEnum.Hidden; ViewInfo.View.Invalidate(); } }
/// <summary> /// /// </summary> /// <param name="e"></param> protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); if (base.Parent != null) { base.UpdateViewInfoState(); if (e.Button == MouseButtons.Left) { EditHitInfo info1 = ViewInfo.CalcHitInfo(new Point(e.X, e.Y)); if (((info1.HitTest == EditHitTest.Button) && AllowButtonPress) && ViewInfo.CanPress(info1)) { ViewInfo.PressedInfo = info1; RefreshVisualLayout(); OnPressButton(info1.HitObject as EditorButtonObjectInfoArgs); } } } }
/// <summary> /// /// </summary> /// <param name="e"></param> protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); base.UpdateViewInfoState(); if (e.Button == MouseButtons.Left) { EditHitInfo info1 = ViewInfo.CalcHitInfo(new Point(e.X, e.Y)); EditHitInfo info2 = ViewInfo.PressedInfo; ClearHotPressed(); if ((info2 != null) && (info2.HitTest == EditHitTest.Button)) { NotifyButtonStateChanged((info2.HitObject as EditorButtonObjectInfoArgs).Button); } if ((AllowButtonPress && !info1.IsEmpty) && (ViewInfo.CompareHitInfo(info1, info2) && (info1.HitTest == EditHitTest.Button))) { OnClickButton(info1.HitObject as EditorButtonObjectInfoArgs); } } }