/// ------------------------------------------------------------------------------------ /// <summary> /// Handles the Closed event of the m_dropDown control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.Windows.Forms.ToolStripDropDownClosedEventArgs"/> /// instance containing the event data.</param> /// ------------------------------------------------------------------------------------ private void dropDown_Closed(object sender, ToolStripDropDownClosedEventArgs e) { // we have to set a variable so that we know that user clicked on drop down button // or in text box to close the drop down. m_fDropDownClickedClose = ClientRectangle.Contains(PointToClient(MousePosition)); m_dropDown = null; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Shows the drop down. /// </summary> /// ------------------------------------------------------------------------------------ private void ShowDropDown() { m_dropDown = new ColorPickerDropDown(m_fShowUnspecified, m_currentColor); m_dropDown.ColorPicked += new EventHandler(dropDown_ColorPicked); m_dropDown.Closed += new ToolStripDropDownClosedEventHandler(dropDown_Closed); m_dropDown.PreviewKeyDown += new PreviewKeyDownEventHandler(m_dropDown_PreviewKeyDown); m_dropDown.Show(this, new Point(0, Height)); }
/// ------------------------------------------------------------------------------------ /// <summary> /// This event occurs when the color picker drop down has chosen a color. /// </summary> /// ------------------------------------------------------------------------------------ private void dropDown_ColorPicked(object sender, EventArgs e) { ColorPickerDropDown dropDown = sender as ColorPickerDropDown; Debug.Assert(dropDown != null); ColorValue = dropDown.CurrentColor; Focus(); Refresh(); }
/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// <param name="disposing"></param> /// ------------------------------------------------------------------------------------ protected override void Dispose(bool disposing) { if (IsDisposed) { return; } if (disposing) { } m_colorName = null; m_dropDown = null; base.Dispose(disposing); }
/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// <param name="disposing"></param> /// ------------------------------------------------------------------------------------ protected override void Dispose(bool disposing) { System.Diagnostics.Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** "); if (IsDisposed) { return; } if (disposing) { } m_colorName = null; m_dropDown = null; base.Dispose(disposing); }
/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// <param name="disposing"></param> /// ------------------------------------------------------------------------------------ protected override void Dispose(bool disposing) { System.Diagnostics.Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** "); if (IsDisposed) return; if (disposing) { } m_colorName = null; m_dropDown = null; base.Dispose(disposing); }
/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// <param name="disposing"></param> /// ------------------------------------------------------------------------------------ protected override void Dispose(bool disposing) { if (IsDisposed) return; if (disposing) { } m_colorName = null; m_dropDown = null; base.Dispose(disposing); }