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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? multicolumnsortlistview.cpp

?? 一個非常簡單地址簿程序
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/*
	
	Usage:
		You generally should not use this class directly, though it
		is possible. You need to do two things to use it directly.
		Set m_strUniqueName to someting, and set m_strColumnWidthSection
		to where you want the column widths to be saved.

		The purpose of m_strUniqueName is to allow for saving of
		multiple instances of listview objects. So obviously you would
		need to set this differently for each instance. SetUniqueName must be called
		before calling InsertColumn() or LoadColumnWidths().

		If you are deriving from this class, you need to do the following:
		Add a class to your project derived from CListView, then go into the
		header file and include MultiColumnSortListView.h and change all
		references to CListView to CMultiColumnSortListView. Then in the .cpp
		file of your class, change all the message maps to CMultiColumnSortListView
		instead of CListView. That should do it.

  Compiling:
		One problem you will have is finding IDB_ARROWUP and IDB_ARROWDOWN.
		Those bitmaps will be included with this set of classes, You should
		add them to your project or add your own bitmaps named correctly.
		These are the bitmaps that show the sort order on the header control.

        I hope this is simple enough, kind of a pain to get started but after
		that it should be cake and hopefully it will be useful.
  
  Things to be aware of:
		
		Multithreading:
		     If you delete all the items from another thread
			 in the middle of a sort, it will crash. This is the only
			 bug i have found.
		
		Column Widths:
			 
			MINCOLWIDTH - Minimum width a column can be.
			MAXCOLWIDTH - Maximum width a column can be.
			These are hard coded in the header file. Be aware.
			
			MAXCOLUMNS  - The most columns you can have right
			now is 64, that is only because im use __int64 to
			hold the column sort states. Who needs more than
			64 columns anyway? If you do, you can change it to
			CUIntArray, i just didnt see the need for a whole int
			when all i needed was a bit. 
		        

  Credits:
		
		Iuri Apollonio -- Sorting Class ( great class )
		Zafir Anjum    -- CMultiColumnSortListView::GetColumnCount
		Roger Onslow   -- CMultiColumnSortListView::AutoSizeColumns
		Zafir Anjum    -- CSortableHeaderCtrl::SetSortImage
		Me             -- The Rest, I think.

*/
// MultiColumnSortListView.cpp : implementation file
//

#include "stdafx.h"
#include "MultiColumnSortListView.h"
#include "SortClass.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMultiColumnSortListView

IMPLEMENT_DYNCREATE(CMultiColumnSortListView, CListView)
/*
When deriving from this class you must set m_strUniqueName to something
this name is used to save each instances column widths to the registry
*/
CMultiColumnSortListView::CMultiColumnSortListView()
{	
	m_strUniqueName.Empty();
	m_strColumnWidthSection = "ColumnWidths";
	m_bSorting = false;
	m_lColumnSortStates = 0;
}

CMultiColumnSortListView::~CMultiColumnSortListView()
{
}


BEGIN_MESSAGE_MAP(CMultiColumnSortListView, CListView)
	//{{AFX_MSG_MAP(CMultiColumnSortListView)
	ON_WM_CREATE()
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
	ON_NOTIFY(HDN_ITEMCLICKA, 0, OnHeaderClicked) 
	ON_NOTIFY(HDN_ITEMCLICKW, 0, OnHeaderClicked)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMultiColumnSortListView drawing

void CMultiColumnSortListView::OnDraw(CDC* pDC)
{
	CDocument* pDoc = GetDocument();
}
/////////////////////////////////////////////////////////////////////////////
// CMultiColumnSortListView diagnostics
#ifdef _DEBUG
void CMultiColumnSortListView::AssertValid() const
{
	CListView::AssertValid();
}
void CMultiColumnSortListView::Dump(CDumpContext& dc) const
{
	CListView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMultiColumnSortListView message handlers

/*
This function saves the columns widths of the listctrl to the registry.
This is called in two places, OnDestroy, and OnEndTrack in the headerCtrl class.
*/
void CMultiColumnSortListView::SaveColumnWidths()
{	//You must set a unique name for every listctrl
//	ASSERT( 
	m_strUniqueName.GetLength();// );
	CString strEntry( m_strUniqueName );
	CString strValue;
	CListCtrl &rListCtrl = GetListCtrl();
	int iNumColumns = GetColumnCount();
	for( int i = 0; i < iNumColumns; i++ )
	{
		CString strTemp;
		strTemp.Format("%d,", rListCtrl.GetColumnWidth( i ) );
		strValue += strTemp;
	}
	AfxGetApp()->WriteProfileString( m_strColumnWidthSection, strEntry, strValue );
}

/*
This function loads all the column widths for each column that was saved and applies the width
to the column. This function should be called when you are done inserting data. Or you 
can call SetColumnWidth to set the column width right after you InsertColumn(), If you call 
my InsertColumn it will do this for you.
*/
int CMultiColumnSortListView::LoadColumnWidths()
{	//This function will load all the column widths and apply the widths to each respective column
	int iNumColumns = GetColumnCount();
	CListCtrl &rListCtrl = GetListCtrl();
	for( int i = 0; i < iNumColumns; i++ )
	{
		SetColumnWidth( i );
	}
	return 1;
}

/*
This function is the heart of the class. This will get called automatically
when you click a header, and if you press control while clicking the header,
a multi column sort will take place (ie: sorting the current columns within all the
previously control+clicked columns). The multi column sort saves all the previosuly
control+clicked columns in an array and sorts them in reverse order. So if you click 
column 0, 2, 3, 5 while holding control, it will sort 5, 3, 2, 0. ( this acheives a
muli-column sort).
*/
void CMultiColumnSortListView::SortColumn( int iSubItem, bool bSortingMultipleColumns )
{	
	CListCtrl &rListCtrl = GetListCtrl();
	int iNumCombinedSortedCols = GetNumCombinedSortedColumns();
	m_bSorting = true;

	if( bSortingMultipleColumns )
	{
		if( NotInCombinedSortedColumnList( iSubItem ) )
			m_aCombinedSortedColumns[ iNumCombinedSortedCols++ ] = iSubItem;
		else
			MoveItemInCombinedSortedListToEnd( iSubItem );

		for( int i = iNumCombinedSortedCols - 1; i >= 0 ; i-- )
		{
			SORT_STATE ssEachItem = GetItemSortState( m_aCombinedSortedColumns[i] );
			if( iNumCombinedSortedCols - 1 != i )
				ssEachItem = (SORT_STATE)!ssEachItem;
			
			CSortClass csc(&rListCtrl, m_aCombinedSortedColumns[i], IsColumnNumeric( m_aCombinedSortedColumns[i] ) );	
			csc.Sort( ssEachItem );
			if( i == iNumCombinedSortedCols - 1 )
			{	//Only swap the last column's sort order.
				m_ctlHeaderCtrl.SetSortImage( m_aCombinedSortedColumns[i], ssEachItem );
				SetItemSortState( m_aCombinedSortedColumns[i] , (SORT_STATE)!ssEachItem );			
			}
		}
	}
	else
	{
		m_ctlHeaderCtrl.RemoveAllSortImages();
		EmptyArray(m_aCombinedSortedColumns);
		m_aCombinedSortedColumns[ 0 ] = iSubItem;
		SORT_STATE ssEachItem = GetItemSortState( iSubItem );
		
		CSortClass csc(&rListCtrl, iSubItem, IsColumnNumeric( iSubItem ) );	
		csc.Sort( ssEachItem );
		m_ctlHeaderCtrl.SetSortImage( iSubItem, ssEachItem );
		SetItemSortState( iSubItem , (SORT_STATE)!ssEachItem );
	}
	m_bSorting = false;
}

/*
My version of InsertColumn that will automatically load the last column
width from the registry. 
*/
int CMultiColumnSortListView::InsertColumn(int nCol, LPCTSTR lpszColumnHeading, int nFormat, int nWidth, int nSubItem)
{
	CListCtrl &rListCtrl = GetListCtrl();
	GetListCtrl().InsertColumn( nCol, lpszColumnHeading, nFormat, nWidth, nSubItem );
	SetColumnWidth( nCol );
	return 1;
}

/*
Utility function to size columns based on its data.
written by Roger Onslow
*/
void CMultiColumnSortListView::AutoSizeColumn( int iColumn )
{
	CListCtrl &rListCtrl = GetListCtrl();
	rListCtrl.SetRedraw(false);
	
	rListCtrl.SetColumnWidth(iColumn,LVSCW_AUTOSIZE);
	int wc1 = rListCtrl.GetColumnWidth( iColumn );
	rListCtrl.SetColumnWidth(iColumn,LVSCW_AUTOSIZE_USEHEADER);
	int wc2 = rListCtrl.GetColumnWidth( iColumn );
	int wc = max(MINCOLWIDTH,max( wc1,wc2 ));
	
	if( wc > MAXCOLWIDTH )
		wc = MAXCOLWIDTH;
	
	rListCtrl.SetColumnWidth( iColumn,wc );  
	rListCtrl.SetRedraw(true);
}

/*
Utility function to get rid of all the columns
*/
void CMultiColumnSortListView::DeleteAllColumns()
{
	CListCtrl &rListCtrl = GetListCtrl();
	int iNumCols = GetColumnCount();
	for ( int i = 0; i < iNumCols; i++ )
		rListCtrl.DeleteColumn(0);
}

/*
Utility function to get rid of all items.
*/
void CMultiColumnSortListView::DeleteAllItems()
{
	CListCtrl &rListCtrl = GetListCtrl();
	if( rListCtrl.GetItemCount() > 0 )

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃视频一区二区| 欧美视频日韩视频| 色猫猫国产区一区二在线视频| 欧美日韩一区不卡| 国产精品国产自产拍高清av王其 | 亚洲va欧美va人人爽午夜| 极品尤物av久久免费看| 欧美性色黄大片| 国产精品二区一区二区aⅴ污介绍| 日本中文字幕不卡| 色美美综合视频| 亚洲国产精品av| 久久se这里有精品| 欧美日韩精品一区视频| 亚洲色图第一区| 国产成人无遮挡在线视频| 日韩欧美在线网站| 亚洲第一搞黄网站| 色综合久久综合网97色综合| 国产欧美日韩另类一区| 黑人巨大精品欧美一区| 6080午夜不卡| 香港成人在线视频| 91精彩视频在线观看| 中文字幕亚洲综合久久菠萝蜜| 国产自产高清不卡| 欧美变态tickle挠乳网站| 日本在线不卡一区| 欧美精品精品一区| 亚洲va韩国va欧美va| 在线免费亚洲电影| 一区二区三区中文字幕| 色先锋aa成人| 依依成人精品视频| 91福利资源站| 亚洲成人资源网| 欧美日韩免费观看一区三区| 亚洲国产精品人人做人人爽| 91国模大尺度私拍在线视频| 亚洲精品久久久蜜桃| 色婷婷精品大视频在线蜜桃视频| 亚洲日本一区二区| 欧美优质美女网站| 无吗不卡中文字幕| 欧美一级在线视频| 国产一区二区久久| 麻豆专区一区二区三区四区五区| 91精品国产综合久久久久久漫画| 视频一区视频二区中文字幕| 在线不卡a资源高清| 男人的j进女人的j一区| 日韩午夜电影在线观看| 国产原创一区二区三区| 国产精品三级视频| 色系网站成人免费| 首页亚洲欧美制服丝腿| 欧美一区二区黄| 国产精品一二三四五| 中文字幕一区二区三| 欧美日韩在线一区二区| 免费在线一区观看| 国产精品第五页| 欧美日韩一级二级| 国产专区综合网| 亚洲男同1069视频| 日韩一区二区不卡| 成人三级在线视频| 亚洲高清久久久| 久久亚洲精华国产精华液| 97久久精品人人澡人人爽| 日日欢夜夜爽一区| 中文字幕中文字幕中文字幕亚洲无线| 在线国产电影不卡| 国产一区二区三区| 午夜久久久影院| 国产清纯美女被跳蛋高潮一区二区久久w| 91丨国产丨九色丨pron| 蜜臀精品一区二区三区在线观看| 欧美国产一区二区| 91精品久久久久久久久99蜜臂| 成人影视亚洲图片在线| 丝袜亚洲精品中文字幕一区| 中文字幕制服丝袜成人av| 欧美一级免费大片| 93久久精品日日躁夜夜躁欧美| 久久精品国产一区二区三区免费看| 专区另类欧美日韩| 精品国产乱码久久久久久图片| 日本国产一区二区| 福利一区福利二区| 久久精品久久精品| 性做久久久久久久免费看| 中文字幕不卡在线播放| 精品久久久久久久久久久久久久久| 色婷婷亚洲综合| 成a人片国产精品| 国产一二精品视频| 美女在线一区二区| 午夜精品国产更新| 一区二区三区精品久久久| 国产精品美女www爽爽爽| 日韩美女视频在线| 制服丝袜av成人在线看| 欧美视频在线观看一区| 91丨九色丨黑人外教| 成人av在线播放网址| 国产资源在线一区| 韩国v欧美v日本v亚洲v| 日韩va亚洲va欧美va久久| 亚洲国产乱码最新视频 | 国产传媒欧美日韩成人| 久久国产日韩欧美精品| 人人精品人人爱| 日韩制服丝袜av| 婷婷丁香激情综合| 亚洲成av人片一区二区三区| 亚洲国产一区二区三区| 亚洲激情五月婷婷| 亚洲激情网站免费观看| 亚洲精品国久久99热| 亚洲老司机在线| 一区二区三区国产豹纹内裤在线| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 国产日产欧美一区| 国产精品人成在线观看免费| 欧美激情一二三区| 国产精品嫩草影院av蜜臀| 国产精品久久久久久久久果冻传媒 | 欧美日韩在线综合| 欧美丰满一区二区免费视频| 91精品久久久久久久91蜜桃| 日韩欧美亚洲另类制服综合在线| 欧美一二三四区在线| 日韩一区二区三区四区五区六区| 日韩一区二区三区av| 精品国产乱码久久久久久久| 国产女人水真多18毛片18精品视频| 国产欧美日韩在线| 亚洲精品中文在线| 日韩不卡免费视频| 国产精品99久久久久久久vr| 99r国产精品| 911国产精品| 久久久久久一级片| 中文字幕日本不卡| 午夜精品123| 国产激情精品久久久第一区二区| 99久久夜色精品国产网站| 欧美午夜电影在线播放| 欧美成人精品福利| 国产精品美女www爽爽爽| 亚洲一区二区三区四区的| 久久精品国产亚洲5555| 99久免费精品视频在线观看| 欧美日韩高清一区| 欧美韩国日本综合| 婷婷国产v国产偷v亚洲高清| 国产精品一线二线三线精华| 在线精品视频免费观看| 久久婷婷色综合| 亚洲制服丝袜在线| 国产精品主播直播| 欧美日韩久久久久久| 国产日韩视频一区二区三区| av成人免费在线观看| 欧美男生操女生| 国产精品色哟哟| 蜜桃av一区二区三区| 色猫猫国产区一区二在线视频| 日韩美女视频一区二区在线观看| 亚洲精品午夜久久久| 国产一区 二区 三区一级| 欧美日韩国产免费一区二区| 久久久美女艺术照精彩视频福利播放| 亚洲一级片在线观看| 国产成人综合精品三级| 欧美一二三区在线| 亚洲永久精品国产| av一二三不卡影片| 久久久午夜精品| 麻豆精品精品国产自在97香蕉| 91蝌蚪国产九色| 中文字幕 久热精品 视频在线| 六月丁香综合在线视频| 欧美精品在线视频| 亚洲欧美激情视频在线观看一区二区三区 | 国产成人一区二区精品非洲| 在线观看91av| 亚洲午夜激情av| 色狠狠综合天天综合综合| 国产女主播一区| 国产成人亚洲综合a∨婷婷图片| 日韩免费高清电影| 日av在线不卡| 日韩视频在线永久播放| 婷婷一区二区三区| 91精品国产综合久久蜜臀 | 成人免费在线视频| 成人动漫一区二区| 中文字幕不卡一区|