|
// HeaderCtrlEx.cpp : implementation file
//
#include "stdafx.h"
#include "Multiline.h"
#include "HeaderCtrlEx.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CHeaderCtrlEx
CHeaderCtrlEx::CHeaderCtrlEx()
{
}
CHeaderCtrlEx::~CHeaderCtrlEx()
{
}
BEGIN_MESSAGE_MAP(CHeaderCtrlEx, CHeaderCtrl)
//{{AFX_MSG_MAP(CHeaderCtrlEx)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CHeaderCtrlEx message handlers
void CHeaderCtrlEx::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
ASSERT(lpDrawItemStruct->CtlType == ODT_HEADER);
HDITEM hdi;
TCHAR lpBuffer[256];
hdi.mask = HDI_TEXT;
hdi.pszText = lpBuffer;
hdi.cchTextMax = sizeof(lpBuffer) ;
GetItem(lpDrawItemStruct->itemID, &hdi);
CDC* pDC;
pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
pDC->SelectObject(GetStockObject(DEFAULT_GUI_FONT));
::DrawFrameControl(lpDrawItemStruct->hDC,
&lpDrawItemStruct->rcItem, DFC_BUTTON, DFCS_BUTTONPUSH);
UINT uFormat = DT_CENTER;
::DrawText(lpDrawItemStruct->hDC, lpBuffer, strlen(lpBuffer),
&lpDrawItemStruct->rcItem, uFormat);
pDC->SelectStockObject(SYSTEM_FONT);
}
|
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.