Skip to main content
Participating Frequently
September 16, 2023
Question

Problem with 2 tree views

  • September 16, 2023
  • 1 reply
  • 1209 views

Hi,

 

I have 2 TreeViewWidgets in my dialog box. However when I dynamically populate 1 the other also gets populated.

Attached is the .fr file.

 

How do I keep upload of these 2 TreeViewWidgets  seperate

This topic has been closed for replies.

1 reply

Inspiring
September 17, 2023

You are using the same Implementation ID and same CPP files for TreeVierwWidgetMgr and TreeViewHierarchyAdapter.

 

When treeview is displayed it calls functions such as GetNumOfItems, GetNthItem etc. Becuase your cpp files are common, both tree view widgets uses the same business logic and displays the same content.

 

Solution -

Create separate implementationID and corresponding cpp files.

 

 

- Rahul Rastogi

Adobe InDesign SDK Plugin Developer.

 

 

Class
{
kWMSlDlgTreeViewWidgetBoss,
kTreeViewWidgetBoss,
{
IID_ITREEVIEWWIDGETMGR,            kWMSlDlgTreeViewWidgetMgrImpl,
IID_ITREEVIEWHIERARCHYADAPTER,    kWMSlDlgTreeViewAdapterImpl,
/** Hold names of the list item */
IID_ISTRINGLISTDATA,        kStringListDataImpl, 
}
},
 
Class
{
kWMSlDlgTreeViewWidgetBoss2,
kTreeViewWidgetBoss,
{
IID_ITREEVIEWWIDGETMGR,            kWMSlDlgTreeViewWidgetMgrImpl,
IID_ITREEVIEWHIERARCHYADAPTER,    kWMSlDlgTreeViewAdapterImpl,
/** Hold names of the list item */
IID_ISTRINGLISTDATA,        kStringListDataImpl, 
}
},
Participating Frequently
September 17, 2023

Hello Rahul,

 

I did try with seperate implemention ID and corresponding cpp files, but it crashes on dialog creation: line 174 in WatermarkUIActionComponent.cpp.

 

You can get the source code from this link .

 

The sub directory "Data Text Files" contains all the text files used in the plugin.

The sub directory "Build Related Files" contains *.vcxproj* files.

 

This is my first plugin. Trying to build my plugin by modifying the watermarkui plugin in SDKSamples. Kindly help.

 

Ziauddin Syed

Inspiring
September 17, 2023

Did you debugged to find the crash point ?

 

Did you debug your TreeViewHierarchyAdapter and TreeViewWidgetMgr ?

 

When you instantiate the dialog, then TreeViewHierarchyAdapter and TreeViewWidgetMgr gets called for both tree views.

 

or there could be problem related to duplicate IDs defined in WatermarkUIID.h. Did you tried running your plugin with InDesign debug build  ? you could get some asserts.