資源簡(jiǎn)介
采用VS2010進(jìn)行開(kāi)發(fā)的一個(gè)MFC的小軟件,經(jīng)過(guò)調(diào)試,效果很好。可以嵌入到其它軟件中進(jìn)行二次開(kāi)發(fā)
代碼片段和文件信息
////////////////////////////////////////////////////////////////
//?CoolTabCtrl.cpp?:?implementation?file??????????????????????//
// ??//
//?Copyright?2001?WangJun ??//
//?All?Rights?Reserved. ??//
// ??//
//?Email:?wangjun98@sohu.com ??//
//?URL:???www.vckbase.com ??//
// ??//
//?1.0?????2001/9/30???First?release?version. ??//
// ??//
//?2004/2/8?添加對(duì)WM_NOTIFY消息的處理 ??//
//?2005/2/2?修正內(nèi)存泄漏 ??//
//????????????????????????????????????????????????????????????//
////////////////////////////////////////////////////////////////
#include?“stdafx.h“
#include?“CoolTabCtrl.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CCoolTabCtrl
IMPLEMENT_DYNCREATE(CCoolTabCtrl?CWnd)
#define ITEMBUTTON_HEIGHT 23
static?CPen?_penW(PS_SOLID1?RGB(255255255));
static?CPen?_penB(PS_SOLID1?RGB(000));
static?CPen?_pen3DFace(PS_SOLID1GetSysColor(COLOR_3DFACE));
static?CPen?_pen3DLight(PS_SOLID1GetSysColor(COLOR_3DLIGHT));
static?CPen?_pen3DShadow(PS_SOLID1GetSysColor(COLOR_3DSHADOW));
static?CPen?_pen3DDKShadow(PS_SOLID1GetSysColor(COLOR_3DDKSHADOW));
CCoolTabCtrl::CCoolTabCtrl()
{
m_nstyle?=?TCS_DOWN;
m_nActivePage?=?-1;
m_nBorder?=?1;
m_bEraseBkgnd?=?TRUE;
}
CCoolTabCtrl::~CCoolTabCtrl()
{
POSITION?pos;
CPageItem*?pItem;
for(pos=m_PageList.GetHeadPosition();pos!=NULL;)
{
pItem=(CPageItem*)m_PageList.GetNext(pos);
if(pItem)
{
if(pItem->m_nstyle?==?1?&&?pItem->m_pWnd)?//?動(dòng)態(tài)創(chuàng)建
{
pItem->m_pWnd->DestroyWindow();
delete?pItem->m_pWnd;
}
delete?pItem;
pItem=NULL;
}
}
m_PageList.RemoveAll();
}
BEGIN_MESSAGE_MAP(CCoolTabCtrl?CWnd)
//{{AFX_MSG_MAP(CCoolTabCtrl)
ON_WM_PAINT()
ON_WM_ERASEBKGND()
ON_WM_LBUTTONDOWN()
ON_WM_SIZING()
ON_WM_SIZE()
ON_WM_TIMER()
ON_WM_CREATE()
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CCoolTabCtrl?message?handlers
BOOL?CCoolTabCtrl::Create(UINT?wstyle?const?CRect?&rect?CWnd?*pParentWnd?UINT?nID)
{
m_nstyle?=?wstyle?&?TCS_MASK;
if(m_nstyle?==?0)
m_nstyle?=?TCS_UP;
if?(CWnd::Create(AfxRegisterWndClass(CS_DBLCLKS?|?CS_HREDRAW?|?CS_VREDRAW?AfxGetApp()->LoadStandardCursor(IDC_ARROW)?(HBRUSH)GetStockobject(LTGRAY_BRUSH)?NULL)
NULL
wstyle&~TCS_MASK?|?WS_CLIPCHILDREN?|?WS_CLIPSIBLINGS
rect?
pParentWnd?
nID))
{
return?TRUE;
}
return?FALSE;
}
BOOL?CCoolTabCtrl::OnEraseBkgnd(CDC*?pDC)?
{
if(m_bEraseBkgnd)
{
CRect?rect;
GetWindowRect(&rect);
ScreenToClient(&rect);
CBrush?brush(GetSysColor(COLOR_3DFACE));
pDC->FillRect(rect&brush);
}
return?TRUE;
}
void?CCoolTabCtrl::OnPaint()?
{
CPain
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-06-17?14:03??MFC_Graph_shower\
?????目錄???????????0??2013-04-08?07:31??MFC_Graph_shower\CDib\
?????文件???????21068??2013-04-08?07:31??MFC_Graph_shower\CDib\Dib.cpp
?????文件????????2376??2013-04-08?07:31??MFC_Graph_shower\CDib\Dib.h
?????文件???????13917??2013-04-08?07:31??MFC_Graph_shower\CoolTabCtrl.cpp
?????文件????????3455??2013-04-08?07:31??MFC_Graph_shower\CoolTabCtrl.h
?????目錄???????????0??2015-06-17?12:48??MFC_Graph_shower\Debug\
?????文件???????12526??2015-05-12?23:12??MFC_Graph_shower\Debug\cl.command.1.tlog
?????文件???????62950??2015-05-12?23:12??MFC_Graph_shower\Debug\CL.read.1.tlog
?????文件????????6442??2015-05-12?23:12??MFC_Graph_shower\Debug\CL.write.1.tlog
?????文件??????138597??2015-05-12?23:12??MFC_Graph_shower\Debug\CoolTabCtrl.obj
?????文件?????6437888??2015-06-13?20:45??MFC_Graph_shower\Debug\GraphShower.exe
?????文件?????????915??2013-04-08?07:31??MFC_Graph_shower\Debug\GraphShower.exe.em
?????文件?????????980??2015-05-12?23:12??MFC_Graph_shower\Debug\GraphShower.exe.em
?????文件?????????640??2015-06-13?20:45??MFC_Graph_shower\Debug\GraphShower.exe.intermediate.manifest
?????文件????15073120??2015-06-13?20:45??MFC_Graph_shower\Debug\GraphShower.ilk
?????文件?????????106??2015-06-17?12:48??MFC_Graph_shower\Debug\GraphShower.lastbuildstate
?????文件????????1297??2015-06-17?12:48??MFC_Graph_shower\Debug\GraphShower.log
?????文件???????46999??2015-05-12?23:12??MFC_Graph_shower\Debug\GraphShower.obj
?????文件????18481152??2015-05-12?23:12??MFC_Graph_shower\Debug\GraphShower.pch
?????文件????25422848??2015-06-13?20:45??MFC_Graph_shower\Debug\GraphShower.pdb
?????文件???????48432??2015-05-12?23:12??MFC_Graph_shower\Debug\GraphShower.res
?????文件???????55456??2015-05-12?23:12??MFC_Graph_shower\Debug\GraphShowerDoc.obj
?????文件??????158979??2015-05-12?23:12??MFC_Graph_shower\Debug\GraphShowerView.obj
?????文件?????????212??2013-04-08?07:31??MFC_Graph_shower\Debug\GraphShower_manifest.rc
?????文件???????????2??2015-06-13?20:45??MFC_Graph_shower\Debug\li
?????文件???????????2??2015-06-13?20:45??MFC_Graph_shower\Debug\li
?????文件????????4990??2015-06-13?20:45??MFC_Graph_shower\Debug\li
?????文件???????12078??2015-06-13?20:45??MFC_Graph_shower\Debug\li
?????文件????????3074??2015-06-13?20:45??MFC_Graph_shower\Debug\li
?????文件??????151669??2015-05-12?23:12??MFC_Graph_shower\Debug\MainFrm.obj
............此處省略46個(gè)文件信息
評(píng)論
共有 條評(píng)論