CXTPTreeCtrl drawing bug |
Post Reply |
Author | |
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
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? |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
bump....
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Guess its CTreeCtrl thing. It calculates width using normal font.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
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. |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
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.. |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Create a sample for Oleg to debug...
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
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. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |