TsimpleGraph Readme file Spanish translation

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

Postby kokkoras » March 15th, 2006, 9:55 am

HPW wrote:I have a look at the TTreenode-help and I am not sure about the storage.
The pointer points to the data, but is the data then part of the node-object and stored with it?


Regarding the treeNodes, no, the data object is not part of the treeNode. That is, if you want to synchronize the tree nodes with the associated data objects then you have to create and associate those data objects yourself when a tree node is created (use AddChildObject or the Data property). Additionally, you should add code in the onDelete event handler of the treeView to delete the associated data object as well. If you want to make it part of the tree node then you should derive a descendant class and put your data objects there.

I am note sure what exactly Kambiz did there, but this issue was a past request of mine and I think this is the solution, which I found elegant and most wellcome as it follows known paths from the VCL.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby HPW » March 15th, 2006, 11:32 am

If you want to make it part of the tree node then you should derive a descendant class and put your data objects there.


Since we are talking about TSimpleGraph, I would have to extend TGraphObject with a new key property 'DataList' (TStringlist) to have a generic container for invisible text-based data. This would be part of the object and stored inside *.sgp with no hassle to syncronise it with outside tables.

Maybe enough generic to get into the standard?

Excuse that we get so off-topic! ;-)
Hans-Peter
HPW
Moderator
Moderator
 
Posts: 238
Joined: February 25th, 2006, 10:19 am
Location: Germany

Postby kokkoras » March 15th, 2006, 11:47 am

HPW wrote:Since we are talking about TSimpleGraph, I would have to extend TGraphObject with a new key property 'DataList' (TStringlist) to have a generic container for invisible text-based data. This would be part of the object and stored inside *.sgp with no hassle to syncronise it with outside tables.

Maybe enough generic to get into the standard?


I am not sure if you will get "ready" save/load functionality for these extensions. You must probably alter the methods related to the *.sgp storing/loading.

HPW wrote:Excuse that we get so off-topic! ;-)

Yes we are. Let's put an end. :roll:
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » March 15th, 2006, 12:48 pm

kokkoras is right.

I though having only Tag property is not enough for some guys, therefore Data property added.

In opposite of Tag property, the object doesn't store value of Data property.

I'll add some events to SimpleGraph for sreaming in/out custom data of each object.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » March 15th, 2006, 1:13 pm

Kambiz wrote:I'll add some events to SimpleGraph for sreaming in/out custom data of each object.


You mean you will provide the hooks for anyone interested in implementing the saving/loading of those data inside *.sgp files, right?
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » March 15th, 2006, 1:43 pm

I've already added them. :D

OnObjectRead: TGraphStreamEvent;
TGraphStreamEvent = procedure(Graph: TSimpleGraph; GraphObject: TGraphObject; Stream: TStream) of object;

Occurs when property settings of a graph object is being read from a stream. This event can be used to retrieve custom data of the graph object from the stream.

OnObjectWrite: TGraphStreamEvent;
TGraphStreamEvent = procedure(Graph: TSimpleGraph; GraphObject: TGraphObject; Stream: TStream) of object;

Occurs when property settings of a graph object is being written in to a stream. This event can be used to save custom data of the graph object in to the stream.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » March 15th, 2006, 1:50 pm

Kambiz wrote:I've already added them. :D


What if I don't want to save those data in my *.sgp file? Is it compulsory or optional?
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby HPW » March 15th, 2006, 3:18 pm

OnObjectRead:
OnObjectWrite:


Sounds very usefull!
Can you add some sample code how to use it in the final 2.1 release?
:?:

:(
Hans-Peter
HPW
Moderator
Moderator
 
Posts: 238
Joined: February 25th, 2006, 10:19 am
Location: Germany

Postby kokkoras » March 15th, 2006, 3:24 pm

HPW wrote:Can you add some sample code how to use it in the final 2.1 release? :?: :(


Patience people. Let's wait for the release :wink:
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » March 15th, 2006, 3:26 pm

It's an event, so is optional.

There's one restriction for streams containg custom data. These kind of streams are not compatible with the codes of other developers. This restriction affects .sgp files and clipboard.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » March 15th, 2006, 3:33 pm

Kambiz wrote:These kind of streams are not compatible with the codes of other developers. This restriction affects .sgp files and clipboard.


ok. This is expected. The unaware loader/version should just ignore those data, though.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby HPW » March 15th, 2006, 3:37 pm

There's one restriction for streams containg custom data. These kind of streams are not compatible with the codes of other developers. This restriction affects .sgp files and clipboard.


One reason to think about a generic text container, which could be compatibel between other developers.
Hans-Peter
HPW
Moderator
Moderator
 
Posts: 238
Joined: February 25th, 2006, 10:19 am
Location: Germany

Postby Kambiz » March 15th, 2006, 4:02 pm

HPW,

A generic stream is more powerfull than a generic text, isn't it?

----

I found a solution to get rid of that restriction using a boolean property, without any overload for users who do not need this feature.

OnObjectRead event occurs only when there's any custom data for the object.

OnObjectWrite event occurs when HasCustomData property of the object is set to True.

If an instance of the simple graph doesn't care about the CustomData of an object, it throw outs the data.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » March 15th, 2006, 4:14 pm

Kambiz wrote:I found a solution to get rid of that restriction using a boolean property, without any overload for users who do not need this feature.


That's perfect. Thank you.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby HPW » March 15th, 2006, 4:37 pm

A generic stream is more powerfull than a generic text, isn't it?


Sure, and it seems you found the better solution.
And when you add a usefull sample, it would be perfect! :wink:
2.1 seems to get very exiting! So keep on.
Hans-Peter
HPW
Moderator
Moderator
 
Posts: 238
Joined: February 25th, 2006, 10:19 am
Location: Germany

PreviousNext

Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 5 guests

cron