亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? listctrlstylesdlg.cpp

?? 《MFC窗口程序設計》書籍源碼 詳細講解MFC框架程序設計
?? CPP
字號:
// ListCtrlStylesDlg.cpp : implementation file
//
// Written by matt weagle (matt_weagle@hotmail.com)
// Copyright (c) 2000.
//
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is 
// not sold for profit without the authors written consent, and 
// providing that this notice and the authors name is included. If 
// the source code in  this file is used in any commercial application 
// then a simple email would be nice.
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability if it causes any damage whatsoever.
// Consider yourself lucky if it works, unlucky if it doesn't.
//
// Thanks to Chris Maunder (chris@codeproject.com) for the 
// foregoing disclaimer.
// 
// Please use and enjoy. Please let me know of any bugs/mods/improvements 
// that you have found/implemented and I will fix/incorporate them into this
// file. 
//
#include "stdafx.h"
#include "..\commonctrls.h"
#include "ListCtrlStylesDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CListCtrlStylesDlg dialog


CListCtrlStylesDlg::CListCtrlStylesDlg(CListCtrl *pListCtrl /*=NULL*/,CTreeCtrl *pTreeCtrl/*=NULL*/, CWnd* pParent /*=NULL*/)
	: CDialog(CListCtrlStylesDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CListCtrlStylesDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	ASSERT(pListCtrl);
	ASSERT(pTreeCtrl);
	
	m_pListCtrl = pListCtrl;
	m_pTreeCtrl=pTreeCtrl;

}


void CListCtrlStylesDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CListCtrlStylesDlg)
	DDX_Control(pDX, IDC_TREE_STYLES, m_cTreeStyles);
	DDX_Control(pDX, IDC_LIST_STYLES, m_cListStyles);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CListCtrlStylesDlg, CDialog)
	//{{AFX_MSG_MAP(CListCtrlStylesDlg)
	//}}AFX_MSG_MAP
	ON_NOTIFY( LVN_GETINFOTIP, IDC_LIST_STYLES, OnInfoTip )
	ON_NOTIFY( LVN_GETINFOTIP, IDC_TREE_STYLES, OnTreeInfoTip )
END_MESSAGE_MAP()



/////////////////////////////////////////////////////////////////////////////
// CListCtrlStylesDlg message handlers

BOOL CListCtrlStylesDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// Setup the list control
	CRect rect;
	m_cListStyles.GetClientRect(&rect);
	m_cListStyles.InsertColumn(0, _T("列表控件風格"), LVCFMT_LEFT, rect.Width());

	ListView_SetExtendedListViewStyle(m_cListStyles.m_hWnd, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
	
	
	// Setup the list control
	DWORD dwStyles = m_pListCtrl->GetStyle();

	AddStyleItem( _T("LVS_ALIGNLEFT"), (dwStyles & LVS_ALIGNLEFT) != 0, LVS_ALIGNLEFT);
	AddStyleItem( _T("LVS_ALIGNTOP"), (dwStyles & LVS_ALIGNTOP) != 0, LVS_ALIGNTOP);
	AddStyleItem( _T("LVS_AUTOARRANGE"), (dwStyles & LVS_AUTOARRANGE) != 0, LVS_AUTOARRANGE);
	AddStyleItem( _T("LVS_NOCOLUMNHEADER"), (dwStyles & LVS_NOCOLUMNHEADER) != 0, LVS_NOCOLUMNHEADER);
	AddStyleItem( _T("LVS_NOLABELWRAP"), (dwStyles & LVS_NOLABELWRAP) != 0, LVS_NOLABELWRAP);
	AddStyleItem( _T("LVS_NOSCROLL"), (dwStyles & LVS_NOSCROLL) != 0, LVS_NOSCROLL);
	AddStyleItem( _T("LVS_NOSORTHEADER"), (dwStyles & LVS_NOSORTHEADER) != 0, LVS_NOSORTHEADER);
	AddStyleItem( _T("LVS_SHOWSELALWAYS"), (dwStyles & LVS_SHOWSELALWAYS) != 0, LVS_SHOWSELALWAYS);
	AddStyleItem( _T("LVS_SINGLESEL"), (dwStyles & LVS_SINGLESEL) != 0, LVS_SINGLESEL);
	AddStyleItem( _T("LVS_SORTASCENDING"), (dwStyles & LVS_SORTASCENDING) != 0, LVS_SORTASCENDING);
	AddStyleItem( _T("LVS_SORTDESCENDING"), (dwStyles & LVS_SORTDESCENDING) != 0, LVS_SORTDESCENDING);


	//TREE
	m_cTreeStyles.GetClientRect(&rect);
	m_cTreeStyles.InsertColumn(0, _T("樹形控件風格"), LVCFMT_LEFT, rect.Width());
	
	ListView_SetExtendedListViewStyle(m_cTreeStyles.m_hWnd, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
	
	
	// Setup the list control
	dwStyles = m_pTreeCtrl->GetStyle();
	
	AddTreeStyleItem( _T("TVS_HASLINES"), (dwStyles & TVS_HASLINES) != 0, TVS_HASLINES);
	AddTreeStyleItem( _T("TVS_LINESATROOT"), (dwStyles & TVS_LINESATROOT) != 0, TVS_LINESATROOT);
	AddTreeStyleItem( _T("TVS_HASBUTTONS"), (dwStyles & TVS_HASBUTTONS) != 0, TVS_HASBUTTONS);
	AddTreeStyleItem( _T("TVS_EDITLABELS"), (dwStyles & TVS_EDITLABELS) != 0,TVS_EDITLABELS);
	AddTreeStyleItem( _T("TVS_SHOWSELALWAYS"), (dwStyles &TVS_SHOWSELALWAYS) != 0,TVS_SHOWSELALWAYS);
	AddTreeStyleItem( _T("TVS_NOTOOLTIPS"), (dwStyles & TVS_NOTOOLTIPS) != 0,TVS_NOTOOLTIPS);
	AddTreeStyleItem( _T("TVS_SINGLEEXPAND"), (dwStyles &TVS_SINGLEEXPAND) != 0, TVS_SINGLEEXPAND);

	AddTreeStyleItem( _T("TVS_CHECKBOXES"), (dwStyles & TVS_CHECKBOXES) != 0, TVS_CHECKBOXES);
	AddTreeStyleItem( _T("TVS_FULLROWSELECT"), (dwStyles & TVS_FULLROWSELECT) != 0,TVS_FULLROWSELECT);
	AddTreeStyleItem( _T("TVS_TRACKSELECT"), (dwStyles &TVS_TRACKSELECT) != 0,TVS_TRACKSELECT);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

/////////////////////////////////////////////////////////////////////////////
/*
	OnOK

	Slightly different than CListCtrlStylesDlgEx's handling of the updated
	style bits.  Whereas that class dynamically tracks the style bits, this
	one just waits until the user is done.  Then we run through the 
	entire list control items and create the new styles that should be applied
	to the list control back in the main dialog.
  
	Params
		None
  
	Returns 
		void
*/
/////////////////////////////////////////////////////////////////////////////
void CListCtrlStylesDlg::OnOK() 
{
	// Loop through the list control and get all the styles that are selected.  We
	// make this easier by storing the style value as the data member of each item.
	//List
	m_dwStyles = m_pListCtrl->GetStyle();
	int nNumItems = m_cListStyles.GetItemCount();
	for (int i = 0; i < nNumItems; i++)
	{
		if (ListView_GetCheckState(m_cListStyles.GetSafeHwnd(), i))
			m_dwStyles |= m_cListStyles.GetItemData(i);
		else	
			m_dwStyles &= ~(m_cListStyles.GetItemData(i));

	}

	//Tree
	m_dwTreeStyles = m_pTreeCtrl->GetStyle();
	nNumItems = m_cTreeStyles.GetItemCount();
	for (i = 0; i < nNumItems; i++)
	{
		if (ListView_GetCheckState(m_cTreeStyles.GetSafeHwnd(), i))
			m_dwTreeStyles |= m_cTreeStyles.GetItemData(i);
		else	
			m_dwTreeStyles &= ~(m_cTreeStyles.GetItemData(i));
		
	}

	CDialog::OnOK();
}

/////////////////////////////////////////////////////////////////////////////
/*
	AddStyleItem

	Helper function to insert the items into the list control.  Shows
	how to use CListCtrl::InsertItem without using the LVITEM 
	struct.
  
	Params
		lpszItem	Item text
		bState		Should the item have a check mark?
		dwData		Data to associate with item
	
	Returns 
		void
*/
/////////////////////////////////////////////////////////////////////////////
void CListCtrlStylesDlg::AddStyleItem(LPCTSTR lpszItem, BOOL bState, DWORD dwData)
{
	int nPos = max(m_cListStyles.GetItemCount(),0);
	nPos = m_cListStyles.InsertItem(nPos, lpszItem);
	m_cListStyles.SetItemData(nPos, dwData);

	// Use macro to set check state
	ListView_SetItemState(m_cListStyles.m_hWnd, nPos, UINT((int(bState) + 1) << 12), LVIS_STATEIMAGEMASK);

}

void CListCtrlStylesDlg::AddTreeStyleItem(LPCTSTR lpszItem, BOOL bState, DWORD dwData)
{
	int nPos = max(m_cTreeStyles.GetItemCount(),0);
	nPos = m_cTreeStyles.InsertItem(nPos, lpszItem);
	m_cTreeStyles.SetItemData(nPos, dwData);
	
	// Use macro to set check state
	ListView_SetItemState(m_cTreeStyles.m_hWnd, nPos, UINT((int(bState) + 1) << 12), LVIS_STATEIMAGEMASK);
	
}


/////////////////////////////////////////////////////////////////////////////
/*
	OnInfoTip

	This is a hand-entered handler for the LVN_GETINFOTIP WM_NOTIFY message
	which we enabled by including LVS_EX_INFOTIP in the extended style
	bits of the list control.  When this style bit is enabled, it sends 
	the parent window a LVN_GETINFOTIP message with a pointer to a 
	LVGETINFOTIP struct.  We populate the pszParam of this struct with 
	documentation for the item selected.  A more robust implementation might 
	associate the data member of each list control item with a string 
	allocated on the heap or some user defined struct.
  
	Params
		<Standard>
	
	Returns 
		void
*/
/////////////////////////////////////////////////////////////////////////////
void CListCtrlStylesDlg::OnInfoTip( NMHDR * pNMHDR, LRESULT * pResult )
{
	NMLVGETINFOTIP*	pInfoTip = reinterpret_cast<NMLVGETINFOTIP*>(pNMHDR);
	ASSERT(pInfoTip);

	// Get the item data for this unit
	DWORD dwData = m_cListStyles.GetItemData(pInfoTip->iItem);
	

	// Based on the flag value, show a tool tip with the information about this style bit
	CString strText;
	switch (dwData)
	{
	case LVS_ALIGNLEFT:
		strText = _T("Specifies that items are left-aligned in icon and small icon view."); break;
	case LVS_ALIGNTOP:
		strText = _T("Specifies that items are aligned with the top of the control in icon and small icon view."); break;
	case LVS_AUTOARRANGE:
		strText = _T("Specifies that icons are automatically kept arranged in icon view and small icon view."); break;
	case LVS_NOCOLUMNHEADER:
		strText = _T("Specifies that a column header is not displayed in report view."); break;
	case LVS_NOLABELWRAP:
		strText = _T("Displays item text on a single line in icon view."); break;
	case LVS_NOSORTHEADER:
		strText = _T("Specifies that column headers do not work like buttons.");break;
	case LVS_SHOWSELALWAYS:
		strText = _T("Always show the selection, if any, even if the control does not have the focus."); break;
	case LVS_SINGLESEL:
		strText = _T("Allows only one item at a time to be selected."); break;
	case LVS_SORTASCENDING:
		strText = _T("Sorts items based on item text in ascending order."); break;
	case LVS_SORTDESCENDING:
		strText = _T("Sorts items based on item text in descending order."); break;	
	default:
		strText = _T("Unknown style option."); break;

	}
	_tcscpy(pInfoTip->pszText, (LPCTSTR)strText);

}

void CListCtrlStylesDlg::OnTreeInfoTip( NMHDR * pNMHDR, LRESULT * pResult )
{
	NMLVGETINFOTIP*	pInfoTip = reinterpret_cast<NMLVGETINFOTIP*>(pNMHDR);
	ASSERT(pInfoTip);
	
	// Get the item data for this unit
	DWORD dwData = m_cTreeStyles.GetItemData(pInfoTip->iItem);
	
	
	// Based on the flag value, show a tool tip with the information about this style bit
	CString strText;
	switch (dwData)
	{
	case TVS_HASLINES:
		strText = _T("The tree view control has lines linking child items to their corresponding parent items."); break;
	case TVS_LINESATROOT:
		strText = _T("The tree view control has lines linking child items to the root of the hierarchy."); break;
	case TVS_HASBUTTONS:
		strText = _T("The tree view control adds a button to the left of each parent item."); break;
	case TVS_EDITLABELS:
		strText = _T("The tree view control allows the user to edit the labels of tree view items."); break;
	case TVS_SHOWSELALWAYS:
		strText = _T("Causes a selected item to remain selected when the tree-view control loses focus."); break;
	case TVS_NOTOOLTIPS:
		strText = _T("The tree view control uses no tooltips.");break;
	case TVS_SINGLEEXPAND:
		strText = _T("When this style is enabled, changing the selection in the tree view will automatically cause the item being selected to expand and the item being unselected to collapse. ");break;
	//
	case TVS_CHECKBOXES:
		strText = _T("Version 4.70. Enables check boxes for items in a tree view control. "); break;
	case TVS_FULLROWSELECT:
		strText = _T("Version 4.71. Enables full-row selection in the tree view."); break;
	case TVS_TRACKSELECT:
		strText = _T("Version 4.70. Enables hot tracking in a tree view control.");break;
	default:
		strText = _T("Unknown style option."); break;
		
	}
	_tcscpy(pInfoTip->pszText, (LPCTSTR)strText);
	
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一级二级三级| 亚洲愉拍自拍另类高清精品| 欧美日韩成人一区二区| 色综合久久久久综合| 成人动漫一区二区在线| 国产成人免费在线观看不卡| 国产一区二区精品在线观看| 国产九色sp调教91| 国产精品一二三四| 成人一道本在线| 不卡的av在线播放| 99免费精品在线观看| 99久久精品免费精品国产| 丁香激情综合国产| 99精品在线免费| 色呦呦一区二区三区| 欧美在线999| 欧美精选一区二区| 欧美一级高清片| 久久综合成人精品亚洲另类欧美| 久久久久久久综合色一本| 欧美高清在线一区二区| 亚洲欧美在线视频| 亚洲综合色噜噜狠狠| 琪琪久久久久日韩精品| 国产在线播放一区三区四| www.色综合.com| 欧美日韩一区三区| 精品日韩一区二区三区免费视频| 久久女同互慰一区二区三区| 国产精品天干天干在观线| 亚洲欧美一区二区三区极速播放| 亚洲国产aⅴ成人精品无吗| 免费在线看一区| 国产精品99久| 色婷婷久久久综合中文字幕| 在线不卡a资源高清| 国产婷婷色一区二区三区在线| 亚洲三级电影网站| 日本成人中文字幕| 成人免费精品视频| 欧美日韩午夜影院| 久久久.com| 亚洲图片欧美视频| 国产一区999| 欧美日韩日本视频| 国产日产欧美一区二区三区| 亚洲电影在线播放| 精品亚洲porn| 一本到不卡精品视频在线观看| 在线不卡欧美精品一区二区三区| 久久免费美女视频| 亚洲一区自拍偷拍| 国产在线视频一区二区三区| 91在线视频观看| 日韩亚洲欧美一区| 亚洲啪啪综合av一区二区三区| 国产精品私人自拍| 欧美一区二区三区不卡| 国产精品久久三区| 美国十次综合导航| 色噜噜狠狠一区二区三区果冻| 精品国产免费视频| 亚洲一区二区五区| 成人av网址在线| 日韩美女一区二区三区| 一区二区三区在线免费播放| 国产一区二区免费看| 欧美精品日韩精品| 亚洲色图19p| 岛国精品一区二区| 日韩欧美卡一卡二| 亚洲成人在线免费| 91啪亚洲精品| 国产精品污网站| 国内成人精品2018免费看| 欧美日韩免费电影| 136国产福利精品导航| 国产麻豆9l精品三级站| 3atv在线一区二区三区| 一区二区三区四区在线播放| 东方aⅴ免费观看久久av| 精品少妇一区二区三区在线播放 | 精品亚洲成a人| 欧美日本在线播放| 亚洲精品国产精华液| 粉嫩高潮美女一区二区三区| 欧美mv日韩mv亚洲| 日韩高清一区在线| 欧美午夜视频网站| 亚洲欧美日韩综合aⅴ视频| 粉嫩嫩av羞羞动漫久久久| 久久久美女毛片| 国产一区二区在线影院| 精品久久久久久综合日本欧美| 日韩av网站在线观看| 欧美色综合影院| 亚洲国产日产av| 欧美日韩视频专区在线播放| 亚洲综合久久久| 91久久精品一区二区二区| 国产精品网友自拍| 高清不卡在线观看| 中文字幕av一区二区三区免费看| 国产精品一区专区| 日韩三级高清在线| 丝袜美腿亚洲色图| 91精品视频网| 蜜臀精品一区二区三区在线观看 | 久久免费视频色| 国产一区二区免费看| 久久久精品欧美丰满| 国产一区视频网站| 欧美国产日韩在线观看| 91在线免费视频观看| 一区二区三区鲁丝不卡| 欧美日韩另类一区| 毛片基地黄久久久久久天堂| 日韩欧美黄色影院| 国产精品资源在线看| 国产精品人成在线观看免费| 91免费小视频| 亚洲国产精品一区二区尤物区| 欧美片网站yy| 五月天激情综合| 欧美另类变人与禽xxxxx| 亚洲一区二区美女| 欧美性受极品xxxx喷水| 亚洲自拍偷拍av| 一本到不卡精品视频在线观看| 亚洲视频图片小说| 99re这里都是精品| 亚洲图片激情小说| 91久久精品一区二区| 亚洲一区精品在线| 欧美日韩久久不卡| 日韩高清一级片| 欧美不卡一区二区三区| 精品一区精品二区高清| 久久久久九九视频| voyeur盗摄精品| 亚洲蜜臀av乱码久久精品| 欧美亚洲国产一区二区三区va| 亚洲影视资源网| 欧美理论在线播放| 麻豆精品精品国产自在97香蕉| 欧美成人精精品一区二区频| 狠狠久久亚洲欧美| 亚洲国产精品成人综合| 色婷婷av一区二区三区软件 | 韩国女主播成人在线| 中文字幕一区二区三区不卡| 欧美日韩高清在线| 高清免费成人av| 视频一区在线视频| 国产精品乱码妇女bbbb| 91精品国产综合久久精品app| 国产精品一区二区三区四区| 亚洲高清在线精品| 国产精品色婷婷| 日韩一级完整毛片| 91热门视频在线观看| 6080亚洲精品一区二区| 玖玖九九国产精品| 亚洲免费色视频| www日韩大片| 欧美日韩国产免费一区二区 | 丰满少妇久久久久久久| 婷婷开心久久网| 最新高清无码专区| 精品国产91亚洲一区二区三区婷婷| 色噜噜夜夜夜综合网| 国产成人亚洲综合a∨婷婷| 日本视频一区二区三区| 亚洲精品国产一区二区三区四区在线| 久久天天做天天爱综合色| 欧美日韩小视频| 91久久精品日日躁夜夜躁欧美| 风间由美一区二区av101| 久久国产精品露脸对白| 亚瑟在线精品视频| 亚洲免费大片在线观看| 国产精品传媒视频| 国产午夜亚洲精品羞羞网站| 欧美一级高清片在线观看| 欧美区一区二区三区| 色综合久久综合| 91视频国产资源| 丁香激情综合国产| 国产成人精品免费网站| 精品午夜久久福利影院| 美女脱光内衣内裤视频久久网站| 亚洲小说欧美激情另类| 亚洲日本va午夜在线影院| 久久久精品日韩欧美| 精品sm捆绑视频| 日韩欧美一级精品久久| 3d动漫精品啪啪| 欧美一级二级在线观看| 日韩欧美综合一区|