class CMyClass : public Dapfor::Common::CDataObject
{
public:
enum
{
...
FidCity,
};
enum City
{
London = 100,
Paris,
Totonto,
NewYork,
};
public:
CMyClass(City city);
virtual ~CMyClass();
...
City GetCity() const {return m_City;}
private:
City m_City;
DF_DECLARE_FIELD_MAP();
};
Dapfor::Common::CLongEnumFormat::Item cities[] =
{
{CMyClass::London, "London"},
{CMyClass::Paris, "Paris"},
{CMyClass::Totonto, "Totonto"},
{CMyClass::NewYork, "New York"},
};
DF_BEGIN_FIELD_MAP(CMyClass)
...
DF_ENUM_ID (FidCity, "City", &CMyClass::GetCity, 0, DF_ENUM_FORMAT(cities))
DF_END_FIELD_MAP()
CMyClass::CMyClass(City city) : m_City(city)
{
}
CMyClass::~CMyClass()
{
NotifyDelete();
}
...
Dapfor::GUI::CHeader* header = new Dapfor::GUI::CHeader();
...
header->Add(new Dapfor::GUI::CColumn(CMyClass::FidCity, "City", 100));
m_Grid.SetHeader(header);
Dapfor::Common::CDataObject* pDO = new CMyClass(CMyClass::Paris);
m_Grid.Add(pDO);