Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Incorrect bounding box of CXTPPropertyGridItem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Incorrect bounding box of CXTPPropertyGridItem

 Post Reply Post Reply
Author
Message
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post Topic: Incorrect bounding box of CXTPPropertyGridItem
    Posted: 07 May 2007 at 8:02am
Hello,

I'd like to ask you if there is a reason why CXTPPropertyGridItem::OnDrawItemValue() and CXTPPropertyGridItem::GetValueRect() use different-height rectangles?

The documentation says:

virtual
BOOL OnDrawItemValue( CDC& dc, CRect rcValue);
    rcValue - Bounding rectangle of the item.

virtual CRect GetValueRect();
    Returns - A CRect object that represents the bounding rectangle of the item value's text.

So both rects should be a bounding box of the value part, shouldn't they?
However, in my override of CXTPPropertyGridItem class, in OnDrawItemValue() I get a height which is different from what GetValueRect() returns -- this makes my owner-drawn propertygrid items look strange (jumping one pixel up and down sometimes, according to some special actions I use).

Can you please explain why the rectangles are different?

Or is this simply a bug? Is there a solution for this (using XTP v11.1)?

Thank you, in advance!

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 07 May 2007 at 8:12am
Hello,
for OnDrawItemValue doesn't used bottom line.
 
you can add in your code
 
CRect rcBound(rcValue);
rcBound.bottom++;
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post Posted: 07 May 2007 at 8:15am
I see. And can I rely on that this line will be always exactly 1 pixel high - with all the different themes and styles a PropertyGrid can have?
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.