Re: [Lazarus] Adding data field to a child node in a treeview

2015-07-04 Thread Tony Whyman

Susie,

You may find the code for TIBTreeView in the IBX for Lazarus package as 
a useful example of how to create a data aware treeview. Even you don't 
want to use IBX, the overall approach should work with other DB packages.


Tony Whyman
MWA

On 04/07/15 09:46, Susie Nicol wrote:

Hi - me again

I have a Lazarus treeview, which I am populating from several sql queries.

I add  child nodes in this way, setting them to one of the fields 
returned from the query


   while Not SQLQuery1.EOF do
  Begin

treeview1.items.addchild(treeview1.selected, 
SQLQuery1.fields[0].AsString);


   SQLQuery1.Next
  end;

That works of course.

I want to modify the newly added node by setting its data property to 
another field in the loop - something like


treeview1.SOMETHING.data := Pointer(SQLQuery1.fields[1].AsInteger);

but the problem is that I can't work out how to identify the 
newly-added child node.  Is it possible?


Thanks in advance
Susie
--
Susie K Nicol
Christchurch
New Zealand.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Help for your applications

2015-07-04 Thread Graeme Geldenhuys
On 2015-07-04 10:21, Marc Santhoff wrote:
 I like PasDoc, because it works like JavaDoc:

The original author wasn't clear about exactly what he wants. It might
be worth adding that PasDoc (like fpdoc) is meant for API Class (source
code) documentation , not for general application help.

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Adding data field to a child node in a treeview

2015-07-04 Thread Susie Nicol
Thanks heaps guys. That's great.

On Sat, Jul 4, 2015 at 9:00 PM, Howard Page-Clark h...@talktalk.net wrote:

 On 04/07/2015 09:46, Susie Nicol wrote:

 Hi - me again

 I have a Lazarus treeview, which I am populating from several sql queries.

 I add  child nodes in this way, setting them to one of the fields
 returned from the query

 while Not SQLQuery1.EOF do
Begin

treeview1.items.addchild(treeview1.selected,
 SQLQuery1.fields[0].AsString);

 SQLQuery1.Next
end;

 That works of course.

 I want to modify the newly added node by setting its data property to
 another field in the loop - something like

  treeview1.SOMETHING.data := Pointer(SQLQuery1.fields[1].AsInteger);

 but the problem is that I can't work out how to identify the newly-added
 child node.  Is it possible?


 var
   node: TTreeNode;
 begin

 node:=TreeView1.Items.AddChild(TreeView1.Selected,SQLQuery1.Fileds[0].AsString);
 node.Data:=pointer(SQLQuery1.Fields[0].AsInteger);
 SQLQuery1.Next;
 end;


 ---
 This email has been checked for viruses by Avast antivirus software.
 https://www.avast.com/antivirus


 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Adding data field to a child node in a treeview

2015-07-04 Thread Susie Nicol
Hi - me again

I have a Lazarus treeview, which I am populating from several sql queries.

I add  child nodes in this way, setting them to one of the fields returned
from the query

   while Not SQLQuery1.EOF do
  Begin

  treeview1.items.addchild(treeview1.selected,
SQLQuery1.fields[0].AsString);

   SQLQuery1.Next
  end;

That works of course.

I want to modify the newly added node by setting its data property to
another field in the loop - something like

treeview1.SOMETHING.data := Pointer(SQLQuery1.fields[1].AsInteger);

but the problem is that I can't work out how to identify the newly-added
child node.  Is it possible?

Thanks in advance
Susie
--
Susie K Nicol
Christchurch
New Zealand.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Adding data field to a child node in a treeview

2015-07-04 Thread Michael Van Canneyt



On Sat, 4 Jul 2015, Susie Nicol wrote:


Hi - me again

I have a Lazarus treeview, which I am populating from several sql queries.

I add  child nodes in this way, setting them to one of the fields returned from 
the query

       while Not SQLQuery1.EOF do
  Begin
 
  treeview1.items.addchild(treeview1.selected, 
SQLQuery1.fields[0].AsString);
 
   SQLQuery1.Next
  end;

That works of course.

I want to modify the newly added node by setting its data property to another 
field in the loop - something like

    treeview1.SOMETHING.data := Pointer(SQLQuery1.fields[1].AsInteger);

but the problem is that I can't work out how to identify the newly-added child 
node.  Is it possible?


Not like this. You need to keep a reference when doing an AddChild:

Var
  N : TTreeNode;

begin
  N:=Treeview1.items.addchild(treeview1.selected, SQLQuery1.fields[0].AsString);
  N.data := Pointer(SQLQuery1.fields[1].AsInteger);
end;

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Adding data field to a child node in a treeview

2015-07-04 Thread Howard Page-Clark

On 04/07/2015 09:46, Susie Nicol wrote:

Hi - me again

I have a Lazarus treeview, which I am populating from several sql queries.

I add  child nodes in this way, setting them to one of the fields
returned from the query

while Not SQLQuery1.EOF do
   Begin

   treeview1.items.addchild(treeview1.selected,
SQLQuery1.fields[0].AsString);

SQLQuery1.Next
   end;

That works of course.

I want to modify the newly added node by setting its data property to
another field in the loop - something like

 treeview1.SOMETHING.data := Pointer(SQLQuery1.fields[1].AsInteger);

but the problem is that I can't work out how to identify the newly-added
child node.  Is it possible?


var
  node: TTreeNode;
begin
node:=TreeView1.Items.AddChild(TreeView1.Selected,SQLQuery1.Fileds[0].AsString);
node.Data:=pointer(SQLQuery1.Fields[0].AsInteger);
SQLQuery1.Next;
end;


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Help for your applications

2015-07-04 Thread Marc Santhoff
On Fr, 2015-07-03 at 21:34 +0100, Richard Mace wrote:
 Hi,
 When writing help files and documentation for your apps, what are peoples
 preferences?

I like PasDoc, because it works like JavaDoc:

http://pasdoc.sipsolutions.net/

-- 
Marc Santhoff m.santh...@web.de


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Dbase tutorial

2015-07-04 Thread Larry Dalton
Old dbase

Sent from my iPhone

 On Jul 4, 2015, at 11:04, waldo kitty wkitt...@windstream.net wrote:
 
 On 07/04/2015 09:20 AM, Larry Dalton wrote:
 Where can I get a tutorial for using dbase on lazarus?
 
 dbase as in the old dBase database stuff or dbase as in coding for and 
 using (SQL) databases?
 
 IIRC and unless something has changed that i'm not aware of (quite easy), the 
 dbase interface code is only really for reading that data... today's 
 databases are all SQL databases which offers a lot more capabilities and is 
 really where you should look... if you have an existing dbase database, you 
 might consider to convert it from that format to SQL and store the 
 information in a modern database...
 
 -- 
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.
 
 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Dbase tutorial

2015-07-04 Thread Larry Dalton
Is there a way to use microsoft excel spreadsheets?

Sent from my iPhone

 On Jul 4, 2015, at 11:04, waldo kitty wkitt...@windstream.net wrote:
 
 On 07/04/2015 09:20 AM, Larry Dalton wrote:
 Where can I get a tutorial for using dbase on lazarus?
 
 dbase as in the old dBase database stuff or dbase as in coding for and 
 using (SQL) databases?
 
 IIRC and unless something has changed that i'm not aware of (quite easy), the 
 dbase interface code is only really for reading that data... today's 
 databases are all SQL databases which offers a lot more capabilities and is 
 really where you should look... if you have an existing dbase database, you 
 might consider to convert it from that format to SQL and store the 
 information in a modern database...
 
 -- 
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.
 
 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Dbase tutorial

2015-07-04 Thread Larry Dalton
I used delphi with .db and .xls files for years

Sent from my iPhone

 On Jul 4, 2015, at 11:04, waldo kitty wkitt...@windstream.net wrote:
 
 On 07/04/2015 09:20 AM, Larry Dalton wrote:
 Where can I get a tutorial for using dbase on lazarus?
 
 dbase as in the old dBase database stuff or dbase as in coding for and 
 using (SQL) databases?
 
 IIRC and unless something has changed that i'm not aware of (quite easy), the 
 dbase interface code is only really for reading that data... today's 
 databases are all SQL databases which offers a lot more capabilities and is 
 really where you should look... if you have an existing dbase database, you 
 might consider to convert it from that format to SQL and store the 
 information in a modern database...
 
 -- 
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.
 
 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Dbase tutorial

2015-07-04 Thread waldo kitty

On 07/04/2015 09:20 AM, Larry Dalton wrote:

Where can I get a tutorial for using dbase on lazarus?


dbase as in the old dBase database stuff or dbase as in coding for and using 
(SQL) databases?


IIRC and unless something has changed that i'm not aware of (quite easy), the 
dbase interface code is only really for reading that data... today's databases 
are all SQL databases which offers a lot more capabilities and is really where 
you should look... if you have an existing dbase database, you might consider to 
convert it from that format to SQL and store the information in a modern database...


--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Dbase tutorial

2015-07-04 Thread micsch
Am Saturday 04 July 2015 15:20:57 schrieb Larry Dalton:
 Where can I get a tutorial for using dbase on lazarus?
in the wiki?

http://wiki.freepascal.org/Lazarus_Tdbf_Tutorial

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Dbase tutorial

2015-07-04 Thread waldo kitty

On 07/04/2015 12:19 PM, Larry Dalton wrote:

Is there a way to use microsoft excel spreadsheets?


yes... it is different than database stuffs, though... i haven't done it but i 
have read about it over the years i've been on this list... fpspreadsheet is 
what you want for that... if you are doing anything with csv files, then you 
probably want to start here...


  https://www.google.com/search?q=freepascal+lazarus+csv+files

also, please don't top post... it really messes up trying to follow a 
conversation... it is a huge mess when it gets mixed in with inline posting and 
bottom posting making a truly distasteful hash of things ;)



On Jul 4, 2015, at 11:04, waldo kitty wkitt...@windstream.net wrote:


On 07/04/2015 09:20 AM, Larry Dalton wrote:
Where can I get a tutorial for using dbase on lazarus?


dbase as in the old dBase database stuff or dbase as in coding for and 
using (SQL) databases?

IIRC and unless something has changed that i'm not aware of (quite easy), the 
dbase interface code is only really for reading that data... today's databases 
are all SQL databases which offers a lot more capabilities and is really where 
you should look... if you have an existing dbase database, you might consider 
to convert it from that format to SQL and store the information in a modern 
database...


--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Dbase tutorial

2015-07-04 Thread Larry Dalton
Where can I get a tutorial for using dbase on lazarus?

Sent from my iPhone

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus