|
// MySplitterWindowT.h: interface for the CMySplitterWindowT class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_MYSPLITTERWINDOWT_H__B5EE008A_5CD0_4673_8275_E17CF3BCB190__INCLUDED_)
#define AFX_MYSPLITTERWINDOWT_H__B5EE008A_5CD0_4673_8275_E17CF3BCB190__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
template <bool t_bVertical = true>
class CMySplitterWindowT : public CSplitterWindowImpl<CMySplitterWindowT<t_bVertical>, t_bVertical>
{
public:
DECLARE_WND_CLASS_EX(_T("My_SplitterWindow"), CS_DBLCLKS, COLOR_WINDOW)
CMySplitterWindowT() : m_bPatternBar(false)
{ }
// Operations
void EnablePatternBar ( bool bEnable = true )
{
if ( bEnable != m_bPatternBar )
{
m_bPatternBar = bEnable;
UpdateSplitterLayout();
}
}
// Overrideables
void DrawSplitterBar(CDCHandle dc)
{
RECT rect;
// If we're not using a colored bar, let the base class do the
// default drawing.
if ( !m_bPatternBar )
{
CSplitterWindowImpl<CMySplitterWindowT<t_bVertical>, t_bVertical>::DrawSplitterBar(dc);
return;
}
// Create a brush to paint with, if we haven't already done so.
if ( m_br.IsNull() )
m_br.CreateHatchBrush ( HS_DIAGCROSS,
t_bVertical ? RGB(255,0,0) : RGB(0,0,255) );
if ( GetSplitterBarRect ( &rect ) )
{
dc.FillRect ( &rect, m_br );
// draw 3D edge if needed
if ( (GetExStyle() & WS_EX_CLIENTEDGE) != 0)
dc.DrawEdge(&rect, EDGE_RAISED, t_bVertical ? (BF_LEFT | BF_RIGHT) : (BF_TOP | BF_BOTTOM));
}
}
protected:
CBrush m_br;
bool m_bPatternBar;
};
typedef CMySplitterWindowT<true> CMySplitterWindow;
typedef CMySplitterWindowT<false> CMyHorSplitterWindow;
#endif // !defined(AFX_MYSPLITTERWINDOWT_H__B5EE008A_5CD0_4673_8275_E17CF3BCB190__INCLUDED_)
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
Michael lives in sunny Mountain View, California. He started programming with an Apple
//e in 4th grade, graduated from
UCLA with a math degree in 1994, and immediately landed a job as a QA engineer at Symantec, working on the Norton AntiVirus team. He pretty much taught himself Windows and MFC programming, and in 1999 he designed and coded a new interface for Norton AntiVirus 2000.
Mike has been a a developer at
Napster and at his own lil' startup, Zabersoft, a development company he co-founded with offices in Los Angeles and Odense, Denmark. Mike is now a senior engineer at
VMware.
He also enjoys his hobbies of playing pinball, bike riding, photography, and Domion on Friday nights (current favorite combo: Village + double Pirate Ship). He would get his own snooker table too if they weren't so darn big! He is also sad that he's forgotten the languages he's studied: French, Mandarin Chinese, and Japanese.
Mike was a
VC MVP from 2005 to 2009.