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; }
void CMailView::OnDestroy() { CBCGPReportCtrl* pReportCtrl = GetReportCtrl (); ASSERT_VALID (pReportCtrl); pReportCtrl->SaveState (NULL); CBCGPReportView::OnDestroy(); }
void CInteractionStructureView::ShowChildWindows(bool bShow) { CXTPReportControl& wndReport = GetReportCtrl(); if (bShow) { if (!wndReport.IsWindowVisible()) wndReport.ShowWindow(SW_SHOW); } else { if (wndReport.IsWindowVisible()) wndReport.ShowWindow(SW_HIDE); } }
CInteractionStructureView::CInteractionStructureView(void) { m_areEx = NULL; m_areElement = NULL; m_pAnswers = NULL; m_pButtons = NULL; m_pFeedback = NULL; m_pStatusDisplay = NULL; m_pMisc = NULL; m_areObjects = NULL; GetReportCtrl().SelectionEnable(FALSE); }
void CMailView::OnNew() { CBCGPReportCtrl* pReportCtrl = GetReportCtrl (); CBCGPGridRow* pRow = pReportCtrl->CreateRow (pReportCtrl->GetColumnCount ()); CMailFrame frame (*pRow, FALSE, this); if (frame.DoModal () == IDOK) { delete pRow; //pReportCtrl->AddRow (pRow, TRUE); } else { delete pRow; } }
int CSimpleReportView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CXTPReportView::OnCreate(lpCreateStruct) == -1) return -1; CSimpleReport& m_list = (CSimpleReport&)GetReportCtrl(); // 컬럼 셋업 CXTPReportColumn* p = m_list.ColSet(0, "first", 100); m_list.ColSet(1, "second", 200); m_list.ColSet(2, "third", 200); m_list.SetFontText("Arial", 16); m_list.SetFontHeader("맑은 명조", 16); // 콤보 박스 CStringArray s; s.Add("hello"); s.Add("world"); s.Add("mind"); s.Add("boggling"); m_list.ColSetComboData(p, s); // 레코드 삽입 for (int i = 0; i < 20; i++) { CXTPReportRecord* pRec = m_list.RowAdd(); m_list.ColAdd(pRec, "hello"); m_list.ColAdd(pRec, i * 10.0, "%5.2f"); m_list.ColAdd(pRec, i, "%3.0f"); } // 컬러/볼드 세팅 m_list.ColSetColor(0, 2, RGB(255, 255, 255), RGB(0, 200, 0)); m_list.ColSetBold(0, 1); m_list.RowSetBold(1); m_list.RowSetColor(5, RGB(255, 255, 255), RGB(200, 0, 0)); m_list.Populate(); return 0; }
void CMailView::OnContextMenu(CWnd*, CPoint point) { if (point == CPoint (-1, -1)) { CBCGPGridRow* pSel = GetReportCtrl ()->GetCurSel (); if (pSel != NULL) { CRect rect = pSel->GetRect (); ClientToScreen (&rect); point.x = rect.left; point.y = rect.bottom; } } theApp.ShowPopupMenu (IDR_MAIL_MENU, point, this); }
BOOL CMailView::AddMail (int nIcon, LPCTSTR strFrom, LPCTSTR strTo, LPCTSTR strSubject, COleDateTime dateCreated, COleDateTime dateReceived, long lSize, IMPORTANCE importance/* = IMPORTANCE_NORMAL*/, BOOL bHasAttachment/* = FALSE*/, int nFlag/* = 0*/) { CBCGPReportCtrl* pReportCtrl = GetReportCtrl (); CBCGPGridRow* pRow = pReportCtrl->CreateRow (pReportCtrl->GetColumnCount ()); //---------------- // Set importance: //---------------- int nImportanceIcon = -1; switch (importance) { case IMPORTANCE_HIGH: nImportanceIcon = 2; break; case IMPORTANCE_LOW: nImportanceIcon = 3; break; } pRow->GetItem (0)->SetImage (nImportanceIcon, FALSE); pRow->GetItem (1)->SetImage (nIcon, FALSE); pRow->GetItem (2)->SetImage (bHasAttachment ? 5 : -1, FALSE); pRow->GetItem (3)->SetValue (strFrom, FALSE); pRow->GetItem (4)->SetValue (strSubject, FALSE); pRow->GetItem (5)->SetValue (strTo, FALSE); pRow->ReplaceItem (7, new CBCGPGridDateTimeItem (dateCreated), FALSE); pRow->ReplaceItem (8, new CBCGPGridDateTimeItem (dateReceived), FALSE); pRow->GetItem (9)->SetValue (lSize, FALSE); pRow->ReplaceItem (11, new CFlagItem (m_Flags, nFlag), FALSE); pReportCtrl->AddRow (pRow, FALSE); return TRUE; }
void CMailView::OnViewColumnAutoResize() { GetReportCtrl ()->EnableColumnAutoSize (!GetReportCtrl ()->IsColumnAutoSizeEnabled ()); }
void CMailView::OnUpdateViewGroupbox(CCmdUI* pCmdUI) { pCmdUI->SetCheck (GetReportCtrl ()->IsGroupByBox ()); }
void CMailView::OnViewGroupbox() { GetReportCtrl ()->EnableGroupByBox (!GetReportCtrl ()->IsGroupByBox ()); }
void CMailView::OnUpdateViewFieldchooser(CCmdUI* pCmdUI) { pCmdUI->SetCheck (GetReportCtrl ()->IsColumnsChooserVisible ()); }
void CMailView::OnViewFieldchooser() { GetReportCtrl ()->ShowColumnsChooser ( !GetReportCtrl ()->IsColumnsChooserVisible ()); }
void CMailView::OnCollapseAll() { GetReportCtrl ()->ExpandAll (FALSE); }
void CInteractionStructureView::DeSelectItems() { for (int i = 0; i < GetReportCtrl().GetRows()->GetCount(); i++) { GetReportCtrl().GetRows()->GetAt(i)->SetSelected(false); } }
void CInteractionStructureView::OnSetFocus(CWnd* pOldWnd) { CView::OnSetFocus(pOldWnd); GetReportCtrl().SetFocus(); }
void CMailView::OnInitialUpdate() { CBCGPReportView::OnInitialUpdate(); if (m_bFirstTime) { m_bFirstTime = FALSE; CBCGPReportCtrl* pReportCtrl = GetReportCtrl (); ASSERT_VALID (pReportCtrl); //------------------ // Load grid images: //------------------ CBitmap bmp; bmp.LoadBitmap (IDB_MAIL_ICONS); m_Images.Create (16, 16, ILC_COLOR32 | ILC_MASK, 0, 0); m_Images.Add (&bmp, (CBitmap*) NULL); pReportCtrl->SetImageList (&m_Images); //------------------------------ // Load images for "flag" items: //------------------------------ m_Flags.SetImageSize (CSize (14, 14)); m_Flags.SetTransparentColor (RGB (255, 0, 255)); m_Flags.Load (IDB_MAIL_FLAGS); //---------------- // Insert columns: //---------------- pReportCtrl->InsertColumn (0, _T("Importance"), 20, 1); pReportCtrl->InsertColumn (1, _T("Icon"), 20, 0); pReportCtrl->InsertColumn (2, _T("Attachment"), 20, 2); pReportCtrl->InsertColumn (3, _T("From"), 150); pReportCtrl->InsertColumn (4, _T("Subject"), 150); pReportCtrl->InsertColumn (5, _T("To"), 140); pReportCtrl->InsertColumn (6, _T("CC"), 120); pReportCtrl->InsertColumn (7, _T("Created"), 130); pReportCtrl->InsertColumn (8, _T("Received"), 130); pReportCtrl->InsertColumn (9, _T("Size"), 80); pReportCtrl->InsertColumn (10, _T("Category"), 80); pReportCtrl->InsertColumn (11, _T("Flag Status"), 20, 3); //pReportCtrl->SetHeaderAlign (0, HDF_CENTER); //pReportCtrl->SetHeaderAlign (1, HDF_CENTER); //pReportCtrl->SetHeaderAlign (2, HDF_CENTER); //pReportCtrl->SetColumnAlign (0, HDF_CENTER); // Importance //pReportCtrl->SetColumnAlign (1, HDF_CENTER); // Icon //pReportCtrl->SetColumnAlign (2, HDF_CENTER); // Attachment pReportCtrl->SetColumnAlign (9, HDF_RIGHT); // Size pReportCtrl->SetColumnLocked (0); pReportCtrl->SetColumnLocked (2); pReportCtrl->SetColumnLocked (11); pReportCtrl->SetColumnVisible (4, FALSE); pReportCtrl->SetColumnVisible (5, FALSE); pReportCtrl->SetColumnVisible (6, FALSE); pReportCtrl->SetColumnVisible (8, FALSE); pReportCtrl->SetColumnVisible (10, FALSE); //------------------- // Set group columns: //------------------- pReportCtrl->InsertGroupColumn (0, 8 /* Received */); pReportCtrl->InsertGroupColumn (1, 4 /* Subject */); //-------------------------- // Create header image list: //-------------------------- m_ImagesHeader.Create (IDB_MAIL_HEADER, 12, 0, RGB (255, 0, 255)); pReportCtrl->SetHeaderImageList (&m_ImagesHeader); pReportCtrl->EnableHeader (); pReportCtrl->EnableColumnAutoSize (TRUE); pReportCtrl->SetWholeRowSel (TRUE); pReportCtrl->SetSingleSel (TRUE); pReportCtrl->EnableMarkSortedColumn (TRUE); pReportCtrl->EnableGroupByBox (TRUE); pReportCtrl->LoadState (NULL); CreateDemo(); } }
void CInteractionStructureView::RefreshList(bool bForceRefresh) { CEditorDoc *pDoc = (CEditorDoc *) GetDocument(); ASSERT(pDoc != NULL); if (pDoc == NULL) { return; } CInteractionStream *pInteractionStream = pDoc->project.GetInteractionStream(); if (!pInteractionStream) { GetReportCtrl().ResetContent(); return; } UpdateTimelineVisibleObjects(); CArray<CInteractionAreaEx *, CInteractionAreaEx *> caInteractionsFind; UINT uPageStart=0,uPageEnd=0; pDoc->project.GetPagePeriod(pDoc->m_curPosMs,uPageStart,uPageEnd); CTimePeriod tp; tp.Init(INTERACTION_PERIOD_TIME,uPageStart,uPageEnd); pInteractionStream->FindInteractions(&tp, false, &caInteractionsFind); // add new interactions to list GetReportCtrl().ResetContent(); CXTPReportControl &wndReport = GetReportCtrl(); // save new interactions m_caInteractions.RemoveAll(); for (int i = 0; i < caInteractionsFind.GetSize(); ++i) { m_caInteractions.InsertAt(0, caInteractionsFind[i]); } int nImageIndex = 2; CString csInteractionName; CXTPReportRecord* pReportControl = NULL; if (GetStructureTypeCaptionForCurrentPage(csInteractionName, nImageIndex)) { if (m_areEx == NULL) { m_areEx = new CInteractionAreaEx(); } m_areEx->SetInteractionName(csInteractionName, false); m_areEx->SetHiddenDuringEdit(false); pReportControl = new CInteractionRecord(m_areEx, 0, _T(""), nImageIndex); pReportControl->SetExpanded(TRUE); } CXTPReportRecord* pAnswers = NULL, *pButtons = NULL, *pFeedback = NULL, *pStatusDisplay = NULL, *pMisc = NULL; CXTPReportRecord* pReportControlInteractionElement = NULL, *pReportControlInteractionObjects = NULL; CString csCaption = _T(""); for (int i = 0; i < m_caInteractions.GetSize(); ++i) { InteractionRecordType interactionType = m_caInteractions[i]->GetTypeId(); switch (interactionType) { case INTERACTION_RECORD_TEXT: { if (pReportControl) { csCaption.LoadString(IDS_ASSIGNMENT_TEXT); CInteractionRecord *pItem = (CInteractionRecord*) pReportControl->GetChilds()->Add( new CInteractionRecord(m_caInteractions[i], INTERACTION_RECORD_PRIORITY_TEXT, csCaption)); } break; } case INTERACTION_RECORD_TITLE: { if (pReportControl) { csCaption.LoadString(IDC_LABEL_TITLE); csCaption = csCaption + _T(" "); CInteractionRecord *pItem = (CInteractionRecord*) pReportControl->GetChilds()->Add( new CInteractionRecord(m_caInteractions[i], INTERACTION_RECORD_PRIORITY_TITLE, csCaption )); } break; } case INTERACTION_RECORD_ANSWERS: { if (pAnswers == NULL && pReportControl != NULL) { csCaption.LoadString(IDC_GROUP_ANSWERS); if (m_pAnswers == NULL) { m_pAnswers = new CInteractionAreaEx(); m_pAnswers->SetInteractionName(csCaption, false); m_pAnswers->SetHiddenDuringEdit(false); } pAnswers = pReportControl->GetChilds()->Add(new CInteractionRecord(m_pAnswers, INTERACTION_RECORD_PRIORITY_ANSWERS, _T("") ,INTERACTION_IMAGE_INDEX_ANSWERS)); pAnswers->SetExpanded(TRUE); } if (pAnswers) { pAnswers->GetChilds()->Add(new CInteractionRecord(m_caInteractions[i])); } break; } case INTERACTION_RECORD_BUTTONS: { if (pButtons == NULL && pReportControl != NULL) { csCaption.LoadString(IDD_QUESTIONNAIRE_BUTTON_PAGE); if (m_pButtons == NULL) { m_pButtons = new CInteractionAreaEx(); m_pButtons->SetInteractionName(csCaption, false); m_pButtons->SetHiddenDuringEdit(false); } pButtons = pReportControl->GetChilds()->Add(new CInteractionRecord(m_pButtons, INTERACTION_RECORD_PRIORITY_BUTTONS, _T("") , INTERACTION_IMAGE_INDEX_BUTTONS)); pButtons->SetExpanded(TRUE); } if (pButtons) { pButtons->GetChilds()->Add(new CInteractionRecord(m_caInteractions[i])); } break; } //case INTERACTION_RECORD_FEEDBACK: { // if (pFeedback == NULL && pReportControl != NULL) { // csCaption.LoadString(IDS_FEEDBACK); // if (m_pFeedback == NULL) { // m_pFeedback = new CInteractionAreaEx(); // m_pFeedback->SetInteractionName(csCaption, false); // m_pFeedback->SetHiddenDuringEdit(false); // } // pFeedback = pReportControl->GetChilds()->Add(new CInteractionRecord(m_pFeedback, INTERACTION_RECORD_PRIORITY_FEEDBACK, _T("") , INTERACTION_IMAGE_INDEX_FEEDBACK)); // pFeedback->SetExpanded(TRUE); // } // if (pFeedback) { // pFeedback->GetChilds()->Add(new CInteractionRecord(m_caInteractions[i])); // } // break; // } case INTERACTION_RECORD_STATUS: { if (pStatusDisplay == NULL && pReportControl != NULL) { csCaption.LoadString(IDS_STATUS_DISPLAY); if (m_pStatusDisplay == NULL) { m_pStatusDisplay = new CInteractionAreaEx(); m_pStatusDisplay->SetInteractionName(csCaption, false); m_pStatusDisplay->SetHiddenDuringEdit(false); } pStatusDisplay = pReportControl->GetChilds()->Add(new CInteractionRecord(m_pStatusDisplay, INTERACTION_RECORD_PRIORITY_STATUSDISPLAY, _T(""), INTERACTION_IMAGE_INDEX_STATUS_DISPLAY)); pStatusDisplay->SetExpanded(TRUE); } if (pStatusDisplay) { pStatusDisplay->GetChilds()->Add( new CInteractionRecord(m_caInteractions[i])); } break; } case INTERACTION_RECORD_ELEMENTS: { if (pReportControlInteractionElement == NULL) { csCaption.LoadString(IDS_INTERACTION_OBJECTS); if (m_areElement == NULL) { m_areElement = new CInteractionAreaEx(); m_areElement->SetInteractionName(csCaption, false); m_areElement->SetHiddenDuringEdit(false); } pReportControlInteractionElement = new CInteractionRecord(m_areElement); pReportControlInteractionElement->SetExpanded(TRUE); } if (m_caInteractions[i]->GetButtonType() == BUTTON_TYPE_OTHER) { pReportControlInteractionElement->GetChilds()->Add( new CInteractionRecord(m_caInteractions[i], 0, _T(""), INTERACTION_IMAGE_INDEX_BUTTONS)); } else { pReportControlInteractionElement->GetChilds()->Add( new CInteractionRecord(m_caInteractions[i], 0, _T(""), INTERACTION_IMAGE_INDEX_INTERACTIVE_AREA)); } break; } case INTERACTION_RECORD_MISC: { if (pMisc == NULL && pReportControl != NULL) { csCaption.LoadString(IDS_MISC); if (m_pMisc == NULL) { m_pMisc = new CInteractionAreaEx(); m_pMisc->SetInteractionName(csCaption, false); m_pMisc->SetHiddenDuringEdit(false); } pMisc = pReportControl->GetChilds()->Add(new CInteractionRecord(m_pMisc, INTERACTION_RECORD_PRIORITY_MISC)); pMisc->SetExpanded(TRUE); } if (pMisc) { pMisc->GetChilds()->Add(new CInteractionRecord(m_caInteractions[i])); } break; } case INTERACTION_RECORD_GRAPHIC_OBJECTS: { if(m_caInteractions[i]->IsDemoDocumentObject()){ if (pReportControlInteractionElement == NULL) { csCaption.LoadString(IDS_INTERACTION_OBJECTS); if (m_areElement == NULL) { m_areElement = new CInteractionAreaEx(); m_areElement->SetInteractionName(csCaption, false); m_areElement->SetHiddenDuringEdit(false); } pReportControlInteractionElement = new CInteractionRecord(m_areElement); pReportControlInteractionElement->SetExpanded(TRUE); } if (m_caInteractions[i]->GetButtonType() == BUTTON_TYPE_OTHER) { pReportControlInteractionElement->GetChilds()->Add( new CInteractionRecord(m_caInteractions[i], 0, _T(""), INTERACTION_IMAGE_INDEX_BUTTONS)); } else { pReportControlInteractionElement->GetChilds()->Add( new CInteractionRecord(m_caInteractions[i], 0, _T(""), INTERACTION_IMAGE_INDEX_INTERACTIVE_CALLOUT)); } } else{ if (pReportControlInteractionObjects == NULL) { csCaption.LoadString(ID_GROUP_GRAPHICAL_OBJECTS); if (m_areObjects == NULL) { m_areObjects = new CInteractionAreaEx(); m_areObjects->SetInteractionName(csCaption, false); m_areObjects->SetHiddenDuringEdit(false); } pReportControlInteractionObjects = new CInteractionRecord(m_areObjects); pReportControlInteractionObjects->SetExpanded(TRUE); } if (m_caInteractions[i]->GetButtonType() == BUTTON_TYPE_OTHER) { pReportControlInteractionObjects->GetChilds()->Add( new CInteractionRecord(m_caInteractions[i], 0, _T(""), INTERACTION_IMAGE_INDEX_BUTTONS)); } else { CGraphicalObject *pGo = (CGraphicalObject*)m_caInteractions[i]; if (pGo->IsCallout()) pReportControlInteractionObjects->GetChilds()->Add( new CInteractionRecord(m_caInteractions[i], 0, _T(""), INTERACTION_IMAGE_INDEX_CALLOUT)); else pReportControlInteractionObjects->GetChilds()->Add( new CInteractionRecord(m_caInteractions[i], 0, _T(""), INTERACTION_IMAGE_INDEX_TEXT)); } } break; } case INTERACTION_RECORD_UNKNOWN: { // should never happen ASSERT(false); break; } } } if(pReportControlInteractionObjects && pReportControlInteractionObjects->GetChilds()->GetCount() > 0) wndReport.AddRecord(pReportControlInteractionObjects); if(pReportControlInteractionElement && pReportControlInteractionElement->GetChilds()->GetCount() > 0) wndReport.AddRecord(pReportControlInteractionElement); if(pReportControl && pReportControl->GetChilds()->GetCount() > 0) wndReport.AddRecord(pReportControl); wndReport.Populate(); //clicked item is marked as selected so reselect timeline selected DeSelectItems(); for (int i = 0; i < GetReportCtrl().GetRows()->GetCount(); i++) { if(((CInteractionRecord*)GetReportCtrl().GetRows()->GetAt(i)->GetRecord())->m_pInteractionArea->IsSelected()) GetReportCtrl().GetRows()->GetAt(i)->SetSelected(TRUE); else GetReportCtrl().GetRows()->GetAt(i)->SetSelected(FALSE); ((CInteractionRecord *)GetReportCtrl().GetRows()->GetAt(i)->GetRecord())->m_pItemIcon->m_bVisible = ((CInteractionRecord *)GetReportCtrl().GetRows()->GetAt(i)->GetRecord())->m_pInteractionArea->IsTimelineDisplay()|| ((CInteractionRecord *)GetReportCtrl().GetRows()->GetAt(i)->GetRecord())->m_pInteractionArea->IsSelected(); ((CInteractionRecord *)GetReportCtrl().GetRows()->GetAt(i)->GetRecord())->m_pItemIcon->UpdateVisibleIcon(); } for (int i = 0; i < GetReportCtrl().GetRows()->GetCount(); i++) { CheckChildrenVisibility(GetReportCtrl().GetRows()->GetAt(i)); } GetReportCtrl().RedrawControl(); }
// Handles clicking ReportControl row. void CInteractionStructureView::OnReportItemClick(NMHDR * pNotifyStruct, LRESULT * /*result*/) { XTP_NM_REPORTRECORDITEM* pItemNotify = (XTP_NM_REPORTRECORDITEM*) pNotifyStruct; if (!pItemNotify->pRow || !pItemNotify->pColumn) { return; } CMainFrameE *pMainWnd = CMainFrameE::GetCurrentInstance(); CWhiteboardView *pWhiteboardView = NULL; if (pMainWnd == NULL) return; pWhiteboardView = pMainWnd->GetWhiteboardView(); if(pWhiteboardView==NULL) return; // Do not do a thing if the row is expandable. // These report items do not have a coresponding "Interaction Area" in Whiteboard View. if (pItemNotify->pRow->HasChildren() == TRUE) { pMainWnd->UpdateStreamView(); return; } CInteractionRecord *pInteractionRecord = (CInteractionRecord*)pItemNotify->pRow->GetRecord();//pItem->GetRecord(); if (pInteractionRecord == NULL) { ASSERT(false); return; } CInteractionAreaEx *pArea = pInteractionRecord->m_pInteractionArea; //MD - another way to fix wrong reaction on column checkbox click - comment line GetReportCtrl().Populate(); // instead of adding condition if (!bCheckBoxClicked)in function CXTPReportRecordItem::OnClick if (pItemNotify->pColumn->GetItemIndex() == ICON_COLUMN_NO) { if (pInteractionRecord->m_pItemIcon == NULL) { ASSERT(false); return; } if(pInteractionRecord->m_pItemIcon->m_bVisible == TRUE) { pArea->SetSelected(false); pWhiteboardView->UpdateSelectionArray(); pArea->SetTimelineDisplay(FALSE); pWhiteboardView->RemoveTimelineDisplayObject(pArea); } else { pArea->SetTimelineDisplay(TRUE); pWhiteboardView->AddTimelineDisplayObject(pArea); } pInteractionRecord->m_pItemIcon->m_bVisible = pInteractionRecord->m_pInteractionArea->IsTimelineDisplay() || pInteractionRecord->m_pInteractionArea->IsSelected(); if (pItemNotify->pRow->GetParentRow() != NULL){ CheckChildrenVisibility(pItemNotify->pRow->GetParentRow()); } pInteractionRecord->m_pItemIcon->UpdateVisibleIcon(); GetReportCtrl().Populate(); pMainWnd->UpdateStreamView(); pMainWnd->UpdateWhiteboardView(); } else { //whiteboard update pWhiteboardView->DeleteSelectionArray(); pArea->SetSelected(true); pWhiteboardView->GetSelectedObjects().Add(pArea); pWhiteboardView->UpdateSelectionArray(); pMainWnd->UpdateWhiteboardView(); pMainWnd->UpdateStreamView(); } DeSelectItems(); for (int i = 0; i < GetReportCtrl().GetRows()->GetCount(); i++) { if(((CInteractionRecord*)GetReportCtrl().GetRows()->GetAt(i)->GetRecord())->m_pInteractionArea->IsSelected()) GetReportCtrl().GetRows()->GetAt(i)->SetSelected(TRUE); else GetReportCtrl().GetRows()->GetAt(i)->SetSelected(FALSE); ((CInteractionRecord *)GetReportCtrl().GetRows()->GetAt(i)->GetRecord())->m_pItemIcon->m_bVisible = ((CInteractionRecord *)GetReportCtrl().GetRows()->GetAt(i)->GetRecord())->m_pInteractionArea->IsTimelineDisplay()|| ((CInteractionRecord *)GetReportCtrl().GetRows()->GetAt(i)->GetRecord())->m_pInteractionArea->IsSelected(); ((CInteractionRecord *)GetReportCtrl().GetRows()->GetAt(i)->GetRecord())->m_pItemIcon->UpdateVisibleIcon(); } for (int i = 0; i < GetReportCtrl().GetRows()->GetCount(); i++) { CheckChildrenVisibility(GetReportCtrl().GetRows()->GetAt(i)); } GetReportCtrl().RedrawControl(); }
void CMailView::OnUpdateViewColumnAutoResize(CCmdUI* pCmdUI) { pCmdUI->SetCheck (GetReportCtrl ()->IsColumnAutoSizeEnabled ()); }
void CMailView::OnExpandAll() { GetReportCtrl ()->ExpandAll (); }
void CMailView::CreateDemo(BOOL bRedraw/* = TRUE*/) { CBCGPReportCtrl* pReportCtrl = GetReportCtrl (); ASSERT_VALID (pReportCtrl); pReportCtrl->RemoveAll (); #define NAMES_NUM 7 LPCTSTR arNames [NAMES_NUM] = { _T("John Smith"), _T("Support Team"), _T("Peter Brown"), _T("Matt Johnson"), _T("James Lee"), _T("Customer Service"), _T("Webmaster"), }; #define SUBJ_NUM 8 LPCTSTR arSubjs [SUBJ_NUM] = { _T("Important information"), _T("Customer Newsletter"), _T("Question"), _T("Business proposal"), _T("Request more info about your products"), _T("Thank you!"), _T("Your application has been approved"), _T("Please read this message"), }; srand( (unsigned)time( NULL ) ); for (int i = 0; i < 100; i++) { COleDateTime now = COleDateTime::GetCurrentTime (); COleDateTimeSpan span ( Rand (5), Rand (23), Rand (59), 0); COleDateTimeSpan span2 ( 0, Rand (2), Rand (59), Rand (59)); AddMail (Rand (2), // Icon arNames [Rand (NAMES_NUM)], arNames [Rand (NAMES_NUM)], arSubjs [Rand (SUBJ_NUM)], now - span - span2, now - span, Rand (200), (IMPORTANCE) Rand (3), Rand (2), Rand (7)); } if (bRedraw) { pReportCtrl->AdjustLayout (); } }
void CInteractionStructureView::LoadImages() { UINT uiImageView[] = {INTERACTION_IMAGE_INDEX_VIEW}; GetReportCtrl().GetImageManager()->SetIcons(IDB_VIEW, uiImageView, _countof(uiImageView), CSize(16, 16)); UINT uiImageViewHide[] = {INTERACTION_IMAGE_INDEX_VIEW_HIDE}; GetReportCtrl().GetImageManager()->SetIcons(IDB_VIEW_HIDE, uiImageViewHide, _countof(uiImageViewHide), CSize(16, 16)); UINT uiImages1[] = {INTERACTION_IMAGE_INDEX_DEFAULT}; GetReportCtrl().GetImageManager()->SetIcons(IDB_FORMAT_BACKGROUND, uiImages1, _countof(uiImages1), CSize(16, 16)); UINT uiImages2[] = {INTERACTION_IMAGE_INDEX_FEEDBACK}; GetReportCtrl().GetImageManager()->SetIcons(IDB_FEEDBACK, uiImages2, _countof(uiImages2), CSize(16, 16)); UINT uiImages3[] = {INTERACTION_IMAGE_INDEX_ANSWERS}; GetReportCtrl().GetImageManager()->SetIcons(IDB_MAIL_RULES, uiImages3, _countof(uiImages3), CSize(16, 16)); UINT uiImages4[] = {INTERACTION_IMAGE_INDEX_STATUS_DISPLAY}; GetReportCtrl().GetImageManager()->SetIcons(IDB_STATUS_DISPLAY, uiImages4, _countof(uiImages4), CSize(16, 16)); UINT uiImages5[] = {INTERACTION_IMAGE_INDEX_BUTTONS}; GetReportCtrl().GetImageManager()->SetIcons(IDB_BUTTON, uiImages5, _countof(uiImages5), CSize(16, 16)); UINT uiImages6[] = {INTERACTION_IMAGE_INDEX_CHOICE, INTERACTION_IMAGE_INDEX_DRAGNDROP, INTERACTION_IMAGE_INDEX_TEXTGAP}; GetReportCtrl().GetImageManager()->SetIcons(IDB_TAB_INSERT_SMALL_E, uiImages6, _countof(uiImages6), CSize(15, 15)); UINT uiImages7[] = {INTERACTION_IMAGE_INDEX_INTERACTIVE_AREA}; GetReportCtrl().GetImageManager()->SetIcons(IDB_INTERACTIVE_AREA, uiImages7, _countof(uiImages7), CSize(16, 16)); UINT uiImages8[] = {INTERACTION_IMAGE_INDEX_CALLOUT}; GetReportCtrl().GetImageManager()->SetIcons(IDB_ICON_CALLOUT, uiImages8, _countof(uiImages8), CSize(16, 16)); UINT uiImages9[] = {INTERACTION_IMAGE_INDEX_TEXT}; GetReportCtrl().GetImageManager()->SetIcons(IDB_ICON_TEXT, uiImages9, _countof(uiImages9), CSize(16, 16)); UINT uiImages10[] = {INTERACTION_IMAGE_INDEX_INTERACTIVE_CALLOUT}; GetReportCtrl().GetImageManager()->SetIcons(IDB_ICON_INTERACTIVE_CALLOUT, uiImages10, _countof(uiImages10), CSize(16, 16)); }