Jump to content

TuniTreeView export to XML


Recommended Posts

Hello,

I need to export Treeview to xml, and I wrote this unit. Saveto file and read fromfile.

Just can not set TuniTreeNode.Level, 'cos that property is readonly. So this mean file hasto be ordered, if you add/change manually xml file.

I wanna use TreeView like a menu, sometime modified and there is no export import way. And I don't like add item(s) in code.

 

1.1 new: added "use_menu_id" compiler directive. This is Add "mnu_id" Attribute in xml. This is for on TUniTreeView.OnClick (How to use detail in pas header)

 

this codes are howto use:

// Save
 With TuniTreeViewToXML.Create(UniTreeView1) do
 try
   SaveToFile('test.xml');
 finally
   Free;
 end;

//  load
  UniTreeView1.Items.Clear;//  !!!! important, you have to clear all item first
  With TXMLTouniTreeView.Create do
  try
    XMLTouniTreeView(UniTreeView1, 'test.xml');
  finally
    Free;
  end;

uniTreeViewXML.zip

Link to comment
Share on other sites

  • 6 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...