-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathToolTab.cpp
More file actions
40 lines (33 loc) · 977 Bytes
/
ToolTab.cpp
File metadata and controls
40 lines (33 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// ToolTab.cpp : implementation file
//
#include "stdafx.h"
#include "WinDV.h"
#include "ToolTab.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CToolTab
CToolTab::CToolTab()
{
}
CToolTab::~CToolTab()
{
}
void CToolTab::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
int s = SaveDC(lpDrawItemStruct->hDC);
lpDrawItemStruct->rcItem.top += ::GetSystemMetrics(SM_CYEDGE)+1;
TCITEM item;
char buf[256];
item.mask = TCIF_TEXT;
item.cchTextMax = sizeof buf / sizeof buf[0];
item.pszText = buf;
GetItem(lpDrawItemStruct->itemID, &item);
HBRUSH hbr = (HBRUSH)GetParent()->SendMessage(WM_CTLCOLORDLG, (WPARAM)(lpDrawItemStruct->hDC), (LPARAM)m_hWnd);
FillRect(lpDrawItemStruct->hDC, &lpDrawItemStruct->rcItem, hbr);
DrawText(lpDrawItemStruct->hDC, buf, -1, &lpDrawItemStruct->rcItem, DT_CENTER);
RestoreDC(lpDrawItemStruct->hDC, s);
}