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

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

?? multicolumnsortlistview.cpp

?? 一個統計文件大小和程序信息的插件程序(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 ));
	

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女精品一区二区| 精品一区二区三区免费播放 | 国产精品12区| 国模大尺度一区二区三区| 热久久一区二区| 午夜欧美视频在线观看| 性欧美大战久久久久久久久| 有码一区二区三区| 一个色在线综合| 亚洲精品视频在线| 亚洲一区免费观看| 亚洲一区自拍偷拍| 五月天一区二区三区| 午夜久久久影院| 麻豆国产欧美一区二区三区| 黄页网站大全一区二区| 激情久久久久久久久久久久久久久久| 日本91福利区| 国产激情一区二区三区桃花岛亚洲| 国产精品中文字幕欧美| 99re8在线精品视频免费播放| 色综合久久久久综合体| 欧美亚洲国产怡红院影院| 欧美日韩精品欧美日韩精品| 日韩免费高清av| 一区二区三区欧美激情| 亚洲一区二区三区四区在线观看| 亚州成人在线电影| 久久丁香综合五月国产三级网站| 国产一区在线不卡| av影院午夜一区| 欧美三级电影精品| 精品国产成人系列| 亚洲男人的天堂av| 麻豆成人久久精品二区三区小说| 高清不卡一二三区| 欧美日韩精品电影| 中文天堂在线一区| 日韩av不卡在线观看| 国产乱子伦一区二区三区国色天香| 成人激情综合网站| 这里是久久伊人| 国产女人水真多18毛片18精品视频| 中文字幕一区二区三区不卡在线| 日韩中文字幕麻豆| av网站一区二区三区| 日韩一区二区三区在线| 国产精品免费免费| 老汉av免费一区二区三区| 91免费在线视频观看| 久久综合色天天久久综合图片| 一区二区三区在线影院| 国产福利一区二区| 日韩一级片网址| 亚洲一区二区三区免费视频| 成人手机电影网| 精品福利视频一区二区三区| 亚洲福利国产精品| 99re热视频这里只精品| 久久精品亚洲乱码伦伦中文 | 欧美系列一区二区| 国产精品久久福利| 精品一二三四在线| 欧美一级生活片| 亚欧色一区w666天堂| 91久久国产综合久久| 国产精品国产三级国产aⅴ原创 | 国产精品亚洲专一区二区三区| 91麻豆精品国产91久久久使用方法 | 2021国产精品久久精品| 亚洲二区在线观看| 日本韩国一区二区| 亚洲小说欧美激情另类| 97超碰欧美中文字幕| 中文字幕一区不卡| 99久久亚洲一区二区三区青草| 久久网站最新地址| 国产成人av一区二区三区在线| 精品伦理精品一区| 国产精品一区在线观看你懂的| 精品福利av导航| 久久97超碰色| 久久综合九色欧美综合狠狠| 国内精品视频666| 久久精品一区二区三区不卡| 福利一区在线观看| 国产精品高潮久久久久无| av欧美精品.com| 亚洲在线观看免费| 欧美精品第1页| 免费成人在线影院| 2023国产一二三区日本精品2022| 久久精品国产99国产精品| 精品国产乱码久久久久久免费| 国产精品一区二区在线播放 | 精品国产一二三| 国产成人精品一区二区三区四区| 国产免费观看久久| 97se亚洲国产综合自在线| 亚洲自拍偷拍欧美| 日韩精品一区二区三区三区免费 | 日韩不卡在线观看日韩不卡视频| 欧美一区二区精品| 国产经典欧美精品| 悠悠色在线精品| 日韩欧美视频一区| 高清在线成人网| 亚洲成人av电影| 久久久国产精品午夜一区ai换脸| 成人av电影在线网| 日韩电影一区二区三区| 国产亚洲精品久| 欧美午夜一区二区| 国产麻豆成人传媒免费观看| 一区二区欧美国产| 精品91自产拍在线观看一区| 色婷婷综合在线| 国产一区二区三区在线观看免费 | 色婷婷香蕉在线一区二区| 日韩在线一二三区| 国产精品久久久久久久久免费相片| 欧美午夜片在线看| 成人av在线观| 美国毛片一区二区三区| 亚洲男人电影天堂| 久久久精品黄色| 日韩一区国产二区欧美三区| 99riav久久精品riav| 国产一区在线精品| 日本欧美加勒比视频| 亚洲另类中文字| 国产日韩影视精品| 精品免费日韩av| 91精品国产综合久久久久久| 91在线视频免费观看| 国产在线乱码一区二区三区| 无码av免费一区二区三区试看| 国产日韩精品一区二区浪潮av| 欧美一卡在线观看| 欧美日韩在线播| 日本久久一区二区| 97精品久久久午夜一区二区三区| 国产毛片一区二区| 在线一区二区三区| 成人av影院在线| 国产精品综合av一区二区国产馆| 奇米综合一区二区三区精品视频| 伊人开心综合网| 一区2区3区在线看| 亚洲精品免费电影| 亚洲曰韩产成在线| 亚洲综合激情网| 亚洲午夜视频在线观看| 亚洲激情图片qvod| 亚洲一级二级在线| 亚洲v日本v欧美v久久精品| 伊人开心综合网| 亚洲一区二区高清| 日韩电影免费在线看| 日本不卡中文字幕| 国产麻豆精品一区二区| 国产精品77777| 成人午夜精品一区二区三区| 成人h动漫精品一区二区| 成人久久18免费网站麻豆| 成人动漫视频在线| 一本色道久久综合亚洲精品按摩| 色屁屁一区二区| 欧美日韩成人高清| 日韩精品中文字幕在线一区| 精品久久人人做人人爰| 久久精品网站免费观看| 国产精品成人免费在线| 亚洲精品欧美在线| 视频一区中文字幕国产| 国产一区二区三区免费播放| 国产成人h网站| 欧美午夜精品一区| 精品三级在线观看| 中文成人av在线| 亚洲一区二区中文在线| 蜜臀久久久久久久| 懂色中文一区二区在线播放| 91片黄在线观看| 欧美电影一区二区| 国产人伦精品一区二区| 亚洲国产综合在线| 国产在线精品免费av| 日本电影欧美片| 久久人人超碰精品| 一个色综合网站| 国产一区二区三区免费观看| 91福利国产精品| 久久综合成人精品亚洲另类欧美 | 国产午夜精品久久久久久久| 亚洲永久精品大片| 国产91综合网| 7777精品伊人久久久大香线蕉经典版下载 | 日本美女一区二区三区视频| 成人短视频下载|