Print Page | Close Window

CXTPTreeCtrl drawing bug

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=12420
Printed Date: 27 September 2024 at 7:27pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPTreeCtrl drawing bug
Posted By: adrien
Subject: CXTPTreeCtrl drawing bug
Date Posted: 13 October 2008 at 6:37am
I've got a CXTPTreeCtrl which I use for a navigation menu.

It's embedded inside a docking pane.

All is good until I set one of the labels to be bold.

As soon as I do that, the list control thinks its width is the whole screen width (or thereabouts), and I get a horizontal scrollbar, with the scroll dragger only about 8px wide.

If I set the label back, it doesn't fix it.

I've actually also seen this with a straight CTreeCtrl inside a docking pane.

I'm not sure therefore if it's a problem with the ctrl, or the docking pane?

-------------
http://www.wingate.com - http://www.wingate.com



Replies:
Posted By: adrien
Date Posted: 20 October 2008 at 3:07am
bump....

-------------
http://www.wingate.com - http://www.wingate.com


Posted By: Oleg
Date Posted: 20 October 2008 at 6:35am
Hi,
 
Guess its CTreeCtrl  thing. It calculates width using normal font.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: adrien
Date Posted: 20 October 2008 at 8:42pm
Hi Oleg

I think it's something to do with being inside a Pane, and how sizes are updated.

It doesn't happen in the tree control sample.

even if it were using the wrong font to calculate width, that wouldn't put the width out by a factor of about 20.

The thing thinks it's width is my entire screen width.

-------------
http://www.wingate.com - http://www.wingate.com


Posted By: adrien
Date Posted: 31 October 2008 at 1:11am
bump again.

I think this is an issue with being inside a pane.

the width that the client area of the pane (e.g. width of tree ctrl) gets set to is the width of my screen.

I've got 3 monitors, the width of the tree ctrl gets set to 4800px.

This doesn't happen if the tree ctrl is not inside a pane..

-------------
http://www.wingate.com - http://www.wingate.com


Posted By: znakeeye
Date Posted: 31 October 2008 at 7:35am
Create a sample for Oleg to debug...


Posted By: adrien
Date Posted: 03 November 2008 at 5:30pm
I found the problem.

My code was highlighting a path in the tree back to the root node,by setting the item bold and red. My tree was only 2 levels deep, but it was calling into SetItemBold 3 times.

Turns out my recursive code was calling SetItemBold and SetItemColor on the root of the tree ctrl as well (TVI_ROOT). This messes up the width of the control completely.

Taking out that last call fixed the problem. don't know if this problem is a known issue with custom ctl tree control or not, but I couldn't find any evidence to support my earlier theory that it was codejock issue.




-------------
http://www.wingate.com - http://www.wingate.com



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