Jump to content

UniTreeView1.LoadFromFile & SaveToFile


Abaksoft

Recommended Posts

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 :

  FreeMan uses XML.  But it required Mirosoft XML to be installed. So not a good solution.
 
  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

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

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

×
×
  • Create New...