Sample code: |
// This code demonstrates how to setup the initial Gantt Data quickly
class CGanttView : public CBCGPGanttView
{
// Operations
public:
void CreateDemo (BOOL bRedraw = TRUE);
....
};
void CGanttView::CreateDemo (BOOL bRedraw /*= TRUE*/)
{
CBCGPGanttControl& control = GetControl ();
CBCGPGanttChart* pChart = GetChart ();
COleDateTime t = COleDateTime::GetCurrentTime ();
t.SetDate (t.GetYear (), t.GetMonth (), t.GetDay ()); // reset time
for (int i = 0; i < 7; ++i)
{
CBCGPGanttItem* pItem = new CBCGPGanttItem;
pItem->SetInterval (t, t + COleDateTimeSpan(3, 0, 0, 0));
pItem->SetProgress (0.005f + 0.19f * i);
pChart->AddItem (pItem);
t += COleDateTimeSpan(1, 0, 0, 0);
}
} |
|