Print Page | Close Window

CXTPTreeCtrl - HasLines = doesn't

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=21640
Printed Date: 25 April 2024 at 1:01pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPTreeCtrl - HasLines = doesn't
Posted By: Algae
Subject: CXTPTreeCtrl - HasLines = doesn't
Date Posted: 09 May 2013 at 6:37pm
v. 16.1

Latest CXTPTreeCtrl doesn't seem to accept styles.

Try adding TVS_HASLINES|TVS_LINESATROOT and nothing happens. Worked in v. 15.3.1.

Am I missing something?





Replies:
Posted By: ilya
Date Posted: 31 May 2013 at 1:42pm
This is a known issue, it's been recorded in the internal bug tracking system and will be solved


Posted By: prekopj
Date Posted: 26 June 2013 at 6:56am
I have version 16.2.0 but this problem is not corrected. When will be fixed?


Posted By: jbriguet
Date Posted: 27 June 2013 at 3:53am
See here :  http://forum.codejock.com/forum_posts.asp?TID=21628&title=solved-161-tree-control-lines-not-visible" rel="nofollow - http://forum.codejock.com/forum_posts.asp?TID=21628&title=solved-161-tree-control-lines-not-visible


Posted By: Marco1
Date Posted: 28 June 2013 at 11:30am
I can confirm this.
In 15.3.1:

No code changed, in 16.2.0:

... and as you can see, the space for the icons in 16.2.0 is too small, too.
Please fix and test both bugs. Thanx!



-------------
Product: XTP 18.3.0 on VS 2017
Platform: VS 2017 / Windows 10 (64bit)


Posted By: ilya
Date Posted: 29 June 2013 at 1:18am
Treelines are fixed in 16.2.1

Please attach a sample project to illustrate icons spacing issue 


Posted By: Algae
Date Posted: 08 August 2013 at 9:14pm
Lines (and icons) are STILL not working in version 16.2.3

Try it:

DWORD dwStyle =  WS_VISIBLE|TVS_HASLINES|TVS_LINESATROOT|TVS_TRACKSELECT|TVS_HASBUTTONS|TVS_SHOWSELALWAYS|TVS_FULLROWSELECT;

if (m_treeCtrl.Create(dwStyle, CRect(0,0,0,0), this, IDC_TREE))
{
        GetTreeCtrl().SetItemHeight(26);
}

In the treectrl demo where lines are set by dialog resource it appears OK. Create fails.

Build Unicode Debug Static
VS 2010
Win 7 Pro


Posted By: Algae
Date Posted: 11 August 2013 at 2:58pm
Kludge fix for version 16.2.3 -

As a temporary solution I replaced XTPTreeBase.cpp with the one from version 15.3.1. With this change, the tree control appears to perform as expected.


Posted By: roan98dk
Date Posted: 14 August 2013 at 3:08pm
I have a perhaps related issue with a CXTPTreeCtrl using TVS_CHECKBOXES and no images. In 15.3.1 it worked fine, but in 16.2.3 I can only get TVS_CHECKBOXES to work if I also add images to all nodes, but that is not what I want.

Perhaps it was an error in the old version. At least I noticed in my old code that I actually loaded images for all nodes, but the CImageList creation failed (corresponding to a nullptr being assigned to SetImageList).

15.3.1 with TVS_CHECKBOXES and nullptr in SetImageList

16.2.3 with TVS_CHECKBOXES and nullptr in SetImageList


Maybe it is my understanding that is wrong, but is it not supposed to be possible to have checkboxes without images on all nodes? It looks ridiculous with both checkboxes and images.


Posted By: grudy
Date Posted: 06 November 2013 at 9:48am
I just built with 16.2.4 and still have problems with the tree control... because of these we have been stuck on 15.3.1 for quite awhile.  In my case I have check boxes on some items, but not on all. As you can see from the picture below, it kind of looks like there is space being left for check boxes on all items. For some reason this draws the Tree lines and the expand/collapse boxes too far left. In fact, it is just the drawing though... to actually make the expand/collapse boxes work, you have to click in the empty space where they should be! 
 
I can't say strongly enough that we need this fixed. We reall need to get back to the same proper behavior that was in 15.3.1



Posted By: Algae
Date Posted: 29 January 2014 at 7:10pm
This is still clobbered in 16.2.6

Replacing XTPTreeBase.cpp with version 15.3.1 still corrects the problems.

Is there an official fix on the horizon?

Do the CJ folks need 15.3.1 XTPTreeBase.cpp to compare? I could upload to you if you've lost it from SourceSafe or whatever source control you use.

If it were me, I would start all over from 15.3.1 and add new material from that as a clean starting point taking care that none of the functionality gets trashed. It would be a lot easier than trying to kludge together a fix to the existing broken code.

Even rolling it back would be preferable to the unusable state it's in now.


Posted By: MrFelix
Date Posted: 07 February 2014 at 7:40am
In 16.3.0 that we've updated today this problem is fixed and lines are now supported. But there is some small trouble with state icons: Situation is we are having a dialog with a simple tree control containing items with child items and having lines. A state imagelist is assigned to the control and items can have a state image or not. When the dialog is opened there are lot of asserts because there are no valid item rectangles available. Looking at CXTPTreeBase::DrawItemIcons() the function must return immediately when GetItemRect() returns FALSE. In the same function when calculating rcStateIcon the X offset (nIconIdent + nStateImageSize) is applied twice with calls to OffsetRect(), resulting in overlapped expand/collapse/state images.

You should check these fixes for 16.3.1.


Posted By: Algae
Date Posted: 20 February 2014 at 4:40pm
CJ please fix!

*Trying to make the current "theme" work for tree controls is a noble effort. While it is getting closer you can see it is still unusable.

15.3.1 Library captures.

Example 1 - Spacing of item icons and text is correct.



Example 2 - Position of expand/collapse buttons and line at root are correct.



16.3 Library captures.

Example 1 - Note that the item icon widths are not handled correctly. The text overwrites.



Example 2 - Note that the check boxes disregard the presence of the expand/collapse icons.



Code snippet to create Example 1:

void CMyTree::SetExplorerStyle()
{
    if (XTPSystemVersion()->IsWinVistaOrGreater())
    {
        if (!GetTreeCtrl().GetSafeHwnd())
            return;

        SetWindowTheme(GetTreeCtrl().GetSafeHwnd(), L"explorer", NULL);

        GetTreeCtrl().ModifyStyle(TVS_HASLINES, 0);

        DWORD dwExStyle = 0x0004; // TVS_EX_DOUBLEBUFFER;
           
        ::SendMessage(GetTreeCtrl().GetSafeHwnd(), TVM_SETEXTENDEDSTYLE, (WPARAM)dwExStyle, (LPARAM)dwExStyle);
    }
}
int CMyTree::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    int result = -1;

DWORD dwStyle =  WS_VISIBLE|TVS_HASLINES|TVS_LINESATROOT|TVS_TRACKSELECT|TVS_HASBUTTONS|TVS_SHOWSELALWAYS|TVS_FULLROWSELECT; // TVS_SINGLEEXPAND| // single key expand

    if (m_treeCtrl.Create(dwStyle, CRect(0,0,0,0), this, IDC_TREE))
    {
        SetExplorerStyle();

        GetTreeCtrl().SetItemHeight(26);
        m_filter = -1;
        m_subfilter = -1;
        result = 0;
    }
.... etc.

Tree control properties for example 2.




Posted By: Felipe
Date Posted: 26 February 2014 at 3:57am
We had the same problem. We are now using finally 16.3.0 after doing the following modification in XTPTreeBase.cpp. It solved our case, though I presume it is not a general solution. I look forward to a final fix from codejock:

Before:
                rcStateIcon.top -= 1; // ?

                rcStateIcon.OffsetRect( -(nIconIdent + nStateImageSize), 0);

After
                //rcStateIcon.top -= 1; // ?

                rcStateIcon.OffsetRect( -(nIconIdent + nStateImageSize) + 3, 0);


Posted By: Norika
Date Posted: 11 December 2014 at 11:45pm
Where I was also updated to 16.4.0, I encountered this problem that check box is not displayed.

Although check box reblogged modify and recompile to be displayed correctly in immediately change the control of the theme, I would like to fundamental solution.


Posted By: mcmastl
Date Posted: 16 April 2015 at 12:46pm
We have informed our development team of the issue and will be looking into it.  Thank you for bringing this to our attention.  If the issue has been resolved please let us know.  

-------------
Luke McMasters, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Algae
Date Posted: 22 February 2016 at 2:24pm
v. 17.1 - still problems with tree control.

The placement of lines/icons/objects etc. is improved, but there is little control over skinning.

For instance, if you don't want to use skinned expand/collapse buttons (in my case I'd like to use "explorer" type deltas regardless of skin for consistent appearance, there is no way to do so.

Changing the skin always changes the control skinning regardless of programmed setting.

Is there another way around this or an update planned soon that allows this capability (skin or not skin, skin everything except buttons)?


Posted By: Marco1
Date Posted: 09 March 2016 at 3:48am
The vertical lines are still not centered, if the icons are bigger than normal.
This was working fine up to 15.3.1, broken in 16 and 17.1.0, too. I already reported this.
Please, finally get this fixed!!!





-------------
Product: XTP 18.3.0 on VS 2017
Platform: VS 2017 / Windows 10 (64bit)


Posted By: Algae
Date Posted: 30 May 2016 at 2:33pm
In addition to bad line placement as noted in previous posts, triangle selection buttons are still unresolved.

Static or DLL doesn't seem to matter.

CJ Vers: 15.3.1 vs 17.2.0
Sample: GUI_Explorer
OS: Vista+. For my test I used Win 7.

Compare:

1. Build using v15.3.1 XTPTreeBase.cpp/h from I think.. 2012!!!  You will see normal tree control triangles.

2. Build using v17.2.0 XTPTreeBase.cpp/h. Tree control triangles are not shown. [+] buttons are.

Anything using TreeBase fails.

This is unusable and has been for years. Cry


Posted By: agontarenko
Date Posted: 07 June 2016 at 11:09am
Hello,

I'm glad to inform you that the issue (vertical lines are still not centered, if the icons are bigger than normal) has been fixed. The fix will be available in the next beta or final release.

Regards,
Artem Gontarenko


Posted By: cpede
Date Posted: 10 February 2017 at 7:34am
In the VisualStudio IDE Sample I get wrong spaces between expand/collapse icons when removing the TVS_LINESATROOT flag.

case themeVS2010:
m_wndClassView.SetTheme(xtpControlThemeVisualStudio2010);
m_wndClassView.ModifyStyle(TVS_HASLINES, 0);
m_wndClassView.ModifyStyle(TVS_LINESATROOT, 0);



Please confirm that this is also fixed.

-cpede


-------------
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)


Posted By: agontarenko
Date Posted: 11 February 2017 at 2:48pm
Hello cpede,

With next release will be fixed many bugs of CXTPTreeCtrl (this bug was fixed too).
Also was added DPI scaling of tree icons. Please wait for release.

Regards,
Artem Gontarenko


Posted By: cpede
Date Posted: 12 February 2017 at 6:25am
Sounds great, remember to  add option to enable/disable DPI scaling of icons, so we don't get the bad situation like with button icons which are awfully scaled, and we can't turn it off.

We still hope for SVG format support one day :-)

-cpede


-------------
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)


Posted By: mgampi
Date Posted: 31 March 2017 at 12:40pm
Hi;

Using 17.3.0 I have strange lines appearing; most of them are interrupted when I use state icons too!

See the screenshot below:




Will this be fixed soon? When can we get an update for this?


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: agontarenko
Date Posted: 12 April 2017 at 9:00am
Hello Martin,

You use state icons only for leaf items and for node items not. It's right? In this way you have this problem?

Regards
Gontarenko Artem


Posted By: mgampi
Date Posted: 12 April 2017 at 9:40am
Originally posted by agontarenko agontarenko wrote:

Hello Martin,

You use state icons only for leaf items and for node items not. It's right? In this way you have this problem?

Regards
Gontarenko Artem


YES!


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: agontarenko
Date Posted: 12 April 2017 at 10:33am
Could you please share you sample or modify our sample as for reproduce this bug?
I need to debug it.

Regards
Gontarenko Artem


Posted By: mgampi
Date Posted: 13 April 2017 at 3:11am
Originally posted by agontarenko agontarenko wrote:

Could you please share you sample or modify our sample as for reproduce this bug?
I need to debug it.

Regards
Gontarenko Artem

I'll try to generate a small sample, but it will take time...


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: agontarenko
Date Posted: 04 May 2017 at 9:40am
Hello Martin,

I think, I have question from another user, look please this post
http://forum.codejock.com/forum_posts.asp?TID=23295&PID=75768&#75768
if this bug really same then this has been already fixed in version 18.0

Regards,
Gontarenko Artem


Posted By: mgampi
Date Posted: 04 May 2017 at 9:52am
Perhaps it's the same?

I'll wait for the update and check it then.


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: agontarenko
Date Posted: 04 May 2017 at 9:54am
Look please pdf file in post http://forum.codejock.com/forum_posts.asp?TID=23295



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