DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   Watched TopicsWatched Topics     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Add recto verso option to simplegraph

 
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
Mirage
Member


Joined: 26 Oct 2005
Posts: 42

PostPosted: 27/10/05 09:19    Post subject: Add recto verso option to simplegraph Reply with quote

Hello!

Please give me solution to add the option of recto and verso to simplegraph.
Crying or Very sad
Back to top
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 28/10/05 11:13    Post subject: Reply with quote

Seems you should use two instances of SimpleGraph.

Could you please explain more about your purpose?

_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mirage
Member


Joined: 26 Oct 2005
Posts: 42

PostPosted: 31/10/05 08:49    Post subject: Add recto verso option to simplegraph Reply with quote

Kambiz Hello!
Thank you for your answer!

I wants to add two SimpleGraph one to draw in recto and the other to draw in back I have a problem when I make the save. Please give me a method for save 2 SimpleGraph in only one file.
Thank you in advance! Wink
Back to top
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 31/10/05 16:33    Post subject: Reply with quote

Hi,

You have to use a stream to save graphs in to the stream, then save stream in the file.

Cheers

_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mirage
Member


Joined: 26 Oct 2005
Posts: 42

PostPosted: 01/11/05 07:33    Post subject: Add recto verso option to simplegraph Reply with quote

Kambiz Hello!

Thank you for your answer!
Please given me a method of use of Stream.
I do not know how not used.

Thank you in advance Mr. Kambiz. Rolling Eyes
Back to top
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 01/11/05 09:53    Post subject: Reply with quote

Here are two procedures for saving/loading multiple graphs to/from a single file.

Code:
procedure SaveMutipleGraphs(const FileName: String; Graphs: array of TSimpleGraph);
var
  Stream: TFileStream;
  I: Integer;
begin
  Stream := TFileStream.Create(FileName, fmCreate or fmShareExclusive);
  try
    for I := Low(Graphs) to High(Graphs) do
      Graphs[I].SaveToStream(Stream);
  finally
    Stream.Free;
  end;
end;

procedure LoadMutipleGraphs(const FileName: String; Graphs: array of TSimpleGraph);
var
  Stream: TFileStream;
  I: Integer;
begin
  Stream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite);
  try
    for I := Low(Graphs) to High(Graphs) do
      Graphs[I].LoadFromStream(Stream);
  finally
    Stream.Free;
  end;
end;

Here is an example of usage:

Code:
procedure TMainForm.btnSaveClick(Sender: TObject);
begin
  SaveMutipleGraphs('C:\TEST.MG', [SimpleGraph1, SimpleGraph2]);
end;

procedure TMainForm.btnLoadClick(Sender: TObject);
begin
  LoadMutipleGraphs('C:\TEST.MG', [SimpleGraph1, SimpleGraph2]);
end;

Cheers

_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mirage
Member


Joined: 26 Oct 2005
Posts: 42

PostPosted: 01/11/05 10:48    Post subject: Add recto verso option to simplegraph Reply with quote

Thank you, thank you, thank you, thank you for you Kambiz!
You solved me a major problem.
Thank you, thank you, thank you, thank you for my Allah god!
Back to top
View user's profile Send private message
lbc
Member


Joined: 04 Feb 2004
Posts: 48
Location: Italy

PostPosted: 02/11/05 09:31    Post subject: Reply with quote

great job
thank you Kambiz
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Page 1 of 1

Add to favorites

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group