/// <summary> /// Overrides, when click on, handles color selection. /// </summary> /// <param name="e"></param> protected override void OnMouseClick(MouseEventArgs e) { base.OnMouseClick(e); // Check cursor, if on one of the buttons - hot track it for (int recIndex = 0; recIndex < buttons.Length; recIndex++) { if (buttons[recIndex].Contains(e.Location)) { mCurrentSelected = recIndex; // More mSelectableWidths - open dialog if (mCurrentSelected == 5) { LineWidth = OpenMoreLinesDialog(); } else { LineWidth = CustomLineWeights.SelectableLineWeights[recIndex]; lineWidthTip.SetToolTip(this, CustomLineWeights.SelectableLineWeights[recIndex].ToString()); } if (mContextForm != null) { mContextForm.Hide(); } mContextForm = null; } } this.Refresh(); }
/// <summary> /// Overrides, when click on, handles color selection. /// </summary> /// <param name="e"></param> protected override void OnMouseClick(MouseEventArgs e) { base.OnMouseClick(e); // Check cursor, if on one of the buttons - hot track it for (int recIndex = 0; recIndex < buttons.Length; recIndex++) { if (buttons[recIndex].Contains(e.Location)) { mCurrentSelected = recIndex; //if a custom cap is choosen we need to set the CustomLineCap if (CustomCaps.SelectableLineCaps[recIndex] == ConnectionCap.Generalization) { mCustomLineCap = generalizationCap; } else { mCustomLineCap = null; } LineCap = CustomCaps.SelectableLineCaps[recIndex]; lineWidthTip.SetToolTip(this, CustomCaps.SelectableLineCaps[recIndex].ToString()); if (mContextForm != null) { mContextForm.Hide(); } mContextForm = null; } } this.Refresh(); }