Originally posted by: Dan Winkler
You can let DrawText do the elipses work for you by setting the style DT_END_ELLIPSIS.
So in the DrawItemText function you can take out all of the string management and just put in the following lines before the call to DrawText.
nStyle |= DT_END_ELLIPSIS;
Reply
Originally posted by: Martin Gagnon
- Is it possible to edit the content ("label") of the
- How come the application crashes when calling New File or
Thanks in advance,
Sincerely,
Martin Gagnon
I'm a relatively newcomer to the rather complex world of
building applications with Microsoft's MFC, and I'd like to
thank M. Lantsman for the Multi-column tree control. I've
been studying and modifying parts of it, but there are some
questions for which I haven't found any answers yet. So,
I'm turning to you and your experience with the hope you might give me some pieces of advice. Here are the
questions:
columns in the tree ?
I've tried some things, like using the Set_Editable option
in the Create call for the tree, but nothing happens upon
execution...
Open File ?
The crash comes in upon the call to SubclassDlgItem in the
OnInitialUpdate function of CTreeListView.
It's a if some element should have been deleted before the
new document is created, but wasn't...
Computer Sciences Student
Computer Vision and Systems Laboratory
Universit� Laval, Qu�bec, Canada
Originally posted by: Ron
Hi:
I've implemented this control in my MFC app and it works fine, but I'd also like to implement flicker free drawing - as all the other controls in my app have. I have consulted the <a href=http://codeguru.earthweb.com/controls/flicker_free_3.shtml>;article on the CMemDC class</a> by Thomas Jansen but so far my attempts to implement CMemDC have been unsuccessful; when resizing the view the control still flickers.
Has anyone successfully implemented flickerfree drawing for the CNewTreeListCtrl? How is it done? Thanks in advance.
Ron
Reply
Originally posted by: Jacky
How to move item or branch in Multi column tree control?
I test many method,but it can not success.
In Multi column tree control "onBeginDrag" can't active.
Could you tell me any method ??
Reply
Originally posted by: Ron
First of all: great control - as far as I know, it's the best treelist ctrl available on the net.
I was just a little annoyed by the 'double' sunken border that appeared when using the CNewTreeListCtrl in a CFormView-derived class. The solution was to remove the WS_BORDER style from the (empty) dialog used as the CFormView's template dlg; so instead, use an empty dlg with no WS_BORDER or WS_EX_CLIENTEDGE etc.
Reply
Originally posted by: Gary Lewis
If anyone wants the code for a CTreeListCtrl in a CView instead of a dialog then I will send it to them.
ReplyOriginally posted by: Alexander Sailer
BOOL CNewTreeListCtrl::DeleteSubItems( HTREEITEM hItem )
while(ItemHasChildren(hItem)){
Gru� Alex
I detected a memleak when I deleted a subitem in the tree that have subitems too.
The fix is to make the method recursive:
{
HTREEITEM hChild(0);
BOOL bRet(false), bErr(false);
hChild = GetChildItem(hItem);
if (ItemHasChildren(hChild)){
DeleteSubItems(hChild);
}
bRet = DeleteItem(hChild);
if (!bRet){
bErr = true;
}
}
return bErr;
}
Originally posted by: Greg Clayton
The InsertItem and SetSubstring class both take a
CString by value. Changing these calls to take
LPCTSTR's may be a viable option.
The effect is a CString is copied or constructed on the
way in to either function (which when InsertItem is
being called the string first gets constructed and then
when it calls SetSubstring is constructs yet another
copy of that CString).
Changes in NewTreeListCtrl.h/cpp:
void SetSubstring(int m_nSub, LPCTSTR m_sText);
void InsertItem(LPCTSTR m_sText) { SetSubstring(0.
m_sText); };
Reply
Originally posted by: Ionut Dogarel
Now I want to have different classes derived from the same tree control, but I have problems on registering.
There is somthing like this:
void CTLFrame::RegisterClass()
if (!::RegisterClass(&wc))
So, if the class is already registered, ::RegisterClass() will fail and asserts.
void CTLFrame::RegisterClass()
if( !::RegisterClass(&wc) &&
I don't know if this is the best solution.
Ionut Dogarel
Firstly, thanks again for your good work!
I am using your tree control extensively in my application and is working fine!
{
...............
{
ASSERT(FALSE);
}
}
I changed the code like this:
{
...............
GetLastError() != ERROR_CLASS_ALREADY_EXISTS )
{
ASSERT(FALSE);
}
}
If somebody can find something better please share it!
Originally posted by: Alexander Sailer
Thanks in advance
I want to reach the TLC in my DialogBox with the TAB-key and I'm not able to do this.
Is there anyone who has tried?
Alex