cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Translate the entire conversation x

Creo toolkit implement tree in UI

AS_10362470
4-Participant

Creo toolkit implement tree in UI

I am working with Creo 8. I would like to implement a dialog with tree view in it. The tree has 3 columns. I have spent few of hours trying to understand API to create and populate tree. But not able to figure how to do it. With C++ I wasn't even able to add node to tree. With C I could add node but not able to figure how to add column. If anyone has tried this already I would appreciate the help in from of sample code.

 

FWIW -

 

For C I have following working code to add node -

 

    auto status = ProUITreeColumnCreate("dialog_material_assign_assembly",
                                        "MatAssignTree", nullptr, L"Test", 10,
                                        PROUITREECOL_LEFT);
    status = ProUITreeNodeInsert("dialog_material_assign_assembly",
                                 "MatAssignTree", "root", L"Root Node", nullptr,
                                 "node_type", nullptr);
 
With C++ I tried I this but its not working -
 
    uifcTree_ptr ptrMatAssignTree =
            uifcTreeFind("dialog_material_assign_assembly", "MatAssignTree");
    auto ptrItem = uifcTreeItemDefine("root_item");
    ptrItem->SetText("Root Item");

    auto ptrPos = uifcItemPositionData::Create();
    ptrPos->SetIndex(0);
    ptrPos->SetIsBefore(false);
    ptrMatAssignTree->InsertItem(ptrItem, ptrPos);

   

 

 

 

ACCEPTED SOLUTION

Accepted Solutions

If you want add column in tree ui component.Set attribute [.TreeAttributeWindow] for [True]。

edit .res file with notepad,add attribute (.TreeAttributeWindow  True) in (TreeAttributeWindow testTree)

 

View solution in original post

3 REPLIES 3

If you want add column in tree ui component.Set attribute [.TreeAttributeWindow] for [True]。

edit .res file with notepad,add attribute (.TreeAttributeWindow  True) in (TreeAttributeWindow testTree)

 

Hello, have you figure out your problem? 

I am faced with the same question like yours. I can hardly understand the logic of composing the node in UI Tree.

Can you send me some code about UI Tree, this will help me absolutely.

Thank you.

Hello, As suggested in accepted solution I modified my .res file to add following line (.<your_tree_view_name>TreeAttributeWindow  True) Replace <your_tree_view_name> with actual tree view name. Then I used ProToolkit API ProUITreeNodeInsert() to insert node in tree. It worked for me.

Announcements

Top Tags