Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic FlowChart Load From String with Append Option (Read 3878 times)
Hatem
YaBB Newbies
*
Offline



Posts: 2
Joined: Aug 27th, 2009
FlowChart Load From String with Append Option
Aug 27th, 2009 at 9:35pm
Print Post  
Hi All,
Are there any way to load a seved chart from String, or XML or even from file with option that ask about the way of loading, is it after clearing the current contents, or appending the saved data to the current ones to put them on a specific starting point (X,Y)?
I hope it is availbale. Tongue
Otherwise, please advise with an alternative way! Undecided
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowChart Load From String with Append Option
Reply #1 - Aug 28th, 2009 at 7:28am
Print Post  
Hi,

It's available, to a certain extent. There are undocumented SaveToStream and LoadFromStream methods that save the currently selected flowchart items, and respectively load items into the flowchart. The control uses these methods internally for the implementation of clipboard and OLE drag-and-drop features. Now in order to implement what you need, you would have to load the file or string into a hidden FlowChart instance, select all items, and call hidden.SaveToStream, then call LoadFromStream on the main flowchart. This would require that your programming language has some support for creating IStreams; for a VB6 example, check this link:
http://channel9.msdn.com/forums/TechOff/83111-Writing-Large-XML-files-in-VB6-ISt...

If you can't create a stream, you might use CopyToClipboard and PasteFromClipboard to transfer the items between the two flowcharts, but this is rude because it would destroy the user's clipboard content 8)

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Hatem
YaBB Newbies
*
Offline



Posts: 2
Joined: Aug 27th, 2009
Re: FlowChart Load From String with Append Option
Reply #2 - Aug 29th, 2009 at 11:10am
Print Post  
Good, your alternative suggestion is what I did. Wink
But, I bellive it will be better for this option to be added to the "LoadFromString" method. I hope it will be implemented later.

However, may you recommend a workaround way to backup the clipboard content in a variable or object to be restored after we finish.

Many Thanks Stoyo for the great support.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowChart Load From String with Append Option
Reply #3 - Aug 30th, 2009 at 6:59am
Print Post  
Hi Hatem,

If you are using VB6, you could implement clipboard backup via the GetText/SetText ad GetData/SetData methods of the Clipboard object. You can see an example here

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint