Perfect Job! I'm very appreciated with this kind of contribution. But I have a question: If I want to use this code in my commericial product, is there any problem?
You can use the code, and change the source code. But if you use the code, you must publish the source code of your commercial application too. Note: The current source on codeguru have some bugs. Here are the newest vesion. PS: The programmer of the "TreeListControl" will be very happy if he gets some donations. Perhaps the software company gets then an own version of the source and some support ;-).
ReplyA new source was uploaded on 17.Mar.2007. Please check the date of the article before you download the sources.
ReplyOK, after playing with this for a day, I found a few bugs:
1. SetItem() with an empty string "" crashes. Fixed by commenting out this line in TreeListWnd.cpp:
if(uLen>pExtra->uTextSize)
2. Adding > 64 items causes a crash. Fixed (kludged) in TreeListWnd.cpp by changing grow size to a huge number:
uMax += 64; --> uMax += 5000;
3. Infinite loop in TreeListInsertItem() here:
for(;;uPos++)
{
if(uPos>pData->uTreeItemsMax)
break; //uPos=1; // RJP
fixed (kludged) by adding a "break" instead of uPos=1.
4. HitText() and EnsureVisible() both cause a crash.
Bogus ptr to TV_HITTESTINFO, looks like ordinal hItem is passed instead?
Not sure how to fix this...
5. Couldn't get TVCFMT_RIGHT (or LVCFMT_RIGHT) to work --
columns never right-justify.
6. I was unclear on using the BOLD style -- seems like it doesn't work
if you call SetItem() to add another item after using BOLD?
Reply
This is very well done. I had one problem with the +/- expand buttons on tree nodes, which always showed as + even when expanded. To fix, I commented this out in TreeListWnd.cpp: || (uBits&TVIS_EXPANDPARTIAL))
OK, after playing with this for a day, I found a few bugs:
1. SetItem() with an empty string "" crashes. Fixed by commenting out this line in TreeListWnd.cpp:
if(uLen>pExtra->uTextSize)
2. Adding > 64 items causes a crash. Fixed (kludged) in TreeListWnd.cpp by changing grow size to a huge number:
uMax += 64; --> uMax += 5000;
3. Infinite loop in TreeListInsertItem() here:
for(;;uPos++)
{
if(uPos>pData->uTreeItemsMax)
break; //uPos=1; // RJP
fixed (kludged) by adding a "break" instead of uPos=1.
4. HitText() and EnsureVisible() both cause a crash. Bogus ptr to TV_HITTESTINFO, looks like ordinal hItem is passed instead?
Not sure how to fix this...
Reply