SlickEdit Community

SlickEdit Product Discussion => SlickEditĀ® => Slick-CĀ® Macro Programming => Topic started by: msCoder on November 19, 2021, 01:35:38 pm

Title: Save elements in a tree_view to be restored upon next invocation of Slick Edit
Post by: msCoder on November 19, 2021, 01:35:38 pm
I am developing a custom form which has a tree_view control in it. I would like to be able to save the tree_view elements when I quit SlickEdit and then be able to restore them the next time SlickEdit is started. Can anybody give me some guidance on how to do this?

Thanks,
Mark  ???
Title: Re: Save elements in a tree_view to be restored upon next invocation of Slick Edit
Post by: Dan on November 19, 2021, 02:35:18 pm
Take a look at _TreeSaveDataXML and _TreeLoadDataXML.  I will try to put together a sample later today.
Title: Re: Save elements in a tree_view to be restored upon next invocation of Slick Edit
Post by: msCoder on November 19, 2021, 04:26:36 pm
Thank you for the quick response. I have given it a try - copying what I found in svcurl.e (which uses that function).

Partially works. My tree_view contains 5 columns. The first three are check-box columns, and the last two are text-columns.
The effect I am getting is that only the last two text-columns are getting restored. The first three columns do NOT show me a check-box??

Will keep trying...
Title: Re: Save elements in a tree_view to be restored upon next invocation of Slick Edit
Post by: Dan on November 19, 2021, 04:32:24 pm
It is possible it doesn't save and restores checkboxes, I will take a look at it later.  I may be able to add it.
Title: Re: Save elements in a tree_view to be restored upon next invocation of Slick Edit
Post by: msCoder on November 23, 2021, 08:22:58 pm

Thank you again for the help. By using the callback functionality of _TreeLoadDataXML() & _TreeSaveDataXML(), I was able to add XML attributes to each node in the XML file, saving the checkbox state. When my 'load' callback is called I fetch the attribute and then call _TreeSetCheckState()

Seems to do the trick.
Title: Re: Save elements in a tree_view to be restored upon next invocation of Slick Edit
Post by: Dan on November 23, 2021, 08:39:29 pm
That's great, I'm sorry I didn't think of that.