void CTreePropSheetSplitter::OnMouseMove(UINT nFlags, CPoint point) 
{
  UNREFERENCED_PARAMETER(nFlags);

  if (GetCapture() != this) 
		return;
	InvertTracker();

  m_nTracker = (m_nOrientation == SSP_HORZ ? point.x : point.y) - m_nTrackerMouseOffset;
  ASSERT( m_nTrackIndex > 0 );
	if (m_nTracker > m_orig[m_nTrackIndex + 1] - m_nBarThickness - m_pzMinSize[m_nTrackIndex])
  {
    m_nTracker = m_orig[m_nTrackIndex + 1] - m_nBarThickness - m_pzMinSize[m_nTrackIndex];
  }
  else if (m_nTracker < m_orig[m_nTrackIndex - 1] + m_nBarThickness + m_pzMinSize[m_nTrackIndex-1])
  {
    m_nTracker = m_orig[m_nTrackIndex - 1] + m_nBarThickness + m_pzMinSize[m_nTrackIndex-1];
  }
  
  InvertTracker();

	CRect rcOuter;
	GetAdjustedClientRect(&rcOuter);
	// Real-time update.
  if( m_bRealtimeUpdate )
  {
    m_orig[m_nTrackIndex] = m_nTracker;
    ResizePanes();
  }
}
Example #2
0
void CSimpleSplitter::OnMouseMove(UINT nFlags, CPoint point) 
{
	if (GetCapture() != this) 
		return;
	InvertTracker();
	m_nTracker = (m_nOrientation == SSP_HORZ ? point.x : point.y) - m_nTrackerMouseOffset;
	if (m_nTracker > m_orig[m_nTrackIndex + 1] - m_nBarThickness - m_nMinSize)
		m_nTracker = m_orig[m_nTrackIndex + 1] - m_nBarThickness - m_nMinSize;
	else if (m_nTracker < m_orig[m_nTrackIndex - 1] + m_nBarThickness + m_nMinSize)
		m_nTracker = m_orig[m_nTrackIndex - 1] + m_nBarThickness + m_nMinSize;
	InvertTracker();
}
Example #3
0
void CSimpleSplitter::OnLButtonUp(UINT nFlags, CPoint point) 
{
	InvertTracker();
	ReleaseCapture();
	m_orig[m_nTrackIndex] = m_nTracker;
	RecalcSizes();
}
Example #4
0
void CSimpleSplitter::OnLButtonDown(UINT nFlags, CPoint point) 
{
	CRect rcClient;
	int mouse_pos = m_nOrientation == SSP_HORZ ? point.x : point.y;

	SetCapture();
	for (m_nTrackIndex = 1; (m_nTrackIndex < m_nPanes && m_orig[m_nTrackIndex] < mouse_pos); m_nTrackIndex++);
	m_nTracker = m_orig[m_nTrackIndex];
	m_nTrackerMouseOffset = mouse_pos - m_nTracker;
	GetClientRect(&rcClient);
	m_nTrackerLength = m_nOrientation == SSP_HORZ ? rcClient.Height() : rcClient.Width();
	InvertTracker();
}
void CTreePropSheetSplitter::OnLButtonDown(UINT nFlags, CPoint point) 
{
  UNREFERENCED_PARAMETER(nFlags);

  // Must be in AllowUserResizing mode.
  if( !m_bAllowUserResizing )
    return;

	CRect rcClient;
	int mouse_pos = m_nOrientation == SSP_HORZ ? point.x : point.y;

	SetCapture();
	for (m_nTrackIndex = 1; (m_nTrackIndex < m_nPanes && m_orig[m_nTrackIndex] < mouse_pos); m_nTrackIndex++);
	m_nTracker = m_orig[m_nTrackIndex];
	m_nTrackerMouseOffset = mouse_pos - m_nTracker;
	GetWindowRect(&rcClient);
	GetParent()->ScreenToClient(&rcClient);
	m_nTrackerLength = m_nOrientation == SSP_HORZ ? rcClient.Height() : rcClient.Width();
	InvertTracker();
}
void CTreePropSheetSplitter::OnLButtonUp(UINT nFlags, CPoint point) 
{
  UNREFERENCED_PARAMETER(nFlags);
  UNREFERENCED_PARAMETER(point);

  if (GetCapture() != this) 
		return;

	CRect rcOuter;
	int size_sum;

	GetAdjustedClientRect(&rcOuter);
	size_sum = m_nOrientation == SSP_HORZ ? rcOuter.Width() : rcOuter.Height();
	size_sum -= (m_nPanes - 1) * m_nBarThickness;

  InvertTracker();
	ReleaseCapture();
	m_orig[m_nTrackIndex] = m_nTracker;
	m_size[m_nTrackIndex - 1] = MulDivRound(m_orig[m_nTrackIndex] - m_orig[m_nTrackIndex - 1] - m_nBarThickness, FULL_SIZE, size_sum);
	m_size[m_nTrackIndex]     = MulDivRound(m_orig[m_nTrackIndex + 1] - m_orig[m_nTrackIndex] - m_nBarThickness, FULL_SIZE, size_sum);
	ResizePanes();
}