Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-10

JSON Parser to tree view

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt
to ik
ik wrote 6 lines
Hello, I wish to use the JSON parser to create some sort of TreeView of my JSON (it's more then 500 lines of data). Before I'll write such code, do you know of any existed code that does such thing, or at least most of the work ?
See the tools/jsonviewer application in Lazarus. It does exactly that;
editing and all.

Michael.

ik
to Michael Van Canneyt

Thank, that's a great tool, you saved my time and nerves :)

Once again FPC and Lazarus for the rescue.

Ido

Michael Van Canneyt wrote 24 lines
On Thu, 21 Oct 2010, ik wrote: Hello, > > I wish to use the JSON parser to create some sort of TreeView of my JSON > (it's more then 500 lines of data). > Before I'll write such code, do you know of any existed code that does > such > thing, or at least most of the work ? > See the tools/jsonviewer application in Lazarus. It does exactly that; editing and all. Michael. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Luiz Americo Pereira Camara
to ik: I wish to use the JSON parser to create some sort of TreeView of my JSON (it's more then…
ik wrote 6 lines
Hello, I wish to use the JSON parser to create some sort of TreeView of my JSON (it's more then 500 lines of data). Before I'll write such code, do you know of any existed code that does such thing, or at least most of the work ?

http://code.google.com/p/luipack/source/browse/trunk/vtvextras/vtvutils/vtjson.pas

See demos folder

Requires VTV from
http://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/virtualtreeview-new

and
LCLExtensioins from http://code.google.com/p/luipack <http://code.google.com/p/luipack/source/browse/trunk/vtvextras/vtvutils/vtjson.pas>

Luiz

wollepatong
to ik: I wish to use the JSON parser to create some sort of TreeView of my JSON (it's more then…

Small enhancement for the jsonviewer:

In mainform, OnShow change the code to:
-------------------------------------------------------------------------
procedure TMainForm.FormShow(Sender: TObject);
begin
  if (Paramcount > 0) then
    try
      OpenFile(ParamStr(1));
      exit;
    except
      ShowMessage('Cannot open ' + ParamStr(1));
    end;
  NewDocument;
end;
-------------------------------------------------------------------------
Now you can start from a filemanager using Open with... to open json files.
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/JSON-Parser-to-tree-view-tp3230590p5720161.html Sent from the Free Pascal - General mailing list .