Click here to Skip to main content
15,892,059 members
Articles / Desktop Programming / MFC

Multicolumn Combobox with Additional Format Conditions

Rate me:
Please Sign up or sign in to vote.
4.33/5 (2 votes)
9 May 2007CPOL2 min read 78.9K   5.3K   39  
Multicolumn Combobox with additional format conditions depending on the displayed values
#pragma once

//	CMCCell

class CMCCell : public CObject
{
public:
	enum	CellType
	{
		CT_Unknown		= 0,
		CT_String,
		CT_Integer,
		CT_Long,
		CT_Decimal,
		CT_Date,
		CT_Time,
		CT_DateTime,
		CT_Boolean
	};
								 CMCCell						( );
								 CMCCell						( CString strValue );
								 CMCCell						( int nValue );
								 CMCCell						( long lValue );
								 CMCCell						( double dValue );
								 CMCCell						( bool bValue );
								 CMCCell						( COleDateTime dtValue, CellType eCellType = CMCCell::CT_DateTime );
								~CMCCell						( );


			//	returns the cell type
			CellType			 Get_CellType					( void );
			//	the following functions sets the cell value and define the cell type as needed
			void				 Set_Value						( CString strValue );
			void				 Set_Value						( int nValue );
			void				 Set_Value						( long lValue );
			void				 Set_Value						( double dValue );
			void				 Set_Value						( bool bValue );
			void				 Set_Value						( COleDateTime dtValue, CellType eCellType = CMCCell::CT_DateTime );

			//	returns the compare value for the cell (f. e. datetime 20070509145630)
			CString				 Get_ComparisonValue			( void );
			//	returns the display value for the cell (f. e. datetime 09.05.2007 12:56:30)
			CString				 Get_DisplayValue				( void );
private:
			CellType			 m_eCellType;
			CString				 m_strValue;
			int					 m_nValue;
			long				 m_lValue;
			double				 m_dValue;
			bool				 m_bValue;
			COleDateTime		 m_dtValue;
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions