Jump to content


Photo

UniTreeView1.LoadFromFile & SaveToFile


  • Please log in to reply
3 replies to this topic

#1 Abaksoft

Abaksoft

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 618 posts
  • LocationAlgeria

Posted 19 December 2017 - 10:45 AM

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

Attached Files


  • 0

#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5010 posts

Posted 19 December 2017 - 11:02 AM

Hi,

 

We will try

 

Best regards,


  • 0

#3 Freeman35

Freeman35

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 331 posts

Posted 22 December 2017 - 09:35 AM

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


  • 0

#4 Abaksoft

Abaksoft

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 618 posts
  • LocationAlgeria

Posted 22 December 2017 - 11:24 AM

Thank you FreeMan,

 

When i Try your program  uniTreeViewXML.zip   from

http://forums.unigui...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


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users