kanber Posted August 3, 2009 Share Posted August 3, 2009 Hello, I am trying to do tree list. I write seq. like above. private i page.page_0.Component.TreeList.DeleteAllItems() for(i=0, i<9, i++) aux = page.page_0.Component.TreeList.InsertItem(i, 0, 0,i) endfor tree list like this; 1 2 3 4 5 6 7 8 but I want to do -0 a b c -1 d f g etc. How can I do? Link to comment Share on other sites More sharing options...
AzeoTech Posted August 3, 2009 Share Posted August 3, 2009 Unless you have the data in an array (which, depending on the app, I often recommend), you'll have to do it manually: component.treelist.insertItem("-0",0,0,0) component.treelist.insertItem("a",0,0,1) component.treelist.insertItem("b",0,0,2) etc. I believe the the last parameter, Data, must be an unsigned integer, thus the reason I recommend putting the data in an array: private treedata = {"-0","a","b",...} for (private i = 0, i < numrows(treedata), i++ page.page_0.Component.TreeList.InsertItem(treedata[i], 0, 0, i) endfor Its not bad when you want a single level treelist, which is basically just a list. When you start actually creating a tree, it gets more complicated and you need to use more advanced structures to track everything. This is, unfortunately, the challenge of treelists in general and why there isn't a fancy properties window for treelists. Link to comment Share on other sites More sharing options...
kanber Posted August 4, 2009 Author Share Posted August 4, 2009 I cant explain. I want to do +0 +1 +2 when I open "0" -0 a b c d +1 +2 like this Link to comment Share on other sites More sharing options...
kanber Posted August 4, 2009 Author Share Posted August 4, 2009 And How can I change text colour ? Link to comment Share on other sites More sharing options...
AzeoTech Posted August 4, 2009 Share Posted August 4, 2009 You can't change the text color. As for populating the tree list, is this going to be fixed data, or dynamic? Here's how you would do it fixed: private parent = page.page_0.Component.TreeList.InsertItem("0", 0, 0, 0) page.page_0.Component.TreeList.InsertItem("a", parent, 0, 0) page.page_0.Component.TreeList.InsertItem("b", parent, 0, 0) page.page_0.Component.TreeList.InsertItem("c", parent, 0, 0) parent = page.page_0.Component.TreeList.InsertItem("1", 0, 0, 0) page.page_0.Component.TreeList.InsertItem("d", parent, 0, 0) page.page_0.Component.TreeList.InsertItem("e", parent, 0, 0) page.page_0.Component.TreeList.InsertItem("f", parent, 0, 0) etc. Link to comment Share on other sites More sharing options...
kanber Posted August 5, 2009 Author Share Posted August 5, 2009 it is working thank you. but I cant see full name. up and down you can control tree list. but I cant go right and left on tree list. what can I do? beacuse I will put on left side in my project. and I dont have enough place for tree list. Can I change font size? one more question. I want to use same tree list maybe on twenty pages. but it is not workin in different page. I paste and copy to another page. it is defult values. What can I do? Link to comment Share on other sites More sharing options...
AzeoTech Posted August 5, 2009 Share Posted August 5, 2009 There is no right and left scroll. You will need to make the list wider, or use abbreviated names. If you want to use the tree on multiple pages, I would recommend putting it on its own page and overlaying that page with the other pages as we do in the AshlandWater sample. If you cut and paste, you will need to rename all the trees and duplicate all your population code. Link to comment Share on other sites More sharing options...
kanber Posted August 6, 2009 Author Share Posted August 6, 2009 But in tree list I can wirte code in "Double click event". here I cant use change page action. I am using page.strCurrentPage = "Page_2" command. what can I do? Link to comment Share on other sites More sharing options...
AzeoTech Posted August 6, 2009 Share Posted August 6, 2009 Why can't you change the page from the tree list? Link to comment Share on other sites More sharing options...
kanber Posted August 8, 2009 Author Share Posted August 8, 2009 I can change. but it is not working like the AshlandWater sample. because in this example you have a button. and with change page function you can do. but in tree list I have double click event and I cant you change page function. I must use "page.strCurrentPage = "Page_2"" how can I do like sample in tree list? Link to comment Share on other sites More sharing options...
kanber Posted August 8, 2009 Author Share Posted August 8, 2009 ok it is working. I do. Link to comment Share on other sites More sharing options...
kanber Posted August 10, 2009 Author Share Posted August 10, 2009 can you do tree list more useful. 1-change text colour 2-change font size 3-right and left scroll I will do a project. and I want use tree list but in this position it is not so useful. can you do those things in new version of daqfactory? Link to comment Share on other sites More sharing options...
kanber Posted August 18, 2009 Author Share Posted August 18, 2009 will you do in new version these issue? Link to comment Share on other sites More sharing options...
AzeoTech Posted August 18, 2009 Share Posted August 18, 2009 I do not know, but we'll add it to the list. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.