Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPTreeCtrl drawing bug
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPTreeCtrl drawing bug

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


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Topic: CXTPTreeCtrl drawing bug
    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?
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 20 October 2008 at 3:07am
bump....
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: 20 October 2008 at 6:35am
Hi,
 
Guess its CTreeCtrl  thing. It calculates width using normal font.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post 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..
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 31 October 2008 at 7:35am
Create a sample for Oleg to debug...
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post 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.


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