-
大小: 45KB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2021-05-07
- 語(yǔ)言: 其他
- 標(biāo)簽:
資源簡(jiǎn)介
CPropertySheet,CPropertySheet

代碼片段和文件信息
//?MyPropertySheet.cpp?:?實(shí)現(xiàn)文件
//
#include?“stdafx.h“
#include?“MyPropertySheet.h“
//?CMyPropertySheet
static?BOOL?bMoved[4]?=?{FALSEFALSEFALSEFALSE};
IMPLEMENT_DYNAMIC(CMyPropertySheet?CPropertySheet)
CMyPropertySheet::CMyPropertySheet(UINT?nIDCaption?CWnd*?pParentWnd?UINT?iSelectPage)
:CPropertySheet(nIDCaption?pParentWnd?iSelectPage)?m_nSelectedItem(0)?m_clrTextBkSele(RGB(0132255))m_clrSeprator(RGB(0132255))
m_clrCaption(RGB(92132255))
{
m_szCaption?=?new?TCHAR[128];
//默認(rèn)16*16,32位色圖標(biāo)
m_imgList.Create(1616ILC_COLOR32?0?20);
m_ftList.CreatePointFont(90_T(“宋體“));
}
CMyPropertySheet::CMyPropertySheet(LPCTSTR?pszCaption?CWnd*?pParentWnd?UINT?iSelectPage)
:CPropertySheet(pszCaption?pParentWnd?iSelectPage)?m_nSelectedItem(0)?m_clrTextBkSele(RGB(0132255))m_clrSeprator(RGB(0132255))
m_clrCaption(RGB(92132255))
{
m_szCaption?=?new?TCHAR[128];
m_imgList.Create(1616ILC_COLOR32?0?20);
m_ftList.CreatePointFont(90_T(“宋體“));
}
CMyPropertySheet::~CMyPropertySheet()
{
delete?[]?m_szCaption;
}
BEGIN_MESSAGE_MAP(CMyPropertySheet?CPropertySheet)
ON_WM_PAINT()
ON_NOTIFY(NM_CLICK?0xFFFF?OnNMClick)
ON_NOTIFY(NM_CUSTOMDRAW0xFFFF?OnNMCustomDraw)
END_MESSAGE_MAP()
//?CMyPropertySheet?消息處理程序
BOOL?CMyPropertySheet::OnInitDialog()
{
BOOL?bResult?=?CPropertySheet::OnInitDialog();
?
//計(jì)算屬性頁(yè)的矩形,擴(kuò)大屬性表并將屬性頁(yè)其移至右側(cè)
CRect?rect?rectPage?rectTab;
GetPage(0)->GetWindowRect(&rectPage);
GetWindowRect(&rect);
rect.right?+=?150;
????int?nWidth?=?rectPage.Width();
rectPage.right?=?rect.right?-?20;?
rectPage.left?=?rect.right?-?nWidth;
ScreenToClient(&rectPage);
m_rectPage?=?rectPage;
MoveWindow(&rect);
GetPage(0)->MoveWindow(&rectPage);
????
//隱藏屬性頁(yè)原來(lái)的TabControl
CTabCtrl?*pTab?=?GetTabControl()?;
pTab->GetWindowRect(&rectTab);
ScreenToClient(&rectTab);
if(!pTab->ShowWindow(SW_HIDE))
return?FALSE;
???
//創(chuàng)建列表控件并用一個(gè)CImageList對(duì)象與之關(guān)聯(lián)
if(!m_wndList.Create(WS_CHILD?|?WS_VISIBLE?|??LVS_REPORT?|?LVS_NOCOLUMNHEADER??CRect(10?rectTab.top150rectPage.bottom?)this0xFFFF))
return?FALSE;
m_wndList.SetExtendedstyle(LVS_EX_FULLROWSELECT);
m_wndList.SetImageList(&m_imgList?LVSIL_SMALL);
InitList();
//這一步是為了擴(kuò)大行高度
CFont?font;
font.CreatePointFont(240_T(“宋體“));
m_wndList.SetFont(&font);
CString?strCaption;
GetPage(0)->GetWindowText(strCaption);
_tcscpy(m_szCaption?strCaption.GetBuffer(strCaption.GetLength()));
return?bResult;
}
void?CMyPropertySheet::OnPaint()
{
CPaintDC?dc(this);?//?device?context?for?painting
CRect?rectListrectPage;
m_wndList.GetWindowRect(&rectList);
GetPage(0)->GetWindowRect(&rectPage);
ScreenToClient(&rectPage);
ScreenToClient(&rectList);
rectList.left?=?rectList.left?-1;
rectList.right?=?rectList.right?+?1;
rectList.top?=?rectList.top?-?1;
rectList.bottom?=?rectList.bottom?+?1;
rectPage.left?-=?1;
rectPag
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄??????????0??2008-01-12?19:59??代碼
?????目錄??????????0??2007-12-12?15:47??代碼\CMyPropertySheet
?????文件??????11416??2007-12-14?19:39??代碼\CMyPropertySheet\MyPropertySheet.cpp
?????文件???????1490??2007-12-14?19:26??代碼\CMyPropertySheet\MyPropertySheet.h
?????目錄??????????0??2008-01-12?20:19??代碼\MyPropertySheetDemo
?????目錄??????????0??2007-12-14?20:35??代碼\MyPropertySheetDemo\MyPropertySheetDemo
?????文件???????1296??2007-12-14?17:21??代碼\MyPropertySheetDemo\MyPropertySheetDemo\ChildView.cpp
?????文件????????537??2007-12-12?16:32??代碼\MyPropertySheetDemo\MyPropertySheetDemo\ChildView.h
?????文件???????1741??2007-12-12?15:48??代碼\MyPropertySheetDemo\MyPropertySheetDemo\MainFrm.cpp
?????文件????????743??2007-12-12?15:48??代碼\MyPropertySheetDemo\MyPropertySheetDemo\MainFrm.h
?????文件??????11416??2007-12-14?19:39??代碼\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheet.cpp
?????文件???????1490??2007-12-14?19:26??代碼\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheet.h
?????文件??????44844??2007-12-14?19:23??代碼\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheetDemo.aps
?????文件???????2670??2007-12-12?15:48??代碼\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheetDemo.cpp
?????文件????????568??2007-12-12?15:48??代碼\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheetDemo.h
?????文件??????10909??2007-12-14?19:23??代碼\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheetDemo.rc
?????文件???????6217??2007-12-14?17:21??代碼\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheetDemo.vcproj
?????文件???????1427??2007-12-14?20:35??代碼\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheetDemo.vcproj.CHINA-2CB7AA9C4.Administrator.user
?????文件???????2796??2007-12-12?15:48??代碼\MyPropertySheetDemo\MyPropertySheetDemo\ReadMe.txt
?????目錄??????????0??2007-12-14?17:54??代碼\MyPropertySheetDemo\MyPropertySheetDemo\res
?????文件???????1150??2007-12-14?17:20??代碼\MyPropertySheetDemo\MyPropertySheetDemo\res\Addition.ico
?????文件???????1150??2007-12-14?17:20??代碼\MyPropertySheetDemo\MyPropertySheetDemo\res\Global.ico
?????文件???????1150??2007-12-14?17:16??代碼\MyPropertySheetDemo\MyPropertySheetDemo\res\MyPropertySheetDemo.ico
?????文件????????375??2007-12-12?15:48??代碼\MyPropertySheetDemo\MyPropertySheetDemo\res\MyPropertySheetDemo.rc2
?????文件???????1607??2007-12-14?17:20??代碼\MyPropertySheetDemo\MyPropertySheetDemo\resource.h
?????文件????????494??2007-12-12?15:52??代碼\MyPropertySheetDemo\MyPropertySheetDemo\ServerPge.cpp
?????文件????????331??2007-12-12?15:52??代碼\MyPropertySheetDemo\MyPropertySheetDemo\ServerPge.h
?????文件????????150??2007-12-12?15:48??代碼\MyPropertySheetDemo\MyPropertySheetDemo\stdafx.cpp
?????文件???????2466??2007-12-12?15:52??代碼\MyPropertySheetDemo\MyPropertySheetDemo\stdafx.h
?????文件????????470??2007-12-12?16:32??代碼\MyPropertySheetDemo\MyPropertySheetDemo\UserPge.cpp
............此處省略6個(gè)文件信息
評(píng)論
共有 條評(píng)論