![]() |
CMarkupTreeCtrl problem |
Post Reply ![]() |
Author | |
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() 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/
|
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
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/
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
yes its almost same as http://forum.codejock.com/forum_posts.asp?TID=14704
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
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 :(
|
|
![]() |
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 |