private void ColourPanel_MouseDown(object sender, MouseEventArgs e) { if (this.DesignMode) { return; } if (!m_Applicable) { return; } GUIUtilities.FocusIfNotInPalette(this); HandleClick(HitTest(e.X, e.Y)); }
private void RoundButton_Click(object sender, EventArgs e) { // is also called indirectly if the button is triggered by other means if (Globals.CheckDiscardClick(this)) { return; } GUIUtilities.FocusIfNotInPalette(this.Parent); if (this.DesignMode || !m_Applicable || !Enabled) { return; // Or m_bolSelected - need to resend Tool=Measure in particular } if (m_Parameter != Parameters.None) { Globals.SetParameterValue(m_ParameterValue, m_Parameter); // it should raise the value changed event back again which will update the GUI } else { SetSelectionGUI(!m_Selected); UserChangedSelected?.Invoke(this, EventArgs.Empty); } WasSelected?.Invoke(this, EventArgs.Empty); }
private void CustomButton_Click(object sender, EventArgs e) { // is also called indirectly if the button is triggered by other means GUIUtilities.FocusIfNotInPalette(this.Parent); }