Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 31st, 2025, 12:49 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: ability to save "dropped" objects 05XE
PostPosted: June 30th, 2005, 2:19 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

I've set up a diagram maker so that the end-user, using vector graphic symbols with drag and drop actions, can custom create their own diagram. Is there any way in 05XE to allow the end-user to save this customized diagram so they can return to working on, add to, change it at a later time?

The customized diagram page with its dragged and dropped graphic symbols can be printed, copied to clipboard, but these are "static" files that can not be re-opened in a way preserving their customized changes. If they are saved in HTML (for example in IE), when re-opened, the graphics have returned to their default place on the page and not where they had been dragged and dropped to.

Any ideas?

Kind Regards,
Stephen
swartel@nycap.rr.com


Top
 Profile  
 
 Post subject:
PostPosted: June 30th, 2005, 2:37 pm 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
I'm afraid this is the sort of thing that you will have to provide a custom scripting solution for - there's no way Opus could generically do this for you.

I would start by saving the positions of the objects to a file. Then when the publication starts you could read that file back and move the objects to their previous positions.


Top
 Profile Visit website  
 
 Post subject: ability to save "dropped" objects 05XE
PostPosted: June 30th, 2005, 2:58 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Thanks, Duncan.

I would try to do the custom scripting, but as a novice, need a little more direction. The vector graphic objects that are being dragged and dropped into the diagram are clones of "template" original versions at the side of the page. So, I'm unsure, based on working with cloned objects, if the X and Y positions for the dragged and dropped items will refelct their true position in the diagram or the X and Y position of the original object used for cloning. If cloned objects' X and Y's can be saved to a text file, saved, over-written each time a synchronization trigger like page close is used, then they could be read using a synchronization trigger like on Show, next time the publication is opened . Question is: once read, what script action would be used to place each of these cloned items into the diagram?

Perhaps, a different scripting is what you had in mind. I would appreciate any leads so I can try scripting scenarios to try to achieve the desired effect.

Thanks for your help.

Kind Regards,
Stephen
swartel@nycap.rr.com


Top
 Profile  
 
 Post subject:
PostPosted: June 30th, 2005, 3:29 pm 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
Clones are whole new objects. Their positions are independent of the originals so you can just use I am a spammer.GetPosition() to obtain the current location.

Without knowing the exact specifics of your case I would do something like this: Write information about each object as a separate line when the information is saved (on exit or when "Save" is pressed or something), along the lines of:

Code:
object_type_name:xpos:ypos


so maybe something like:

Code:
if_box:110:20
else_box:150:30
if_box:180:40


Then when you read it back you can parse each line to get the data back, create a new clone of the relevant object based on the name (assuming you have master objects for each category like "if_box" and "else_box") and set the clone's position with I am a spammer.MovePosition()


(By the way, we can provide consultancy if required - please contact Sales for more information)


Top
 Profile Visit website  
 
 Post subject: ability to save "dropped" objects 05XE
PostPosted: June 30th, 2005, 3:41 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Duncan

In order to try some scripting, I would need to know how to name the cloned objects, in order to "get" their X and Y positions, etc. The cloning isn't done in the original publication but rather by the end-user who right clicks the particular vector graphic (template original) producing a draggable and droppable clone. So, until the end-user clones and then positions the clone in the diagram, there is no object and no object name to set up script for, unless newly cloned objects would have some form of naming I'm unaware of.

Thanks for your help.

Kind Regards,

Stephen

PS: If you provide a direct e-mail address, I can send the working file for you to take a look at, so you'll get a better idea of the challenges. I'd rather not attach it online.


Top
 Profile  
 
 Post subject:
PostPosted: June 30th, 2005, 4:05 pm 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
Keep track of the clones by assigning them to an array. You can add a data member to the clone to keep track of it's original type.

Code:
clonesList[ totalClones ] = source.CloneObject();
clonesList[ totalClones ].originalClass = "source_type"// or a number or whatever
totalClones++;


Then you can just loop through the clone list and write out their positions

Code:
for (clonePos in clonesList)
{
  var pos = clonesList[ clonePos ].GetPosition();
  // Write the type and pos to a file - fileSave is a script file object - look at OpenFile() for more info
  fileSave.WriteLine( clonesList[ clonePos ].originalClass + ":" + pos.x + ":" + pos.y )
}


(BTW I've not tested any of this...)

If you want to send an example to Support (support at digitalworkshop.com) we can take a look but we can't write your publication for you! :wink:)


Top
 Profile Visit website  
 
 Post subject: ability to save "dropped" objects 05XE
PostPosted: June 30th, 2005, 4:16 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Duncan

Actually, I sent a zipfile by e-mail to Brenden Knifton at Support this morning. I'll re-send it the zipfile now.

Thanks for your help. If I get the leads, I can try to write my own scripting.

Kind Regards,

Stephen


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group