/// ------------------------------------------------------------------------------------ /// <summary> /// When the mouse goes down over the edge of the container panel, then put the user /// in the resize mode. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.Windows.Forms.MouseEventArgs"/> instance /// containing the event data.</param> /// ------------------------------------------------------------------------------------ protected void OnParentMouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left && m_sizingRectangle.Contains(e.Location)) { m_resizeInProcess = true; m_sizingLine = new SizingLine(m_parent.ClientSize.Width, kPaddingForCollapsedLine); m_sizingLine.Location = new Point(0, 0); m_sizingLine.Visible = true; m_parent.Controls.Add(m_sizingLine); m_sizingLine.BringToFront(); } }
/// ------------------------------------------------------------------------------------ /// <summary> /// If terminating a resize process, then resize the container panel based on where /// the user left the sizing line. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.Windows.Forms.MouseEventArgs"/> instance /// containing the event data.</param> /// ------------------------------------------------------------------------------------ protected void OnParentMouseUp(object sender, MouseEventArgs e) { m_parent.Cursor = Cursors.Default; if (m_resizeInProcess) { m_resizeInProcess = false; OnSplitterMoved(m_sizingLine.Top); m_parent.Controls.Remove(m_sizingLine); m_sizingLine.Dispose(); m_sizingLine = null; } }
/// <summary/> protected virtual void Dispose(bool fDisposing) { System.Diagnostics.Debug.WriteLineIf(!fDisposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** "); if (fDisposing && !IsDisposed) { // dispose managed and unmanaged objects if (m_sizingLine != null) { m_sizingLine.Dispose(); } } m_sizingLine = null; IsDisposed = true; }
/// <summary/> protected virtual void Dispose(bool fDisposing) { System.Diagnostics.Debug.WriteLineIf(!fDisposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** "); if (fDisposing && !IsDisposed) { // dispose managed and unmanaged objects if (m_sizingLine != null) m_sizingLine.Dispose(); } m_sizingLine = null; IsDisposed = true; }