Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Avoiding Report Row Selection Color
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Avoiding Report Row Selection Color

 Post Reply Post Reply
Author
Message
robosport View Drop Down
Groupie
Groupie


Joined: 20 June 2005
Location: United States
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote robosport Quote  Post ReplyReply Direct Link To This Post Topic: Avoiding Report Row Selection Color
    Posted: 14 July 2005 at 2:28pm

Is there a way to block the report control from changing a selected row's background color when a user clicks on the row?

Basically I want the report control to look as if no row can be selected.

Thank you.

 

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 14 July 2005 at 3:51pm

try

GetPaintManager()->m_clrHighlight = 0xFFFFFF

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
robosport View Drop Down
Groupie
Groupie


Joined: 20 June 2005
Location: United States
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote robosport Quote  Post ReplyReply Direct Link To This Post Posted: 14 July 2005 at 4:04pm

That is close to what I need. Unfortunately the group record items are one color and the child record items are using a ledger (alternating) color scheme.

You solution changes the color for each record item to the same color. Is there a way to get the record item background color prior to drawing the highlight?

I tried for the OnReportItemLClick for the Report Control but it gets called after the highlight is drawn.

Thank you.

 

Back to Top
robosport View Drop Down
Groupie
Groupie


Joined: 20 June 2005
Location: United States
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote robosport Quote  Post ReplyReply Direct Link To This Post Posted: 14 July 2005 at 4:29pm

I made a custom CXTPReportRecordItemText derived class that stores the background color. And I implemented an overridden Draw function that simply calls the control's GetPaintManager and sets the appropriate background color before calling the original CXTPReportRecordItemText::Draw function. That correctly kept the background color from changing.

Unfortunately the selected items text color changes to white and now that the background color is correct I can see a focus box being drawn around the item. Both of which I need to eliminate in order to make it look like the row is not being selected.

Any other ideas? Thanks again.

 



Edited by robosport
Back to Top
robosport View Drop Down
Groupie
Groupie


Joined: 20 June 2005
Location: United States
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote robosport Quote  Post ReplyReply Direct Link To This Post Posted: 14 July 2005 at 4:44pm
I fixed the highlight text color using the same type of solution and setting m_clrHighlightText, but I have not found a way to eliminate the focus outline box.

Edited by robosport
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 15 July 2005 at 12:29am

You can override

virtual void CXTPReportPaintManager::DrawFocusedRow(CDC* pDC, CRect rcRow);

and do nothing in it.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
robosport View Drop Down
Groupie
Groupie


Joined: 20 June 2005
Location: United States
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote robosport Quote  Post ReplyReply Direct Link To This Post Posted: 15 July 2005 at 10:31am

Perfect! Thank you!

Now that I've been digging around in this code for a couple weeks I'm starting to see the big picture on how it all works.

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.063 seconds.