?? count.cpp
字號:
// Count.cpp: implementation of the CCount class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Tally.h"
#include "Count.h"
#include "TallyDoc.h"
#include "Item.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CCount::CCount()
{
/*for (int j=0; j<9; j++){
m_Times[i][j] +=
}*/
//CArray<CItem,CItem&> m_aMonth[12];
CWnd * pMain = AfxGetApp( )->m_pMainWnd;
CTallyDoc * pActiveDoc = (CTallyDoc*)((CMDIFrameWnd*)pMain)->MDIGetActive()->GetActiveDocument();
for (int i=0; i<12; i++){
for (int j=0; j<9; j++){
m_Times[i][j] = 0;
m_Count[i][j] = 0;
}
}
for (i=0; i<12; i++){
for (int j=0; j<pActiveDoc->m_aMonth[i].GetSize(); j++){
m_Times[i][pActiveDoc->m_aMonth[i][j].m_tType] ++;
m_Count[i][pActiveDoc->m_aMonth[i][j].m_tType] += pActiveDoc->m_aMonth[i][j].m_dCost;
}
}
}
CCount::~CCount()
{
}
int CCount::GetYearTimes (int type)
{
int temp = 0;
for (int i=0; i<12; i++)
temp += m_Times[i][type];
return temp;
}
double CCount::GetYearCount (int type)
{
double temp = 0;
for (int i=0; i<12; i++)
temp += m_Count[i][type];
return temp;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -