Abaksoft Posted December 19, 2017 Share Posted December 19, 2017 Hello Farshad, Is it possible to add these 2 methodes (LoadFomFile & SaveToFile) to UniTreeView ? (File ? a Text one). Why ? In a big structure, scan records from a DataBase, UniTreeView can take big times (It's not because of Unigui, this is from the sweep DB : While Not Query.Eof do ..... Query.Next). In a previous VCL project I used these two methodes and it was very fast as a formula 1 : Just write manually a Text, with spaces and it works impeccably (all nodes take their place). See in attachment example. In related topcs : - http://forums.unigui.com/index.php?/topic/8787-tunitreeview-export-to-xml/&do=findComment&comment=45188 FreeMan uses XML. But it required Mirosoft XML to be installed. So not a good solution. - http://forums.unigui.com/index.php?/topic/5749-import-export-tunitreeview-txt-file/?hl=unitreeview Stiaas uses a VCL code, I Could'nt exported it to Unigui : Methode .MoveTo does'nt exists. So, I tried to modify the UniTreeViews.pas to add all procedures from unit Vcl.ComCtrls like : procedure TTreeStrings.LoadTreeFromStream(Stream: TStream; AEncoding: TEncoding); procedure TTreeStrings.SaveTreeToStream(Stream: TStream; AEncoding: TEncoding); But after 3 hours, I had to leave (too difficult for me). Can you do it please Farshad, or is there an alternate soution from ExtJS ? Thx ____ VCL LoadFromFile Project VCL_TreeView_Memo.zip Link to comment Share on other sites More sharing options...
Sherzod Posted December 19, 2017 Share Posted December 19, 2017 Hi, We will try Best regards, Link to comment Share on other sites More sharing options...
Freeman35 Posted December 22, 2017 Share Posted December 22, 2017 Hello, I used xml 'cos no need extra control so easy to use. my os is w10 and default installed. I mean I don't install extra program, driver etc. this are default come with delphi. I'm use delphi tokyo."uses Xml.XMLIntf, Xml.XMLDoc;" My suggestions are. 1- You can use 3rd party xml tools. can find free one on web ( I think ) 2- Can use Recod. key words are "delphi sequential file", "assignfile", "reset", "closefile", "rewrite" (I remeber pascal 5.5 ) 3- Can modify my code and use any text file, but you haveto add many control code. 4- Not tested, but you can create TTreeView on runtime, none show. and add node(s) like UniTrreview, I mean clone unitreeview to treeview vcl. then saveto stream or saveto file this vcl. then free vcl treeview. for loadfromxxx same way. Reagrds Link to comment Share on other sites More sharing options...
Abaksoft Posted December 22, 2017 Author Share Posted December 22, 2017 Thank you FreeMan, When i Try your program uniTreeViewXML.zip from http://forums.unigui.com/index.php?/topic/8787-tunitreeview-export-to-xml/#entry45188 I have a DOMexception : "No Microsoft MSXML installed" ! Maybe, because I have no MSOffice on my PC (just OpenOffice). Tested on Delphi Tokyo. I like your suggestion N°4, I will try . But the best way, is to complete UniTreeViews.pas by overloading methodes from Delphi unit Vcl.ComCtrls. I continue to test and comme back soon. Thx Link to comment Share on other sites More sharing options...
Recommended Posts