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

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

?? multicolumnsortlistview.cpp

?? 一個統(tǒng)計(jì)文件大小和程序信息的插件程序(vc或vc.net下使用)
?? 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.
		and set m_strColumnOrderSection to where you want the column 
		order 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 CMultiColumnSortListCtrl. Then in the .cpp
		file of your class, change all the message maps to CMultiColumnSortListCtrl
		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    -- CMultiColumnSortListCtrl::GetColumnCount
		Roger Onslow   -- CMultiColumnSortListCtrl::AutoSizeColumns
		Zafir Anjum    -- CSortableHeaderCtrl::SetSortImage
		Me             -- The Rest, I think. //JK - Craig Lucas <craig@alpeng.com>

*/

// MultiColumnSortListView.cpp : implementation file
//

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

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

/////////////////////////////////////////////////////////////////////////////
// CMultiColumnSortListCtrl

/*
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
*/
CMultiColumnSortListCtrl::CMultiColumnSortListCtrl()
{	
	m_strUniqueName.Empty();
	m_strColumnWidthSection = REG_COLUMN_WIDTH_SECTION;
	m_strColumnOrderSection = REG_COLUMN_ORDER_SECTION;
	m_strColumnSortSection = REG_COLUMN_SORT_SECTION;

	m_bSorting = false;
	m_lColumnSortStates = 0;
	EmptyArray( m_aCombinedSortedColumns, -1 );
	EmptyArray( (int*)m_aDefaultColumnsSort, (int)DESCENDING );
	EmptyArray( (int*)m_aColumnType, (int)TYPE_TEXT );
}

BEGIN_MESSAGE_MAP(CMultiColumnSortListCtrl, CListCtrl)
	//{{AFX_MSG_MAP(CMultiColumnSortListCtrl)
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
	ON_NOTIFY(HDN_ITEMCLICKA, 0, OnHeaderClicked) 
	ON_NOTIFY(HDN_ITEMCLICKW, 0, OnHeaderClicked)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMultiColumnSortListCtrl 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 CMultiColumnSortListCtrl::SaveColumnSettings()
{
	//You must set a unique name for every listctrl
	ASSERT( m_strUniqueName.GetLength() );

	int nIndex;	//for the loops

	/*
	Save the widths
	*/
	CString strEntry( m_strUniqueName );
	CString strValue;

	int iNumColumns = GetColumnCount();
	for( nIndex = 0; nIndex < iNumColumns; nIndex++ )
	{
		CString strTemp;
		strTemp.Format( "%d,", GetColumnWidth(nIndex) );
		strValue += strTemp;
	}

	//write to the registry
	AfxGetApp()->WriteProfileString( m_strColumnWidthSection, strEntry, strValue );

	/*
	Save the column's order
	*/
	LPINT pnOrder = (LPINT)malloc(iNumColumns*sizeof(int));
	ASSERT(pnOrder != NULL);

	if( pnOrder )
	{
		GetColumnOrderArray(pnOrder, iNumColumns);
		
		CString strColumnOrder;
		
		for( nIndex = 0; nIndex < iNumColumns; nIndex++ )
		{
			CString strTemp;
			strTemp.Format( "%d,", pnOrder[nIndex] );
			strColumnOrder += strTemp;
		}
		
		//write to the registry
		AfxGetApp()->WriteProfileString( m_strColumnOrderSection, strEntry, strColumnOrder );

		free(pnOrder);
	}

	/*
	Save the sort order
	It saves the column numbers, it's negative if ASCENDING
	*/
	CString strColumnSort;
	int iNumCombinedSortedCols = GetNumCombinedSortedColumns();

	//store the m_lColumnSortStates first
	{
		CString strTemp;
		strTemp.Format( "%d,", m_lColumnSortStates );
		strColumnSort += strTemp;
	}

	//iterate the columns
	for( nIndex = 0; nIndex < iNumCombinedSortedCols; nIndex++ )
	{
		SORT_STATE ssEachItem = GetItemSortState( m_aCombinedSortedColumns[nIndex] );
		
		CString strTemp;
		strTemp.Format( "%d,", m_aCombinedSortedColumns[nIndex] );
		strColumnSort += strTemp;
	}

	//write to the registry
	AfxGetApp()->WriteProfileString( m_strColumnSortSection, strEntry, strColumnSort );
}

/*
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 CMultiColumnSortListCtrl::LoadColumnWidths()
{
	//This function will load all the column widths and apply the widths to each respective column
	int iNumColumns = GetColumnCount();

	//set the column width
	for( int nIndex = 0; nIndex < iNumColumns; nIndex++ )
	{
		SetColumnWidth( nIndex );
	}

	return 1;
}

/*
This function loads the columns order as the columns can be re-arranged with drag & drop
You should call it BEFORE you fill in the contents or it might not redraw properly
*/
int CMultiColumnSortListCtrl::LoadColumnOrder()
{
	ASSERT( m_strUniqueName.GetLength() );	//You must set a unique name for every listctrl

	int iNumColumns = GetColumnCount();

	//set the colum order
	CString strEntry( m_strUniqueName );
	CString strValue, strSubString;
	CString strSection( m_strColumnOrderSection );

	strValue = AfxGetApp()->GetProfileString( strSection, strEntry, "" );

	if( !strValue.IsEmpty() )
	{
		LPINT pnOrder = (LPINT)malloc(iNumColumns*sizeof(int));
		ASSERT(pnOrder != NULL);

		if( pnOrder )
		{
			for( int nIndex = 0; nIndex < iNumColumns; nIndex++ )
			{
				
				AfxExtractSubString(strSubString, strValue, nIndex, ',');
				if( !strSubString.IsEmpty() )
				{
					pnOrder[nIndex] = atoi( (LPCTSTR)strSubString );
				}
			}

			SetColumnOrderArray( iNumColumns, pnOrder );

			free(pnOrder);
		}
	}

	return 1;
}

/*
This function loads the columns sort
To apply the changes you have to call SortCombinedColumns()
*/
int CMultiColumnSortListCtrl::LoadColumnSort()
{
	ASSERT( m_strUniqueName.GetLength() );	//You must set a unique name for every listctrl

	//set the colum order
	CString strEntry( m_strUniqueName );
	CString strValue, strSubString;
	CString strSection( m_strColumnSortSection );

	strValue = AfxGetApp()->GetProfileString( strSection, strEntry, "" );

	if( !strValue.IsEmpty() )
	{
		m_ctlHeaderCtrl.RemoveAllSortImages();
    	EmptyArray(m_aCombinedSortedColumns, -1);
	    m_lColumnSortStates = 0;

		int nIndex = 0;
		while( AfxExtractSubString(strSubString, strValue, nIndex, ',') )
		{
			//get the m_lColumnSortStates first
			if( !nIndex )
			{
				m_lColumnSortStates = atol( (LPCTSTR)strSubString );
				nIndex++;
				continue;
			}
			
			//get the other columns
			if( !strSubString.IsEmpty() )
			{
				m_aCombinedSortedColumns[nIndex-1] = atoi( (LPCTSTR)strSubString );
			}
			else
			{
				break;
			}
			
			//next please
			nIndex++;
		}
	}

	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 CMultiColumnSortListCtrl::SortColumn( int iSubItem, bool bSortingMultipleColumns )
{	
	m_bSorting = true;

	if( bSortingMultipleColumns )
	{
		int iNumCombinedSortedCols = GetNumCombinedSortedColumns();

		if( NotInCombinedSortedColumnList( iSubItem ) )
		{
			m_aCombinedSortedColumns[ iNumCombinedSortedCols++ ] = iSubItem;
			SetItemSortState( iSubItem, GetDefaultItemSortState(iSubItem) );
		}
		else
		{
			SORT_STATE ssEachItem = GetItemSortState( iSubItem );
			SetItemSortState( iSubItem, (SORT_STATE)!ssEachItem );
			MoveItemInCombinedSortedListToEnd( iSubItem );
		}

		//sort it
		SortCombinedColumns();
	}
	else
	{
		SORT_STATE ssEachItem = GetItemSortState( iSubItem );
		bool bNotInList = NotInCombinedSortedColumnList( iSubItem );
		
		m_ctlHeaderCtrl.RemoveAllSortImages();
		EmptyArray(m_aCombinedSortedColumns, -1);
		m_lColumnSortStates = 0;
		
		m_aCombinedSortedColumns[ 0 ] = iSubItem;
		SetItemSortState( iSubItem, 
			bNotInList ? GetDefaultItemSortState(iSubItem) : (SORT_STATE)!ssEachItem );

		//sort it
		SortCombinedColumns();
	}

	m_bSorting = false;
}

/*
Traverse and sort the columns, the sort order is in the internal array
use bSetSort as true for a call from outside the class
*/
void CMultiColumnSortListCtrl::SortCombinedColumns(bool bSetSort /*= false*/)
{
	if( bSetSort )
	{
		m_bSorting = true;
	}

	int iNumCombinedSortedCols = GetNumCombinedSortedColumns();
	
	for( int nIndex = iNumCombinedSortedCols - 1; nIndex >= 0 ; nIndex-- )
	{
		SORT_STATE ssEachItem = GetItemSortState( m_aCombinedSortedColumns[nIndex] );
		SORT_TYPE sortType = GetColumnType(m_aCombinedSortedColumns[nIndex]);
		
		CSortClass csc( this, m_aCombinedSortedColumns[nIndex], sortType );	
		csc.Sort( DESCENDING == ssEachItem );	//Ariel Benary <Ariel.Benary@ness.com>
		
		//refresh the sort image
		m_ctlHeaderCtrl.SetSortImage( m_aCombinedSortedColumns[nIndex], ssEachItem );
	}

	if( bSetSort )
	{
		m_bSorting = false;
	}
}

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

/*
Utility function to size columns based on its data.
written by Roger Onslow
*/
void CMultiColumnSortListCtrl::AutoSizeColumn( int iColumn )
{
	SetRedraw(false);
	
	CListCtrl::SetColumnWidth(iColumn,LVSCW_AUTOSIZE);
	int wc1 = CListCtrl::GetColumnWidth( iColumn );
	CListCtrl::SetColumnWidth(iColumn,LVSCW_AUTOSIZE_USEHEADER);
	int wc2 = GetColumnWidth( iColumn );
	int wc = max(MINCOLWIDTH,max( wc1,wc2 ));
	

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
制服丝袜日韩国产| 日本道在线观看一区二区| 精品毛片乱码1区2区3区| 久久精品久久精品| 精品粉嫩aⅴ一区二区三区四区| 久久99国产精品久久99| 国产性天天综合网| 色综合中文字幕国产 | 中文字幕亚洲精品在线观看| 97精品视频在线观看自产线路二| 一区二区三区自拍| 欧美一区二区视频观看视频| 国产乱人伦偷精品视频不卡| 亚洲视频你懂的| 日韩一区二区三区视频| 国产精品亚洲а∨天堂免在线| 亚洲欧美激情插| 日韩一区二区三区视频| a4yy欧美一区二区三区| 日韩国产欧美在线观看| 欧美高清一级片在线观看| 色屁屁一区二区| 美国精品在线观看| 日韩美女视频一区| 欧美精品一区二区三区四区| 色婷婷国产精品综合在线观看| 蜜臀av一级做a爰片久久| 日韩理论在线观看| 精品国产髙清在线看国产毛片| 成人免费看的视频| 日本网站在线观看一区二区三区| 国产精品免费视频观看| 欧美丰满美乳xxx高潮www| 东方aⅴ免费观看久久av| 天天色天天爱天天射综合| 日本一区二区三区四区| 欧美一区二区三区男人的天堂| 成人av在线电影| 久久99热这里只有精品| 亚洲一区视频在线观看视频| 国产欧美综合色| 日韩欧美激情一区| 欧美综合色免费| 国产69精品久久777的优势| 秋霞午夜av一区二区三区| 亚洲欧美视频一区| 国产欧美日韩久久| 久久综合色一综合色88| 在线成人免费观看| 欧美在线观看禁18| 91老司机福利 在线| 国产激情偷乱视频一区二区三区| 亚洲成人在线免费| 亚洲精品日韩专区silk | 中文字幕日本乱码精品影院| 精品国产免费久久| 欧美一区二区三区成人| 欧美日韩三级在线| 欧美三级电影网| 在线观看91视频| 色狠狠av一区二区三区| 91在线精品一区二区| 成人avav在线| 国产不卡一区视频| 成人一级黄色片| 国产成人夜色高潮福利影视| 精油按摩中文字幕久久| 久久国产尿小便嘘嘘尿| 美女被吸乳得到大胸91| 蜜桃av一区二区在线观看| 免播放器亚洲一区| 蜜臀av性久久久久蜜臀aⅴ四虎| 日韩国产欧美在线播放| 麻豆精品一区二区综合av| 日韩电影在线观看网站| 青青草国产精品97视觉盛宴| 久久成人久久鬼色| 精品无码三级在线观看视频| 国内精品免费**视频| 国产一区二区三区视频在线播放| 久久成人免费日本黄色| 国产精品一区免费在线观看| 丁香五精品蜜臀久久久久99网站| 高清视频一区二区| 色综合视频在线观看| 欧美性大战久久久| 91精品国产综合久久婷婷香蕉| 91精品国产色综合久久ai换脸 | 91猫先生在线| 欧美性做爰猛烈叫床潮| 欧美一区二区黄色| 国产无一区二区| 亚洲综合在线视频| 日韩国产一二三区| 丁香六月久久综合狠狠色| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 欧美国产日韩一二三区| 亚洲色图丝袜美腿| 日韩国产精品久久久久久亚洲| 精品一二线国产| 91香蕉视频黄| 7777女厕盗摄久久久| 国产亚洲va综合人人澡精品| 亚洲视频一二区| 美国十次综合导航| 97久久超碰国产精品| 日韩一卡二卡三卡| 国产精品乱人伦一区二区| 亚洲va韩国va欧美va| 国产在线看一区| 色婷婷香蕉在线一区二区| 日韩欧美一区二区在线视频| 国产精品久久久久久久浪潮网站| 午夜精品一区二区三区免费视频| 精品一区二区三区在线播放视频 | 国产91丝袜在线播放| 在线观看成人小视频| 久久综合久久鬼色| 亚洲一区二区欧美日韩| 国产成人午夜高潮毛片| 欧美精品aⅴ在线视频| 国产精品亲子乱子伦xxxx裸| 日韩精品亚洲一区二区三区免费| 成人小视频在线| 欧美一三区三区四区免费在线看 | 国产亚洲成av人在线观看导航| 亚洲国产中文字幕| aaa国产一区| 精品成人免费观看| 午夜影视日本亚洲欧洲精品| 国产成人精品一区二| 欧美妇女性影城| 亚洲乱码国产乱码精品精的特点| 韩国一区二区三区| 欧美日韩一级大片网址| 中文字幕在线一区| 国产成人小视频| 精品国产污污免费网站入口| 香港成人在线视频| 欧日韩精品视频| 亚洲色图20p| 成人午夜av电影| 国产亚洲欧洲997久久综合| 免费高清在线视频一区·| 欧美日韩国产综合视频在线观看 | 久久久91精品国产一区二区精品| 日韩主播视频在线| 一本大道久久a久久精二百| 中文字幕国产一区| 国产·精品毛片| 国产女同互慰高潮91漫画| 国产一区二区三区免费| 欧美不卡一二三| 美女任你摸久久| 日韩美一区二区三区| 男女性色大片免费观看一区二区| 欧美撒尿777hd撒尿| 亚洲一区中文日韩| 欧美色涩在线第一页| 亚洲一区二区欧美日韩| 欧美日韩视频在线观看一区二区三区| 中文字幕一区二区三区在线播放| 高清在线成人网| 中文字幕在线视频一区| 97久久超碰国产精品电影| 日韩毛片视频在线看| 91蝌蚪porny| 亚洲自拍偷拍av| 在线播放欧美女士性生活| 天堂精品中文字幕在线| 欧美日韩www| 麻豆国产欧美日韩综合精品二区| 欧美一级欧美三级在线观看| 极品少妇xxxx精品少妇| 久久久精品欧美丰满| 国产91富婆露脸刺激对白| 国产精品福利在线播放| 日本高清视频一区二区| 亚洲国产精品久久艾草纯爱| 欧美午夜精品久久久久久超碰| 天天综合网 天天综合色| 欧美一区二区二区| 国产福利一区二区三区在线视频| 中文字幕一区在线观看| 欧美性大战久久久| 免费高清在线一区| 中文字幕巨乱亚洲| 欧美在线观看一区| 经典三级视频一区| 亚洲人成精品久久久久| 884aa四虎影成人精品一区| 久久99精品网久久| 亚洲色图制服诱惑| 欧美一三区三区四区免费在线看 | 99精品欧美一区二区蜜桃免费 | 美美哒免费高清在线观看视频一区二区| 欧美va亚洲va| 91免费视频网址| 免费成人在线播放| 国产精品传媒在线|