FlatSplitter.cpp. #1

  • //
  • guest/
  • YourUncleBob/
  • p4win/
  • main/
  • gui/
  • FlatSplitter.cpp.
  • View
  • Commits
  • Open Download .zip Download (2 KB)
// FlatSplitter.cpp : implementation file
//

#include "stdafx.h"
#include "FlatSplitter.h"
#include <..\\src\\mfc\\afximpl.h>

#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CFlatSplitter

IMPLEMENT_DYNCREATE(CFlatSplitter, CSplitterWnd)

BEGIN_MESSAGE_MAP(CFlatSplitter, CSplitterWnd)
END_MESSAGE_MAP()


CFlatSplitter::CFlatSplitter()
{ 
    
}

CFlatSplitter::~CFlatSplitter()
{                 
 
}

#ifndef CX_BORDER
#define CX_BORDER 1
#endif

#ifndef CY_BORDER
#define CY_BORDER 1
#endif


void CFlatSplitter::OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rectArg)
{
	// This is a modification of CSplitterWnd::OnDrawSplitter()
	// Unfortunately, CSplitterWnd borders aren't configurable, so this is
	// the only way to get a flatter look to the splitters.

	// if pDC == NULL, then just invalidate
	if (pDC == NULL)
	{
		RedrawWindow(rectArg, NULL, RDW_INVALIDATE|RDW_NOCHILDREN);
		return;
	}
	ASSERT_VALID(pDC);

	// otherwise, actually draw
	CRect rect = rectArg;
	switch (nType)
	{
	case splitBorder:
		pDC->Draw3dRect(rect, afxData.clrBtnFace, afxData.clrBtnFace);
		rect.InflateRect(-CX_BORDER, -CY_BORDER);
		pDC->Draw3dRect(rect, afxData.clrBtnShadow, afxData.clrBtnHilite);
		return;

	case splitIntersection:
		break;

	case splitBox:
		pDC->Draw3dRect(rect, afxData.clrBtnShadow, afxData.clrBtnHilite);
		rect.InflateRect(-CX_BORDER, -CY_BORDER);
		pDC->Draw3dRect(rect, afxData.clrBtnFace, afxData.clrBtnFace);
		rect.InflateRect(-CX_BORDER, -CY_BORDER);
		break;

	case splitBar:
		break;

	default:
		ASSERT(FALSE);  // unknown splitter type
	}

	// fill the middle
	COLORREF clr = afxData.clrBtnFace;
	pDC->FillSolidRect(rect, clr);
}
# Change User Description Committed
#1 19924 YourUncleBob Populate -o //guest/perforce_software/p4win/...
//guest/YourUncleBob/p4win/.....
//guest/perforce_software/p4win/main/gui/FlatSplitter.cpp
#1 16169 perforce_software Move files to follow new path scheme for branches.
//guest/perforce_software/p4win/gui/FlatSplitter.cpp
#1 8562 Matt Attaway These feet never stop running.

Initial commit of the P4Win source code.  To the best of our knowledge this
compiles and runs using the 2013.3 P4 API and VS 2010. Expect a few changes
as we refine the build process. Please post any build issues to the forums.