Recent

Author Topic: TZedDBTreeView  (Read 9034 times)

mrangelov

  • Newbie
  • Posts: 2
TZedDBTreeView
« on: February 23, 2012, 01:07:41 am »
I'm glad to announce a new component written for Lazarus.
TZedDBTreeView is Data Aware TreeView. It is designed to load self-referenced hierarchical data sets. It is fast and loads all the data when it is built. There's no need to rebuild the tree for every modification. Data's nature independent, so you can connect it to database on your choice. Supports browsing and modifications both ways (Tree -> Dataset, Dataset -> Tree).

Project home page is: http://code.google.com/p/zeddbtreeview/
You can download source code and demo from: http://code.google.com/p/zeddbtreeview/downloads/list
 

joseme

  • Full Member
  • ***
  • Posts: 128
    • Logosoft sistemas
Re: TZedDBTreeView
« Reply #1 on: February 23, 2012, 02:22:36 am »
I have waited a long time for this! Thank you very much!!!
un aporte a la comunidad:
http://pascalylazarus.blogspot.com/

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: TZedDBTreeView
« Reply #2 on: February 23, 2012, 09:05:14 am »
Hi mrangelov, thanks a lot for publishing this!

I have a question though: I quickly looked through the zip file and noticed that the .lpk shows a GPLv2 license, which, if I understand correctly, would mean that everything a developer combines and compiles with the component, including the LCL and the dev's application, becomes GPLv2 as well and must be published as source code..

Do I understand correctly and are you sure that's your intention? Perhaps it would be more fitting to use the LGPL with linking exception as used by LCL components, e.g. cursorimage.inc contains:
Quote
*****************************************************************************
 *                                                                           *
 *  This file is part of the Lazarus Component Library (LCL)                 *
 *                                                                           *
 *  See the file COPYING.modifiedLGPL.txt, included in this distribution,    *
 *  for details about the copyright.                                         *
 *                                                                           *
 *  This program is distributed in the hope that it will be useful,          *
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     *
 *                                                                           *
 *****************************************************************************
}

these refer to a file copying.modifiedlgpl.txt, which you could include in your zip:
Quote
This is the file COPYING.modifiedLGPL, it applies to several units in the
Lazarus sources distributed by members of the Lazarus Development Team.
All files contains headers showing the appropriate license. See there if this
modification can be applied.

These files are distributed under the Library GNU General Public License
(see the file COPYING.LGPL) with the following modification:

As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent modules,
and to copy and distribute the resulting executable under terms of your choice,
provided that you also meet, for each linked independent module, the terms
and conditions of the license of that module. An independent module is a
module which is not derived from or based on this library. If you modify this
library, you may extend this exception to your version of the library, but
you are not obligated to do so. If you do not wish to do so, delete this
exception statement from your version.


If you didn't receive a copy of the file COPYING.LGPL, contact:
      Free Software Foundation, Inc.,
      675 Mass Ave
      Cambridge, MA  02139
      USA


This would also make it possible to integrate it as a standard LCL control in future...


Thanks a lot,
BigChimp

Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

mrangelov

  • Newbie
  • Posts: 2
Re: TZedDBTreeView
« Reply #3 on: February 23, 2012, 12:31:40 pm »
Hi BigChimp,

Yes, you are right about license, I didn't choose proper one, so I'll consider changing it soon. I am new in publishing open source and I am not familiar in deep whit licenses details.

Thank you,
mrangelov

matthius

  • Full Member
  • ***
  • Posts: 129
  • Creating VRAD...
    • LIBERLOG - Développement rapide
Re: TZedDBTreeView vs TVirtualDBTreeEx
« Reply #4 on: March 17, 2012, 07:38:13 am »
What's new from TVirtualDBTreeEx :
http://lazarus-components.org/downloads/Components-with-sources/Visual-Components/Trees/TVirtualDBTreeEx/  ?

VirtualDBTree can create a checking interface entirely linked to data. You can edit it with TDBGroupview from Extended : http://extended.liberlog.fr
« Last Edit: March 17, 2012, 07:59:33 am by matthius »
M. GIROUX
13 rue Tanguy PRIGENT
35000 RENNES - France
(33)(0)2 23 46 06 54
http://liberlog.fr

laguna

  • Sr. Member
  • ****
  • Posts: 295
Re: TZedDBTreeView
« Reply #5 on: October 12, 2012, 11:11:39 am »
Hello,
I updated the procedure because the loop "FOR" did not read the entire DataSet

Update procedute to file   zeddbtreeview.pas

{ TZedDBTreeView }

(******************************************************************************
* Builds the tree by iterating through all dataset records.
*******************************************************************************)
procedure TZedDBTreeView.BuildTree;
var
  ParentIndex, i : Integer;
  Node, NewNode : TZedTreeNode;
begin
  if HasToProceedTree then
    begin
      Self.BeginUpdate;
      try
        Self.Items.Clear;
        FTextDataLink.DataSet.Close;
        FTextDataLink.DataSet.Open;
        FTextDataLink.DataSet.First;
        FNodes := TList.Create;
        //  for i:= 1 to FTextDataLink.DataSet.RecordCount do
        //   begin
        repeat
           if ( FTextDataLink.DataSet.FieldByName(FParentDataLink.FieldName).IsNull ) then
             begin
               NewNode := Self.Items.AddNewChild(nil, FTextDataLink.Field.AsString);
               NewNode.ID := FTextDataLink.DataSet.FieldByName(FIDField).AsInteger;
               NewNode.ParentID := FParentDataLink.DataSet.FieldByName(GetParentField).AsInteger;
             end
          else
            begin
              ParentIndex:= GetParentIndex(FTextDataLink.DataSet.FieldByName(FParentDataLink.FieldName).AsInteger);
              if ParentIndex > -1 then
                begin
                  Node := Self.Items[ParentIndex];
                  NewNode := Self.Items.AddNewChild(Node, FTextDataLink.Field.AsString);
                  NewNode.ID := FTextDataLink.DataSet.FieldByName(FIDField).AsInteger;
                  NewNode.ParentID := FParentDataLink.DataSet.FieldByName(GetParentField).AsInteger;
                end
              else
                begin
                  NewNode := Self.Items.AddNewChild(nil, FTextDataLink.Field.AsString);
                  NewNode.ID := FTextDataLink.DataSet.FieldByName(FIDField).AsInteger;
                  NewNode.ParentID := FParentDataLink.DataSet.FieldByName(GetParentField).AsInteger;
                  FNodes.Add(NewNode);
                end;
            end;
          FTextDataLink.DataSet.Next;
        //end;
        until (FTextDataLink.DataSet.Eof);

        RefreshNodes;
        FNodes.Free;
      finally
        FTextDataLink.DataSet.First;
        Self.EndUpdate;
      end;
    end;
end; 
« Last Edit: October 12, 2012, 11:20:12 am by laguna »

gogosoft

  • Newbie
  • Posts: 1
Re: TZedDBTreeView
« Reply #6 on: September 19, 2014, 10:45:13 am »
laguna's code fix is essential.
The data doesn't load entirely otherwise.

 

TinyPortal © 2005-2018