Print Page | Close Window

[SOLVED] 16.1 Tree Control lines not visible

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
Printed Date: 18 October 2019 at 5:28pm

Topic: [SOLVED] 16.1 Tree Control lines not visible
Posted By: MacW
Subject: [SOLVED] 16.1 Tree Control lines not visible
Date Posted: 04 May 2013 at 4:01am
After migrating to version 16.1 of Toolkit Pro, tree controls based on CXTPTreeCtrl don't show any lines, even if the TVS_HASLINES and TVS_LINESATROOT are set in the resource or the derived class.

I see this behavior in my app, and also, for example, in the CodeJock Tree Control Sample.
Sometimes, when clicking in the tree where the [+] icon usually is, the [+] icon shows up, but the next tree redraw hides them again. Lines are never shown.

Platform: Visual C++ 2012, Windows 7 SP1, 32-Bit. XTP 16.1

Posted By: MacW
Date Posted: 06 May 2013 at 3:07am
Some further info.
In XTPTreeBase.cpp is an ominous global variable

static BOOL g_bDefaultIconsDrawing = FALSE;

when I set this to TRUE in the debugger, the DoPaint method of the XTPCotnrol calls

m_pTreeCtrl->DefWindowProc(WM_PAINT, (WPARAM)memDC.m_hDC, 0);

and the [+] and [-] icons and the tree lines are back!!!

Has anything changed with the way we need to initialize tree controls in 16.1?
Some new 'Theme' method we must call or anything to make this work.

Since this also fails in your samples, can you please have a look. We need to ship our product and we need to decide whether or not be ship XTP 16 or the older version.

Posted By: ABuenger
Date Posted: 24 May 2013 at 10:13am
Hello, this has been fixed for the next release.

Codejock support

Posted By: MacW
Date Posted: 24 May 2013 at 12:38pm
Great Smile !

Posted By: SuperMario
Date Posted: 19 June 2013 at 2:55pm

Posted By: MrFelix
Date Posted: 20 June 2013 at 7:49am
Sorry guys, tested a few minutes ago with latest 16.2.0, the problem is still present. Only calling CXTPTreeBase::DoPaint with bInternal == FALSE shows the lines. Your code does not handle TVS_HASLINES or TVS_LINESATROOT. Either handle and draw it or call the default window procedure.

I'll try to get a solution for me comparing to the sources of 15.3.1 until this problem is fixed within a future release of the toolkit.

Posted By: prekopj
Date Posted: 28 June 2013 at 5:59am
I compared source code for version 15.3.1 and 16.2.0.

I made one change - file XTPTreeBase.cpp on line 1054:

m_pTreeCtrl->DefWindowProc(WM_PAINT, (WPARAM)memDC.m_hDC, 0);

// Now let the window do its default painting...
if (!bInternal)
//m_pTreeCtrl->DefWindowProc(WM_PAINT, (WPARAM)memDC.m_hDC, 0);

and result:

Print Page | Close Window