Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently October 7th, 2024, 7:28 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: How to implement "go to chapter" shortcuts?
PostPosted: January 13th, 2006, 10:53 pm 
Offline

Joined: August 30th, 2005, 2:27 pm
Posts: 22
Location: Porto Alegre, Brazil
Hi, I'm about to finish a publication with around 10 chapters with about 10-40 pages each. I already have three actions in my Master page which respond to keys Home, Left Arrow and Right Arrow. These make the publication jump to the first page, move Forward or Backward respectively. So far so good.

Now I want to add shortcuts so the publication jumps to the first page of each chapter: PageUp should go to the previous one and PageDown to the next chapter. However I found no action like "Go to Next Chapter" or "Go to Previous Chapter" which is what I want. I also tried OpusScript but I can't find a way to get a list of chapters.

Is there a way to do this? Thanks in advance for any help.

_________________
Rubem Pechansky


For this message rubem has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: GoTo Page
PostPosted: January 14th, 2006, 12:25 am 
Offline

Joined: October 25th, 2004, 2:20 pm
Posts: 686
Location: Naperville, Illinois (USA)
Opus: 7.05
OS: Win XP SP3
System: P4 3.2GHz 1GB RAM 2-TB HDs + 4 more
OPUS uses the Action "GoTo Page" for what you are trying to do.

Maybe to make things easier, you could name the first Page in each new Chapter something like "Chapter #1, Chapter #2, etc" so when you are selecting the Page you want to go to, you will immediately see something in the list of Pages that logically makes sense.

I usually name Pages like this:

MAIN MENU
+ Topic xyz
- Point A
- Point B
- Point C
+ Topic abc
- Point D
=Sub Point AA
= Sub Point AB
- Point E
- Point F
EXIT

By using CAPTIAL letters, CHARACTERS like +, -, =, and Indenting SPACES I find it easier to locate sections just by looking at my naming convention.

How about:

1 Chapter 1
1 Page 1
1 Page 2
1 Page 3
2 Chapter 2
2 Subject abc
2 Subject xyz
3 Chapter 3
3 Topic One
3 Topic Two

Hope my little "Tips & Tricks" helps you. Maybe others have methods they would share...

_________________
Fred Harms, Extraordinary Demos
Naperville, Illinois (USA) 630/904-3636
demofred@aol.com


For this message demofred has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: January 14th, 2006, 5:12 pm 
Offline

Joined: November 11th, 2004, 1:43 pm
Posts: 172
Location: Buckinghamshire, UK
Please find attached.
To script the desired effect of jumping to first page of chapter up/down, I have put together the functions that will be handy in arriving at the solution.

Current .imp. indicates the relationship from current page to those higher up in the hierarchy, will complete the chapter up/down scripts and post in new .imp


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


For this message eomc40 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: January 17th, 2006, 2:02 pm 
Offline

Joined: August 30th, 2005, 2:27 pm
Posts: 22
Location: Porto Alegre, Brazil
demofred, eomc40,

Thank you so much for the solutions. I'll implement your suggestions in the publication.

However I feel that the Opus team should add a "go to chapter" command so these operations should be easier and automated, don't you think?

Thanks again,

_________________
Rubem Pechansky


For this message rubem has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: January 17th, 2006, 3:24 pm 
Offline

Joined: August 30th, 2005, 2:27 pm
Posts: 22
Location: Porto Alegre, Brazil
Hmpf. I'm almost giving up on this. Thanks to eomc40's code I can now find the first page of the chapter the current page is on:
Code:
page = this.GetPage().GetParent().GetFirstChild().GetName()

I can go to page, but I didn't find a way to get a reference to the page before it (prev), then find the first page of the chapter of prev is in. Something like:

Code:
prev = page.GotoBackwardPage().GetParent().GetFirstChild().GetName()
GotoPage(prev)

The above code won't work because GotoBackwardPage() is not an object function.

Is there a way to do this? Or should I give up?

TIA

_________________
Rubem Pechansky


For this message rubem has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: January 17th, 2006, 4:47 pm 
Offline

Joined: November 11th, 2004, 1:43 pm
Posts: 172
Location: Buckinghamshire, UK
Given that you have sussed out what that chain of string does, giving up is no option. Move the wheel forward as follows...

Now that you can see thet overall parent the publication

var pub = GetPublication()

you will be able to list number of children of the publication, in this case, all the chapters as follows

var numOfChildren = GetPublication().GetNumberChildren()

What is crucial here is that you want to take note of the first page number in each chapter so that you can compare it to the page you are currently in i.e. where the up/down button is currently located.

The control value here is the chapter you are currently located in.

with the above, you will extend the script to include the following

Cycle through the number of publication children (chapters) and get their pointer. compare that with the current page chapter pointer.

If the pointer is less, up button is allocated,
until you allocate the down button.



P.S Thought I should point you to how easy this can be implemented before you gave up....

If you still need assistance, pm me, and afterwards will post the .imp to this queue for the benefit of other users....

some code to consider follows

var pub = GetPublication().GetFirstChild().GetType()
GetChild()


For this message eomc40 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: January 18th, 2006, 2:49 pm 
Offline

Joined: August 30th, 2005, 2:27 pm
Posts: 22
Location: Porto Alegre, Brazil
eomc40,

I'll give it a try and let you know. Thanks for your support.

_________________
Rubem Pechansky


For this message rubem has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: January 18th, 2006, 3:57 pm 
Offline

Joined: November 11th, 2004, 1:43 pm
Posts: 172
Location: Buckinghamshire, UK
Ruben,
Here is the completed .imp

Scripts associated with the buttons up/down, the scripts however could have been developed further using functions but for ease of association of events on the button, have left the code to remain within the buttons themselves.

triggers chosen

-onshow
-left mouse click

both with script actions...


Have included check to see if there are no more chapters you can access either up or down by fading the buttons....

enjoy...


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


For this message eomc40 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: January 18th, 2006, 5:51 pm 
Offline

Joined: August 30th, 2005, 2:27 pm
Posts: 22
Location: Porto Alegre, Brazil
eomc40 wrote:
Here is the completed .imp

I think you forgot to upload the file :) Oops, it's there now... Thanks.

_________________
Rubem Pechansky


For this message rubem has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: January 18th, 2006, 5:59 pm 
Offline

Joined: August 30th, 2005, 2:27 pm
Posts: 22
Location: Porto Alegre, Brazil
This is exactly what I wanted. Seems that your script will allow me to insert/remove/rename/move chapters or pages at will.

Thank you so much for your time.

_________________
Rubem Pechansky


For this message rubem has been thanked by : mackavi


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

All times are UTC [ DST ]


Who is online

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