int CInteractionStructureView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CXTPReportView::OnCreate(lpCreateStruct) == -1) { return -1; } GetReportCtrl().SetPaintManager(new CXTPReportInteractionStructurePaintManager()); CXTPToolTipContext* pToolTipContext = GetReportCtrl().GetToolTipContext(); if (pToolTipContext != NULL) { pToolTipContext->SetStyle(xtpToolTipOffice2007); pToolTipContext->SetMaxTipWidth(200); pToolTipContext->SetMargin(CRect(2, 2, 2, 2)); pToolTipContext->SetDelayTime(TTDT_INITIAL, 1000); } LoadImages(); CXTPReportControl& wndReport = GetReportCtrl(); CXTPReportColumn* pColumn = wndReport.AddColumn(new CXTPReportColumn(0, _T("Name"), 250)); pColumn->SetTreeColumn(TRUE); pColumn->SetAlignment(DT_VCENTER); pColumn->SetEditable(FALSE); pColumn->SetSortable(TRUE); pColumn->SetSortIncreasing(TRUE); pColumn = wndReport.AddColumn(new CXTPReportColumn(ICON_COLUMN_NO /*1*/, _T(""), 30)); pColumn->SetMinWidth(25); pColumn->SetAlignment(DT_RIGHT); pColumn->SetEditable(FALSE); pColumn->EnableResize(FALSE); wndReport.SetGridStyle(false, xtpReportGridNoLines); wndReport.GetReportHeader()->AllowColumnRemove(FALSE); wndReport.GetPaintManager()->SetColumnStyle(xtpReportColumnFlat); wndReport.EditOnClick(FALSE); wndReport.SetMultipleSelection(true); wndReport.SetTreeIndent(7); wndReport.ShowHeader(FALSE); wndReport.ShowRowFocus(FALSE); wndReport.GetReportHeader()->AllowColumnResize(false); wndReport.SetSortRecordChilds(TRUE); wndReport.GetColumns()->SetSortColumn(wndReport.GetColumns()->GetAt(0), TRUE); wndReport.GetPaintManager()->m_bShadeSortColumn = FALSE; ShowScrollBar(SB_HORZ, FALSE); RefreshList(); return 0; }
CXTPReportColumn* CSimpleReport::ColSet(int order, const char* s, int width, int align) { CXTPReportColumn* p = AddColumn(new CXTPReportColumn(order, s, width)); p->SetAlignment(align); p->SetHeaderAlignment(DT_CENTER); return p; }