16,551
社区成员
发帖
与我相关
我的任务
分享
class CPaintTable
{
public:
CPaintTable(void);
public:
~CPaintTable(void);
.........
private:
int *m_Timeindex;
ClrStruct *m_ClrItems;
};
CPaintTable::CPaintTable(void)
{
m_Timei = 0;
m_NewResulti = 0;
m_LiveD.Rst =0;
m_LiveD.Data.RemoveAll();
m_LiveD.fn = 0;
}
/*---------------------------------------------------------------------------
* 函数名称:~CPaintTable(void);
* 函数功能:析构函数
----------------------------------------------------------------------------*/
CPaintTable::~CPaintTable(void)
{
delete []m_Timeindex;
delete []m_ClrItems;
}
void CPaintTable::GetAllMatchData(CWnd *pwnd,CStringArray &XMLI,int &ViewW,int &ViewH)
{
int NewResultTemp = 0;
m_XMLItems.Copy(XMLI);
//m_GXML.GetMatchState(m_XMLItems,m_MatchState);
m_GXML.DateNumber(m_XMLItems,m_DateItems);
//按日期排位置
m_GXML.CompositorFunction(m_XMLItems,0,m_XMLItems.GetSize()-1,TimeCompositor);
m_GXML.DataProcessing(m_DateItems,m_XMLItems);//,m_MatchNow);
long CountofItems = 0;
CountofItems = m_XMLItems.GetSize();
//重点在这。。
m_Timeindex = new int [CountofItems];
m_ClrItems = new ClrStruct [CountofItems];
for( int i = 0; i < CountofItems; i++ )
{
if (m_XMLItems.GetAt(i) != _T("$$"))
{
m_ClrItems[i] = m_GXML.ParseXMLClr(m_XMLItems.GetAt(i));
}
if (m_XMLItems.GetAt(i) == _T("%%"))
{
NewResultTemp++;
}
}
CClientDC dc (pwnd);
m_nCellWidth = dc.GetDeviceCaps (LOGPIXELSX);
m_nCellHeight = dc.GetDeviceCaps (LOGPIXELSY) / 4 - 10;
ViewW = nViewWidth;
ViewH = m_nCellHeight * ((CountofItems)*2 - m_DateItems.GetSize() - NewResultTemp );
}
CPaintTable::CPaintTable(void)
{
m_Timei = 0;
m_NewResulti = 0;
m_LiveD.Rst =0;
m_LiveD.Data.RemoveAll();
m_LiveD.fn = 0;
m_ClrItems = NULL;
m_Timeindex= NULL;
}
/*---------------------------------------------------------------------------
* 函数名称:~CPaintTable(void);
* 函数功能:析构函数
----------------------------------------------------------------------------*/
CPaintTable::~CPaintTable(void)
{
if(m_Timeindex)
delete []m_Timeindex;
if(ClrItems)
delete []m_ClrItems;
}
void CPaintTable::GetAllMatchData(CWnd *pwnd,CStringArray &XMLI,int &ViewW,int &ViewH)
{
int NewResultTemp = 0;
m_XMLItems.Copy(XMLI);
//m_GXML.GetMatchState(m_XMLItems,m_MatchState);
m_GXML.DateNumber(m_XMLItems,m_DateItems);
//按日期排位置
m_GXML.CompositorFunction(m_XMLItems,0,m_XMLItems.GetSize()-1,TimeCompositor);
m_GXML.DataProcessing(m_DateItems,m_XMLItems);//,m_MatchNow);
long CountofItems = 0;
CountofItems = m_XMLItems.GetSize();
//重点在这。。
if(m_Timeindex)
{
delete [] m_Timeindex;
}
m_Timeindex = new int [CountofItems];
if(m_ClrItems)
{
delete [] m_ClrItems;
}
m_ClrItems = new ClrStruct [CountofItems];
for( int i = 0; i < CountofItems; i++ )
{
if (m_XMLItems.GetAt(i) != _T("$$"))
{
m_ClrItems[i] = m_GXML.ParseXMLClr(m_XMLItems.GetAt(i));
}
if (m_XMLItems.GetAt(i) == _T("%%"))
{
NewResultTemp++;
}
}
CClientDC dc (pwnd);
m_nCellWidth = dc.GetDeviceCaps (LOGPIXELSX);
m_nCellHeight = dc.GetDeviceCaps (LOGPIXELSY) / 4 - 10;
ViewW = nViewWidth;
ViewH = m_nCellHeight * ((CountofItems)*2 - m_DateItems.GetSize() - NewResultTemp );
}if(m_Timeindex)
{
delete [] m_Timeindex;
}
m_Timeindex = new int [CountofItems];
if(m_ClrItems)
{
delete [] m_ClrItems;
}
m_ClrItems = new ClrStruct [CountofItems];