#ifndef XML_FORM_COLUMN_SORT_CLASS_H_INCLUDED
#define XML_FORM_COLUMN_SORT_CLASS_H_INCLUDED
/*****************************************************************************/
/* HEADER FILE */
/*****************************************************************************/
/*
$Archive: $
$Revision: $
Last Checkin:
$Date: $
By:
$Author: $
Last Modification:
$ModTime: $
Description: Declaration of a variant-enabled sort class manager for
use with the multi column sort-enabled list control
TOOL And XML FORMS License
==========================
Except where otherwise noted, all of the documentation
and software included in the TOOL package is
copyrighted by Michael Swartzendruber.
Copyright (C) 2005 Michael John Swartzendruber.
All rights reserved.
Access to this code, whether intentional or accidental,
does NOT IMPLY any transfer of rights.
This software is provided "as-is," without any express
or implied warranty. In no event shall the author be held
liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for
any purpose, including commercial applications, and to
alter and redistribute it, provided that the following
conditions are met:
1. All redistributions of source code files must retain
all copyright notices that are currently in place,
and this list of conditions without modification.
2. The origin of this software must not be misrepresented;
you must not claim that you wrote the original software.
3. If you use this software in another product, an acknowledgment
in the product documentation would be appreciated but is
not required.
4. Modified versions in source or binary form must be plainly
marked as such, and must not be misrepresented as being
the original software.
*/
/*****************************************************************************/
#include "../../Utilities/FastString.h"
class CXMLFormSortClass
{
public:
CXMLFormSortClass( CListCtrl* poOwner, const int iColumn, const bool bIsNumeric );
virtual ~CXMLFormSortClass( void );
void Sort( const bool bAscending );
static int CALLBACK TextCompareAscending ( LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort );
static int CALLBACK TextCompareDescending( LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort );
static int CALLBACK NumericCompareAscending ( LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort );
static int CALLBACK NumericCompareDescending( LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort );
protected:
class CTextSortItem
{
friend CXMLFormSortClass;
public:
CTextSortItem( const DWORD dItemID, const CFastString& roItemText );
virtual ~CTextSortItem( void );
private:
CFastString m_oItemText;
DWORD m_dwItemID;
};
class CNumericSortItem
{
friend CXMLFormSortClass;
public:
CNumericSortItem( const DWORD dwItemID, const CFastString& roItemText );
private:
int m_iNumericValue;
DWORD m_dwItemID;
};
private:
int m_iColumn;
int m_iStartingItem;
int m_iEndingItem;
CListCtrl* m_poOwner;
bool m_bIsNumeric;
};
#endif
/*****************************************************************************/
/* Check-in history
$WorkFile: $
$Archive: $
*$Log: $
*/
/*****************************************************************************/