|
-
Jun 9th, 2010, 10:53 PM
#1
Thread Starter
Stack Overflow moderator
-
Jun 10th, 2010, 03:10 AM
#2
Re: [WIP] TreeList Control
The awkward node constructor is not required. The TreeListNodeCollection already has a reference to the parent TreeList, so can't you just set the parent of each node when it is added, in the Add method?
Also, you can add the same node to the TreeList multiple times. I don't know if that is desirable (it could be I suppose), but right now all instances of the same node will be expanded/collapsed and selected at the same time. That is a bit strange I think. Not sure how you could handle that though, except not allowing the same item to be added twice.
-
Jun 10th, 2010, 02:29 PM
#3
Thread Starter
Stack Overflow moderator
Re: [WIP] TreeList Control
No, I know, and that's on purpose. Don't you think it's useful? It's also why I implemented ICloneable. I considered it a feature, not a bug! 
A big problem, though, is making a node its own parent, or making its parent its child. I'm having trouble figuring that one out, but I think I'll just let it slide for now. It's not a priority.
Yeah, modifying the TreeListNode collection is the next thing I'll do. I'm going to change it to be event-based, too, to give it less awkwardness, to give it more versatility, and to make it designable.
Finally, I'm going to add scroll bars (easy), arrows (easy), and I'm going to merge the Designer file with the code file because the designer file is useless. Coming soon!
-
Jun 10th, 2010, 02:53 PM
#4
Thread Starter
Stack Overflow moderator
Re: [WIP] TreeList Control
-
Jun 10th, 2010, 02:54 PM
#5
Re: [WIP] TreeList Control
I see. I can't think of any use for having the same node twice and having it mirror whatever you do to the other node, but someone else might so I suppose it's not a problem.
For the collection, why not inherit System.Collections.ObjectModel.Collection(Of TreeListNode) instead? For default implementation, you won't even need to implement or override anything, and it will behave like a strongly typed collection automatically. If you want, you can override four methods (SetItem, RemoveItem, ClearItems and InsertItem I believe) to do some extra stuff, like raising a 'collection changed' event.
-
Jun 10th, 2010, 05:26 PM
#6
Thread Starter
Stack Overflow moderator
Re: [WIP] TreeList Control
... because I've already got code to implement IList(Of TreeListNode)?
I just thought of another set of bugs, and am in the process of resolving them. Please don't report bugs during this time.
EDIT: Set 2 of bugs resolved. Updated post. Unfortunately, it's in Linux format right now; you can use Notepad++ to convert it, and VS doesn't care.
Last edited by minitech; Jun 10th, 2010 at 05:32 PM.
-
Jun 10th, 2010, 08:36 PM
#7
Thread Starter
Stack Overflow moderator
Re: [WIP] TreeList Control
Unfortunately, making things this way made it much too complicated to get everything working properly and I am reverting back to a mix of versions 1 and 3.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|