Print Page | Close Window

CMarkupTreeCtrl problem

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=15070
Printed Date: 19 April 2025 at 9:56pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CMarkupTreeCtrl problem
Posted By: znakeeye
Subject: CMarkupTreeCtrl problem
Date Posted: 28 August 2009 at 9:42am
XTP 13.1.
 
CMarkupTreeCtrl is owner-drawn. This means the width of the items is not set (since Windows does not draw it) which leads to a missing horizontal scrollbar. The control is not wide enough to show my items, and I have to make sure the tree control becomes aware of this and then shows a properly scaled horizontal scrollbar.
 
I've searched the whole net. Can't find information about this (which is odd).
 
Any ideas?


-------------
PokerMemento - http://www.pokermemento.com/



Replies:
Posted By: znakeeye
Date Posted: 28 August 2009 at 10:30am
Solved it!
 
Replacing your "NULL" with the actual text of the item does the trick. Windows seems to calculate the widths upon the InsertItem call!
 
---------------------------------------------------------------------------
CString GetInnerText(CXTPMarkupObject* pParent);
 
HTREEITEM CMarkupTreeCtrl::AddItem(LPCTSTR lpszItem, int nImage, int nSelectedImage, HTREEITEM hParent/* = TVI_ROOT*/, HTREEITEM hInsertAfter/* = TVI_LAST*/)
{
    CXTPMarkupUIElement* pUIElement = Parse(lpszItem);
   
    HTREEITEM hItem;
    if (pUIElement)
    {
        hItem = InsertItem(GetInnerText(pUIElement), nImage, nSelectedImage, hParent, hInsertAfter);
        SetItemData(hItem, (DWORD_PTR)pUIElement);
    }
    else
    {
        hItem = InsertItem(lpszItem, nImage, nSelectedImage, hParent, hInsertAfter);
    }
    return hItem;
}
 


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: Oleg
Date Posted: 31 August 2009 at 8:07am
Hi,
 
yes its almost same as http://forum.codejock.com/forum_posts.asp?TID=14704&KW=CMarkupTreeCtrl - http://forum.codejock.com/forum_posts.asp?TID=14704


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


Posted By: znakeeye
Date Posted: 02 September 2009 at 3:01am
Yeah, but what happens if you have a different font in the markup? Then the width will not match, right?
 
In general, I think the native Windows tree control is a disaster :(



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