Print Page | Close Window

How to not draw focus rect for readonly items

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=6785
Printed Date: 22 November 2024 at 1:44pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to not draw focus rect for readonly items
Posted By: mgampi
Subject: How to not draw focus rect for readonly items
Date Posted: 02 April 2007 at 6:29pm
Hi;
 
I have created a report control with editable and readonly columns. Despite setting FocusSubItems(FALSE), the readonly items of the selected row are drawn with a focus rect and the default row background.
I want the readonly columns not to be drawn with the same attributes as editable items. When clicking on such items the focus should stay on the previous selected item of the same row, or, when the readonly item is part of another row, the other row should be selected and the first editable item of the newly selected row should become focused.
How can this be achieved?
 


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



Replies:
Posted By: idler
Date Posted: 31 July 2007 at 2:14am
i think so:

class myPaintManager : public CXTPReportPaintManager
{
...
virtual void FillRow(CDC* pDC, CXTPReportRow* pRow, CRect rcRow)
{

COLORREF editableBackColor = 0xFFFFFF;

COLORREF backColor = 0xEEEEEE;

int count = pRow->GetRecord()->GetItemCount();

for (int i = 0; i < count; ++i)

{

CXTPReportRecordItem* pItem = pRow->GetRecord()->GetItem(i);

CRect rect = pRow->GetItemRect(pItem);

CXTPReportColumn* pColumn = pRow->GetControl()->GetColumns()->GetAt(i);

if (pColumn->IsEditable())

pDC->FillSolidRect(rect, editableBackColor);

else

pDC->FillSolidRect(rect, backColor);

}

}

}



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net