Print Page | Close Window

Incorrect bounding box of CXTPPropertyGridItem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=7059
Printed Date: 22 November 2024 at 4:49pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Incorrect bounding box of CXTPPropertyGridItem
Posted By: akur
Subject: Incorrect bounding box of CXTPPropertyGridItem
Date 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);
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!




Replies:
Posted By: Oleg
Date 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


Posted By: akur
Date 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?



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