Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 3:31 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: How to load different docs in DocView at runtime
PostPosted: October 29th, 2007, 10:36 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Is there a way to use Opus Script to set the file to be opened in DocView? I find almost no mention of Docview in Script help.

What I want to do is have 3 files A, B, C. I want the user to choose A or B or C and then have that doc shown in DocView. I'd prefer to do this in Script as I have some other things going on.

I did a non-script workaround using Buttons and standard actions to set variable for the path and filename. But then I had to "reset" current page to get the DocView to refresh.

Any other ideas? Thanks.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: October 29th, 2007, 8:52 pm 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
You don't need to use any scripting (although you can if you want). Make the DocView object use a variable (with the angle brackets <>) and the use action or script to change the variable to point to the document you want to display in the DocView.

It will attempt to update each time you change the variable; so if you are constructing a path in stages, do it into another variable and then just assign the final version at the end so it only updates once.

_________________
ddww Opus Developer


For this message Duncan Lilly has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: script to change docview page
PostPosted: October 29th, 2007, 10:48 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Thanks, Duncan

Am trying that in script. I need to play with it more to get it working and will post back.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: DocView Toolbars and DocView refresh
PostPosted: October 30th, 2007, 3:43 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Here's the update. Got my Script working. Page has a DocView obj, a user InputText, and an execute Button (for script).

Works. But bad news, I can only get DocView to display the alternate File by Refreshing the whole Page.

Any other way to force DocView to reopen itself with the new value (for file)?

Code:
var mynewpath ;
mynewpath = choosefile1 ;
// User enters 1, 2, or 3 into TextInput for 'choosefile1' value
// A DocView object is set to use page variable <usefilepath>
if (mynewpath == 2 )
{
usefilepath = "C:\\for_Opus 6\\This is User Choice 2.htm"
}
else if (mynewpath == 3 )
{
usefilepath = "C:\\for_Opus 6\\This is User Choice 3.pdf"
}
else
{
usefilepath = "C:\\for_Opus 6\\This is User Choice 1.doc"
}
//
//GotoPage("Docvw_test") ;        // resets current page
//
//  Note: The Page variable 'usefilepath' must be persistent for this to work
//  Note: DocView object does not automatically switch to new file when variable
//        changed. Resetting the page (Goto...) is one way to trigger that refresh.



One last question. Is there a way to "configure" which toolbars appear when DocView displays at runtime?

Right now I get Markup & Review icons only (for Word docs). I want Standard toolbar icons. See attached image. [ this is MS Word 2003 ]


You do not have the required permissions to view the files attached to this post.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: DocView Toolbars and DocView refresh
PostPosted: October 30th, 2007, 9:34 pm 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
Lar_123 wrote:
Any other way to force DocView to reopen itself with the new value (for file)?

I haven't tried this but you could try using the Refresh() command on the DocView object
Code:
myDocView.Refresh();


Lar_123 wrote:
One last question. Is there a way to "configure" which toolbars appear when DocView displays at runtime?

The user interface (if any) presented by an embedded object is outside the control of Opus I'm afraid - it's up to the embedded application.

_________________
ddww Opus Developer


For this message Duncan Lilly has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: docview to load different file
PostPosted: October 31st, 2007, 1:42 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Here's some of the things I tried.

Added to script:
DocView_2.Refresh() ; //did not work to load new page
...later tried viewing in a Browser object same way
Browser_5.Refresh() ;
These did not work. Just redisplays current page.

But you got me in the right direction. I tried this and IT WORKED.

Code:
DocView_2.Navigate(usefilepath) ;    //insert this at end of script above


What this does is a quick change of file display in the docview. It even changes from .doc to .pdf to .htm etc (at least for a Win XP and MS Word 2003 rig).
Very handy.

Please expand on DW documentation of this feature.

---------------------
too bad can't pass some parameter to set DocView toolbar options.

Duncan, Thanks

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 41 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