📄 gfxcategorymanager.h
字号:
// GfxCategoryManager.h: interface for the CGfxCategoryManager class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_GFXCATEGORYMANAGER_H__F2CEE8B3_014D_11D2_83E4_0000B43382FE__INCLUDED_)
#define 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
{
public:
class CGfxCategory
{
public:
/**
*清空当前目录项
**/
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;
/**
*pItem
*当前目录项的子目录项数iItems
*lKinds
**/
long * pItems, iItems, lKind;
/**
*当前目录项是否展开bExpanded
**/
bool bExpanded;
char * cCategory;
double dbMin, dbMax;
CTime tmFrom, tmTo;
};
public:
/**
*向列表数据集目录及列表(末尾)中插入一新行(新行数据lData)
**/
int InsertNewItem(CGfxListCtrl * pList, const long lData);
/**
*从列表中删除属于索引为iCat的目录项(位于列表的第iIdx行)的所有行
**/
void RemoveCategoryItems(const int iCat, const int iIdx, CGfxListCtrl * pList);
/**
*向列表中插入属于索引为iCat的目录项(位于列表的第iIdx行)的所有行
**/
void FillCategoryItems(const int iCat, const int iIdx, CGfxListCtrl * pList);
/**
*依列表数据集目录重新设置列表(显示目录项)
**/
void InsertCategoryInList(CGfxListCtrl * pList);
/**
*判断列表项是否为列表数据集目录中的目录项(是则返回目录项索引,否则返回-1)
**/
int IsListItemACategory(DWORD dwData);
/**
*重置列表(只显示行不显示目录项)
**/
void ResetList(CGfxListCtrl * pList);
/**
*建立列表数据集目录并建立列表(显示目录项)
**/
void SetupList(CGfxListCtrl * pList);
/**
*在列表数据集目录中向索引为_iCategoryp的目录项添加一行信息
**/
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; };
/**
*初始化列表数据集目录
**/
CGfxCategoryManager();
/**
*撤消列表数据集目录
**/
virtual ~CGfxCategoryManager();
/**
*列表数据集目录中的目录项数iCategory
*lMode
**/
long iCategory, lMode;
/**
*列表数据集目录中的存放行数据的数组指针pItems
*列表数据集目录中的行数iItems
**/
long * pItems, iItems;
/**
*列表数据集目录中的目录项数组指针pCategory
**/
CGfxCategory * pCategory;
/**
*回调函数的拥有者指针pCallBackOwner(此处为SuperGrid1View窗口)
**/
CWnd * pCallBackOwner;
};
#endif // !defined(AFX_GFXCATEGORYMANAGER_H__F2CEE8B3_014D_11D2_83E4_0000B43382FE__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -