Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - How to not draw focus rect for readonly items
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to not draw focus rect for readonly items

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: How to not draw focus rect for readonly items
    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 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
idler View Drop Down
Groupie
Groupie


Joined: 11 July 2007
Location: Russian Federation
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote idler Quote  Post ReplyReply Direct Link To This Post 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);

}

}

}
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.