Click here to Skip to main content
13,353,322 members (58,312 online)
Click here to Skip to main content


93 bookmarked
Posted 16 Nov 1999

Address Book

, 6 Aug 2000
Address Book application
// GfxCategoryManager.h: interface for the CGfxCategoryManager class.

#if !defined(AFX_GFXCATEGORYMANAGER_H__F2CEE8B3_014D_11D2_83E4_0000B43382FE__INCLUDED_)

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

enum { fcFixedTextCategory = 0, fcUserCategory, fcTimeCategory, fcVariableTextCategory, fcNumericCategory };

class CGfxListCtrl;
class CGfxCategoryManager;

class CGfxCategoryManager  
	class CGfxCategory
		void Clear();
		void Init(const char * _cText, const double _dbMin, const double _dbMax);
		void Init(const char * _cText, const CTime _tmFrom, const CTime _tmTo);
		void Init(const char * _cText, const char * _cCategory);

		char * cText;
		long * pItems, iItems, lKind;
		bool   bExpanded;

		char * cCategory;
		double dbMin, dbMax;
		CTime  tmFrom, tmTo;

	int InsertNewItem(CGfxListCtrl * pList, const long lData);
	void RemoveCategoryItems(const int iCat, const int iIdx, CGfxListCtrl * pList);
	void FillCategoryItems(const int iCat, const int iIdx, CGfxListCtrl * pList);
	void InsertCategoryInList(CGfxListCtrl * pList);
	int IsListItemACategory(DWORD dwData);
	void ResetList(CGfxListCtrl * pList);
	void SetupList(CGfxListCtrl * pList);
	void AddItemToCategory(const int _iCategory, const long dwData);
	int AddCategory(const char * cText, const dbMin, const dbMax);
	int AddCategory(const char * cText, const CTime tmFrom, const CTime tmTo);
	int AddCategory(const char * cText, const char * cCategory);
	int FindCategory(const double dbVal);
	int FindCategory(const CTime tmTime);
	int FindCategory(const char * cText);

	void	(CWnd::*m_fpCategoryFun)(CGfxCategoryManager * , long &);
	void	(CWnd::*m_fpDaoCategoryFun)(CGfxCategoryManager *);
	void	SetCategoryCallback(void (CWnd::*fpCategoryFun)(CGfxCategoryManager * , long &)) { m_fpCategoryFun = fpCategoryFun; };
	void	SetDaoCategoryCallback(void (CWnd::*fpDaoCategoryFun)(CGfxCategoryManager *)) { m_fpDaoCategoryFun = fpDaoCategoryFun; };

//	int		(__cdecl *m_fpCompareFun)(const void *elem1, const void *elem2);
//	void	SetCompareCallback(int (__cdecl *fpCompareFun)(const void *, const void *)) { m_fpCompareFun = fpCompareFun; };

	virtual ~CGfxCategoryManager();

	long   iCategory, lMode;
	long * pItems, iItems;

	CGfxCategory * pCategory;

	CWnd * pCallBackOwner;

#endif // !defined(AFX_GFXCATEGORYMANAGER_H__F2CEE8B3_014D_11D2_83E4_0000B43382FE__INCLUDED_)

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.


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


About the Author

Xavier John
Software Developer
United States United States
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180111.1 | Last Updated 7 Aug 2000
Article Copyright 1999 by Xavier John
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid