![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Thanks Erel...
Your help has been precious ... One future problem in this project... How are the node indexed? Imagins this tr Defaut.INI | +-[Categoty01] |XXX| |XXX+-Key02 |XXX+'Coment04 | +-[Category02] XXXX| XXXX+Key01 Key01 was of course created before key02, but key02 is "read" before key01... is the index automatically corrected, an the index of key02 is lower than index of key01, or will I need to make sure to read in the correct order?
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
||||
|
Thanks, I rhink I understand....
I nedd to first catch the cat index related to the root and then catch the other nodes related to the categories.... cool....some cicles comming up....
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
||||
|
Once more I need guidance working with the treeview...
I nedd to read a file(.INI) and, acording with some StrAt values, create the appropiate levels and sub-levels of the treeview nodes... I have been to the point of being able to read and create all the read nodes, but all at the same level... When i read an INI file, if it is a complex one, I have to be able to create the sub-levels, but how...I keep getting an error of "invalid reference " or whatever.. Example Treeview result : +Default.INI |--Key01 |--Comment01 +-Category01 XX|-Key02 XX|-Comment02 +-Category02 XX|-Key03 XX|-Comment03 INI File: Key01 'Comment01 [Category01] Key02 'Comment02 [Category02] Key03 'Comment03
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
||||
|
TreeView should be a more straight-foward, easy to understand control...
My current app, is based on this control, and i should have finish it a few weeks ago, but the vacations got in the way, along with some yet to resolve issues... Now back to work, I need to clear some doubts... Imagine this tree: +Default.INI |--Key01 |--Key02 |--Key03 |--Key04 |--Comment01 +-Category01 XX|-Key05 XX|-Comment02 +-Category02 XX|-Key06 XX|-Comment03 Now let's say I want to move The node "Comment01" up by 2 positions, to setle in beetwen of "Key02" and "Key03".. I tryed to get the index of the selected node, as one must first select the node to be moved , but i keep getting a value of -1...This is teh code and its variants I've used just to get the index of the selected node... Code:
Index = Node.IndexOfNode(Tree.SelectedNode) Index = Tree.IndexOfNode(Node.value) My tree wil be no deeper that 2 levels... Please HELP
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
||||
|
Hello Cableguy,
I followed this thread for a while so after I finished my actual project now I uploaded my ToDoTree application here: ToDoTree Application I think this could be a good demo for you showing how I solved the (little) problems I got dealing with the treeview... ![]() Some comments in the program are still in german but it shouldn't be difficult "read" my application. And of course feel free to ask futher questions if you need more explanation to the code... specci48 |
|
||||
|
Going Back to Erel's example, I was able to deternime the Level of the selected node....
And I am able to determine the index of level 1 nodes....But not level 2...What am I missing???? Code:
If Node.IsRoot Then Parent.Value = Node.Value Else Parent.Value = Node.Parent End If Level = 1 Do While Not(Parent.IsRoot) level = level + 1 Parent.Value = Parent.Parent Loop MsgBox(level) 'Tels me the level of the selected Node, wich can be 1 or 2... If Level = 1 Then Index = Parent.IndexOfNode(TreeView.SelectedNode)'This works and I do get the index of the selected node on level 1 Else If Level = 2 Index = Node.IndexOfNode(TreeView.SelectedNode)'Can't Figure out how to get the index for level 2 nodes End If Msgbox(Index)'Level 2 nodes alway return -1 values
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing Last edited by Cableguy : 07-19-2008 at 12:11 PM. |
|
||||
|
Well, as most of the time happens, I end up answering my own question, simple because i keep trying to squeeze the answers from my code...
SO, I got it working with lesser code than i could Imagine... Code:
If Node.IsRoot Then Return Parent.Value = Node.Parent Index = Parent.IndexOfNode(TreeView.SelectedNode) If Index <= 0 Then Return Parent.RemoveNodeAt(Index) Parent.InsertNode(Index - 1,Node.Value)
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Another problem with tree view | RandomCoder | Questions & Help Needed | 8 | 02-28-2008 12:36 PM |
| Registry to Tree View | willisgt | Questions & Help Needed | 0 | 02-20-2008 05:17 PM |
| Context Menu and Tree View. | RandomCoder | Questions & Help Needed | 4 | 02-18-2008 05:35 PM |
| Can´t view whole Website with PPC Browser | Smurfy2000 | Forum Discussion | 3 | 02-13-2008 09:08 AM |
| Tree View Images | RandomCoder | Questions & Help Needed | 8 | 02-08-2008 05:16 PM |