Exemplo n.º 1
0
 /// ------------------------------------------------------------------------------------
 /// <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();
     }
 }
Exemplo n.º 2
0
        /// ------------------------------------------------------------------------------------
        /// <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;
            }
        }
Exemplo n.º 3
0
 /// <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;
 }
Exemplo n.º 4
0
		/// ------------------------------------------------------------------------------------
		/// <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();
			}
		}
Exemplo n.º 5
0
		/// ------------------------------------------------------------------------------------
		/// <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;
			}
		}
Exemplo n.º 6
0
		/// <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;
		}