How to not draw focus rect for readonly items |
Post Reply |
Author | |
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
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 |
|
idler
Groupie Joined: 11 July 2007 Location: Russian Federation Status: Offline Points: 11 |
Post Options
Thanks(0)
|
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);} } } |
|
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 |