Always show selection |
Post Reply |
Author | |
Lipi
Newbie Joined: 23 November 2012 Status: Offline Points: 2 |
Post Options
Thanks(0)
Posted: 23 November 2012 at 8:51am |
Hi,
Is there a way to always show the current selection in the CXTPReportControl even if the report has not the focus? (as CTreeCtrl does with flag TVS_SHOWSELALWAYS) |
|
Lipi
Newbie Joined: 23 November 2012 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
I found a way to do this.
In my CustomRecord class derived from CXTPReportRecord, i redefine GetItemMetrics() : void CustomRecord::GetItemMetrics( XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pItemMetrics ) { if(pDrawArgs->pRow->IsSelected())// to highlight selected row even if the control hasnt the focus { CXTPReportPaintManager *pPaintManager = pDrawArgs->pControl->GetPaintManager(); pItemMetrics->clrForeground = pPaintManager->m_clrHighlightText; pItemMetrics->clrBackground = pPaintManager->m_clrHighlight; } else if ((pDrawArgs->pRow->GetIndex() % 2) && !pDrawArgs->pItem->IsPreviewItem())//one row on two will be a little bit grey { pItemMetrics->clrBackground = RGB(240, 240, 240); } } and i set the "m_bHideSelection" of the paintManager of the ReportControl to TRUE in the init() of my view m_report_elements.GetPaintManager()->m_bHideSelection = TRUE; |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |