Author |
Topic |
|
starman2049
USA
15 Posts |
Posted - 02/02/2010 : 5:04:09 PM
|
I don't see "Tree Control" as a valid Origin User Control type. Am I missing something, or is it not available to Origin 8 C development?
I want to be able to import a CSV with coded headers so I can build a hierarchical tree control of available data types with color coding and expandable branches and then be able to select data to chart.
Origin Ver. and Service Release (Select Help-->About Origin): 8.1 Operating System: XP |
|
starman2049
USA
15 Posts |
Posted - 02/03/2010 : 11:29:12 AM
|
Ok, so it looks like DynaControl is a form of tree control, but I can find very little docs on it and no samples. I was able to lay down a Tree Control in VS2008 and use the following code to "cast" it to a DynaControl:
DynaControl myDC;
myDC.CreateControl(GetItem(IDC_TREE3).GetSafeHwnd());
myDC.SetTree(tr, DYNALAYOUT_BACKGROUND_GRAY);
But I have no idea on how to customize it so I can make nodes/leafs selected/unselected.
Anyone have any experience with this? |
|
|
TreeNode
64 Posts |
Posted - 02/03/2010 : 12:16:48 PM
|
Hi,
I am not really sure what you are talking about. There are composite datatypes Tree, and TreeNode in Origin. The Reference of the class TreeNode shows many methods, doing operations on TreeNodes, like getting, setting Values, Attributes, find Nodes by Attribute and so on...
The Tree class supports direct Import of XML data. So perhabs, you could parse the data from CSV-format to XML-format? After that you would just have to do the following:
bool import_xml_data()
{
Tree tr; // declare Tree object
string strFile = "C:\\myProject\\xmlData\\myData.xml";
// import XML-data into Tree
tr.Load( strFile );
// Check, if import was successful
if(!tr)
{
out_str("Could not import xml-Data into Tree!\n");
return false;
}
out_tree(tr); // show Tree
return true;
}
But perhabs I miss understood your problem, and you are talking about something different.
Or do you mean with "Tree-Control", that you want to set the import-properties for your CSV-data, using a Tree that holds these settings?
<!-- helping each other is a good thing...like TreeNode holding the branches and leaves of a Tree --> |
|
|
starman2049
USA
15 Posts |
Posted - 02/03/2010 : 12:34:05 PM
|
TreeNode, thanks for the response. I was trying to get at how to visually represent in a user interface a selectable tree node. In windows programming there is a user interface element called a Tree Control that does not appear to have been implemented in Origin 8 yet.
I was able to get a DynaControl working that appears to function like a Tree Control, but I don't see any samples, and the documentation is thin. Looking at the comments in the code it looks like this weas being worked on as of late 2009.
I think I will just use two side-by-side listboxes and implement my own tree-like userinterface element.
Thanks! |
|
|
TreeNode
64 Posts |
Posted - 02/03/2010 : 1:10:36 PM
|
Ok,
now I think I have a better understanding of what you want. Let me have another try... ;D
You want to create a user-Interface, where a Tree holds the entered data? For example a User Interface with Checkboxes, Lists, drop-down menues?
When thats your intention, there is a Implementation in Origin: called GetNBox. In fact its a collection of Makros. With these Makros you can set up a User-interface where all the elements you need, checkboxes, lists and so on...will be put one after another.
All the values, you enter, or the state of a checkbox, holds a Tree. You can access this tree, save these values, execute functions, depending on these values. There is also a Event-Handler function, which is executed, when user changes values in the dialog.
I have experience with that, because I use these Makros as a possibility for user-Interface intensivly, and it works fine.
But if I got you wrong another time, perhabs you must ask somebody else ;D Then I am not able to understand your problem ;D
greetz
<!-- helping each other is a good thing...like TreeNode holding the branches and leaves of a Tree --> |
|
|
cpyang
USA
1406 Posts |
|
|
Topic |
|
|
|